Commit 5a6f4804 by Justin Carpentier

### test: test registration of a new type

parent cec1bd83
 ... @@ -81,12 +81,22 @@ MatrixDerived base(const Eigen::MatrixBase & m) ... @@ -81,12 +81,22 @@ MatrixDerived base(const Eigen::MatrixBase & m) return m.derived(); return m.derived(); } } template Eigen::Matrix matrix6(const Scalar & value) { typedef Eigen::Matrix ReturnType; return ReturnType::Constant(value); } BOOST_PYTHON_MODULE(matrix) BOOST_PYTHON_MODULE(matrix) { { using namespace Eigen; using namespace Eigen; namespace bp = boost::python; namespace bp = boost::python; eigenpy::enableEigenPy(); eigenpy::enableEigenPy(); typedef Eigen::Matrix Matrix6; eigenpy::enableEigenPySpecific(); Eigen::MatrixXd (*naturalsXX)(int,int,bool) = naturals; Eigen::MatrixXd (*naturalsXX)(int,int,bool) = naturals; Eigen::VectorXd (*naturalsX)(int,bool) = naturals; Eigen::VectorXd (*naturalsX)(int,bool) = naturals; Eigen::Matrix3d (*naturals33)(bool) = naturals; Eigen::Matrix3d (*naturals33)(bool) = naturals; ... @@ -108,4 +118,6 @@ BOOST_PYTHON_MODULE(matrix) ... @@ -108,4 +118,6 @@ BOOST_PYTHON_MODULE(matrix) bp::def("base", base); bp::def("base", base); bp::def("base", base); bp::def("base", base); bp::def("matrix6", matrix6); } }
 ... @@ -126,3 +126,7 @@ assert(mat1x1[0,0] == value) ... @@ -126,3 +126,7 @@ assert(mat1x1[0,0] == value) vec1x1 = eigenpy.vector1x1(value) vec1x1 = eigenpy.vector1x1(value) assert(vec1x1.size == 1) assert(vec1x1.size == 1) assert(vec1x1[0] == value) assert(vec1x1[0] == value) # test registration of matrix6 mat6 = eigenpy.matrix6(0.) assert(mat6.size == 36)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment