File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,22 @@ MatrixDerived base(const Eigen::MatrixBase<MatrixDerived> & m)
8181 return m.derived ();
8282}
8383
84+ template <typename Scalar>
85+ Eigen::Matrix<Scalar,6 ,6 > matrix6 (const Scalar & value)
86+ {
87+ typedef Eigen::Matrix<Scalar,6 ,6 > ReturnType;
88+ return ReturnType::Constant (value);
89+ }
90+
8491BOOST_PYTHON_MODULE (matrix)
8592{
8693 using namespace Eigen ;
8794 namespace bp = boost::python;
8895 eigenpy::enableEigenPy ();
8996
97+ typedef Eigen::Matrix<double ,6 ,6 > Matrix6;
98+ eigenpy::enableEigenPySpecific<Matrix6>();
99+
90100 Eigen::MatrixXd (*naturalsXX)(int ,int ,bool ) = naturals;
91101 Eigen::VectorXd (*naturalsX)(int ,bool ) = naturals;
92102 Eigen::Matrix3d (*naturals33)(bool ) = naturals;
@@ -108,4 +118,6 @@ BOOST_PYTHON_MODULE(matrix)
108118
109119 bp::def (" base" , base<VectorXd>);
110120 bp::def (" base" , base<MatrixXd>);
121+
122+ bp::def (" matrix6" , matrix6<double >);
111123}
Original file line number Diff line number Diff line change 126126vec1x1 = eigenpy .vector1x1 (value )
127127assert (vec1x1 .size == 1 )
128128assert (vec1x1 [0 ] == value )
129+
130+ # test registration of matrix6
131+ mat6 = eigenpy .matrix6 (0. )
132+ assert (mat6 .size == 36 )
You can’t perform that action at this time.
0 commit comments