Skip to content

Commit

Permalink
python: update method signature
Browse files Browse the repository at this point in the history
  • Loading branch information
rbberger committed Apr 19, 2024
1 parent 1254adf commit df11689
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ using namespace singularity;

// Helper function to convert lambda numpy array to double* buffer
// With std::optional we would add support for a default value of lambda=None
template<typename T, PORTABLE_FUNCTION Real(T::*Func)(const Real, const Real, Real*) const>
template<typename T, PORTABLE_FUNCTION Real(T::*Func)(const Real, const Real, Real*&&) const>
Real two_params(const T& self, const Real a, const Real b, py::array_t<Real> lambda) {
return (self.*Func)(a, b, lambda.mutable_data());
}

template<typename T, PORTABLE_FUNCTION Real(T::*Func)(const Real, const Real, Real*) const>
template<typename T, PORTABLE_FUNCTION Real(T::*Func)(const Real, const Real, Real*&&) const>
Real two_params_no_lambda(const T& self, const Real a, const Real b) {
return (self.*Func)(a, b, nullptr);
}
Expand Down

0 comments on commit df11689

Please sign in to comment.