File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -85,11 +85,15 @@ def checkZero(l):
8585# pprint.pprint(list(l4))
8686# checkZero(l4)
8787
88- # TODO fail
89- l5_copy = std_vector . StdVec_Mat2d ( l5 )
88+ # Test StdVec_Mat2d that had been registered
89+ # before calling exposeStdVectorEigenSpecificType
9090
91- # test l5 == l5_copy == l5_py
91+ # Test conversion and tolistl5 == l5_copy == l5_py
92+ l5_copy = std_vector .StdVec_Mat2d (l5 )
9293l5_py = l5_copy .tolist ()
93- # Test l5[0] is zero
94- l5 [0 ].setZero ()
95- # TODO test
94+ checkAllValues (l5 , l5_copy )
95+ checkAllValues (l5 , l5_py )
96+
97+ # Test mutable __getitem__
98+ l5 [0 ][:] = 0.0
99+ assert np .allclose (l5 [0 ], 0.0 )
Original file line number Diff line number Diff line change @@ -52,9 +52,10 @@ BOOST_PYTHON_MODULE(std_vector) {
5252
5353 // Test matrix modification
5454 // Mat2d don't have tolist, reserve, mutable __getitem__ and from list
55- // conversion exposeStdVectorEigenSpecificType must add those methods to Mat2d
55+ // conversion
56+ // exposeStdVectorEigenSpecificType must add those methods to StdVec_Mat2d
5657 bp::class_<std::vector<Eigen::Matrix2d> >(" StdVec_Mat2d" )
5758 .def (boost::python::vector_indexing_suite<
5859 std::vector<Eigen::Matrix2d> >());
59- exposeStdVectorEigenSpecificType<Eigen::Matrix3d >(" Mat2d" );
60+ exposeStdVectorEigenSpecificType<Eigen::Matrix2d >(" Mat2d" );
6061}
You can’t perform that action at this time.
0 commit comments