Helps wrap a C++ functor taking a pair of scalar arguments as a broadcasting ufunc-like Python object. More...
#include <ufunc.hpp>
Static Public Member Functions | |
static python::object | call (TBinaryFunctor &self, python::object const &input1, python::object const &input2, python::object const &output) |
static python::object | make () |
Helps wrap a C++ functor taking a pair of scalar arguments as a broadcasting ufunc-like Python object.
Typical usage looks like this:
struct CosSum { typedef double first_argument_type; typedef double second_argument_type; typedef double result_type; double operator()(double input1, double input2) const { return std::cos(input1 + input2); } }; BOOST_PYTHON_MODULE(example) { class_< CosSum >("CosSum") .def("__call__", binary_ufunc<CosSum>::make()); }
static python::object boost::numpy::binary_ufunc< TBinaryFunctor, TArgument1, TArgument2, TResult >::call | ( | TBinaryFunctor & | self, |
python::object const & | input1, | ||
python::object const & | input2, | ||
python::object const & | output | ||
) | [inline, static] |
static python::object boost::numpy::binary_ufunc< TBinaryFunctor, TArgument1, TArgument2, TResult >::make | ( | ) | [inline, static] |