There are various simple ways to do this using higher-order functions, but please keep in mind that asking for a fully optimized, zero-overhead, and convenient solution without providing an MWE is somewhat unrealistic.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| How to "freeze" parameters to functional objects? | 3 | 466 | October 7, 2021 | |
| Varying parameter in a function | 14 | 1099 | August 12, 2020 | |
| Why is this closure over keyword arguments causing such a dramatic slowdown? | 19 | 833 | March 22, 2020 | |
| Implement a convenient interface to keep some parameter fix for optimization | 2 | 466 | November 5, 2019 | |
| Fix parameter when passing to optimizer | 26 | 2549 | April 12, 2025 |