|
17 | 17 |
|
18 | 18 | #include <boost/python/scope.hpp> |
19 | 19 |
|
20 | | -#define DEFINE_IS_APPROX(MatType) \ |
21 | | - BOOST_PYTHON_FUNCTION_OVERLOADS(is_approx_overload##MatType,eigenpy::is_approx,2,3) |
22 | | - |
23 | | -#define EXPOSE_IS_APPROX(MatType) \ |
24 | | - bp::def("is_approx", \ |
25 | | - (bool (*)(const Eigen::MatrixBase<MatType> &, \ |
26 | | - const Eigen::MatrixBase<MatType> &, \ |
27 | | - const MatType::Scalar &))eigenpy::is_approx<MatType,MatType>, \ |
28 | | - is_approx_overload##MatType(bp::args("A","B","prec"), \ |
29 | | - "Returns True if A is approximately equal to B, within the precision determined by prec.")) |
30 | | - |
31 | | - |
32 | 20 | using namespace eigenpy; |
33 | 21 |
|
34 | | -DEFINE_IS_APPROX(MatrixXd) |
35 | | -DEFINE_IS_APPROX(MatrixXf) |
36 | | - |
37 | | - |
38 | 22 | BOOST_PYTHON_MODULE(eigenpy) |
39 | 23 | { |
40 | 24 | namespace bp = boost::python; |
@@ -62,8 +46,15 @@ BOOST_PYTHON_MODULE(eigenpy) |
62 | 46 |
|
63 | 47 | { |
64 | 48 | using namespace Eigen; |
65 | | - EXPOSE_IS_APPROX(MatrixXd); |
66 | | - EXPOSE_IS_APPROX(MatrixXf); |
| 49 | + bp::def("is_approx",(bool (*)(const MatrixXd &, const MatrixXd &, const double &))&is_approx<MatrixXd,MatrixXd>, |
| 50 | + bp::args("A","B","prec"), |
| 51 | + "Returns True if A is approximately equal to B, within the precision determined by prec."); |
| 52 | + bp::def("is_approx",(bool (*)(const MatrixXd &, const MatrixXd &))&is_approx<MatrixXd,MatrixXd>, |
| 53 | + bp::args("A","B"), |
| 54 | + "Returns True if A is approximately equal to B.."); |
| 55 | + |
| 56 | +// EXPOSE_IS_APPROX(MatrixXd); |
| 57 | +// EXPOSE_IS_APPROX(MatrixXf); |
67 | 58 | } |
68 | 59 |
|
69 | 60 | exposeDecompositions(); |
|
0 commit comments