Static Public Member Functions
boost::numpy::binary_ufunc< TBinaryFunctor, TArgument1, TArgument2, TResult > Struct Template Reference

Helps wrap a C++ functor taking a pair of scalar arguments as a broadcasting ufunc-like Python object. More...

#include <ufunc.hpp>

List of all members.

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 ()

Detailed Description

template<typename TBinaryFunctor, typename TArgument1 = typename TBinaryFunctor::first_argument_type, typename TArgument2 = typename TBinaryFunctor::second_argument_type, typename TResult = typename TBinaryFunctor::result_type>
struct boost::numpy::binary_ufunc< TBinaryFunctor, TArgument1, TArgument2, TResult >

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());
  }

Definition at line 163 of file ufunc.hpp.


Member Function Documentation

template<typename TBinaryFunctor , typename TArgument1 = typename TBinaryFunctor::first_argument_type, typename TArgument2 = typename TBinaryFunctor::second_argument_type, typename TResult = typename TBinaryFunctor::result_type>
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]

Definition at line 167 of file ufunc.hpp.

template<typename TBinaryFunctor , typename TArgument1 = typename TBinaryFunctor::first_argument_type, typename TArgument2 = typename TBinaryFunctor::second_argument_type, typename TResult = typename TBinaryFunctor::result_type>
static python::object boost::numpy::binary_ufunc< TBinaryFunctor, TArgument1, TArgument2, TResult >::make ( ) [inline, static]

Definition at line 191 of file ufunc.hpp.


The documentation for this struct was generated from the following file:


boost_numpy
Author(s): Jim Bosch, Ankit Daftery
autogenerated on Fri Aug 28 2015 10:10:40