Skip to content

Commit ce9e361

Browse files
committed
[Test] Add test of Eigen::MatrixBase
1 parent 97d8d5c commit ce9e361

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

unittest/matrix.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,15 @@ Eigen::MatrixXd reflex(const MatType & M, bool verbose)
7272
return Eigen::MatrixXd(M);
7373
}
7474

75+
template<typename MatrixDerived>
76+
MatrixDerived base(const Eigen::MatrixBase<MatrixDerived> & m)
77+
{
78+
return m.derived();
79+
}
80+
7581
BOOST_PYTHON_MODULE(matrix)
7682
{
83+
using namespace Eigen;
7784
namespace bp = boost::python;
7885
eigenpy::enableEigenPy();
7986

@@ -92,4 +99,7 @@ BOOST_PYTHON_MODULE(matrix)
9299

93100
bp::def("emptyVector", emptyVector);
94101
bp::def("emptyMatrix", emptyMatrix);
102+
103+
bp::def("base", base<VectorXd>);
104+
bp::def("base", base<MatrixXd>);
95105
}

0 commit comments

Comments
 (0)