Skip to content

Commit

Permalink
bugfix in truediv and add rtruediv
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Walter committed May 28, 2014
1 parent 6ec0ba4 commit 0792537
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pycppad/pycppad.cpp
Expand Up @@ -490,9 +490,9 @@ contains an example and test of these functions.

# define PY_ARRAY_UNIQUE_SYMBOL PyArray_Pycppad

CppAD::AD<double> *truediv(const CppAD::AD<double> &rhs, CppAD::AD<double> lhs){ return new CppAD::AD<double>(operator/(lhs,rhs));}


CppAD::AD<double> *truediv1(const CppAD::AD<double> &lhs, const CppAD::AD<double> &rhs){ return new CppAD::AD<double>(operator/(lhs,rhs));}
CppAD::AD<double> *truediv2(const CppAD::AD<double> &lhs, const double &rhs){ return new CppAD::AD<double>(operator/(lhs,rhs));}
CppAD::AD<double> *truediv3(const CppAD::AD<double> &rhs, const double &lhs){ return new CppAD::AD<double>(operator/(lhs,rhs));}


# define PYCPPAD_BINARY(op) \
Expand Down Expand Up @@ -711,7 +711,9 @@ BOOST_PYTHON_MODULE(cppad_)
.def( pow(self, self) )
.def( pow(self, double()) )
.def( pow(double(), self) )
.def("__truediv__", truediv, return_value_policy<manage_new_object>())
.def("__truediv__", truediv1, return_value_policy<manage_new_object>())
.def("__truediv__", truediv2, return_value_policy<manage_new_object>())
.def("__rtruediv__", truediv3, return_value_policy<manage_new_object>())

;

Expand Down

0 comments on commit 0792537

Please sign in to comment.