@@ -18,7 +18,9 @@ namespace eigenpy {
1818template <typename JacobiSVD>
1919struct JacobiSVDVisitor
2020 : public boost::python::def_visitor<JacobiSVDVisitor<JacobiSVD>> {
21+ typedef JacobiSVD Solver;
2122 typedef typename JacobiSVD::MatrixType MatrixType;
23+ typedef Eigen::MatrixBase<MatrixType> MatrixBaseType;
2224 typedef typename MatrixType::Scalar Scalar;
2325
2426 template <class PyClass >
@@ -34,23 +36,27 @@ struct JacobiSVDVisitor
3436
3537 .def (" cols" , &JacobiSVD::cols, bp::arg (" self" ),
3638 " Returns the number of columns. " )
37- .def (" compute" ,
38- (JacobiSVD & (JacobiSVD::*)(const MatrixType &matrix)) &
39- JacobiSVD::compute,
40- bp::args (" self" , " matrix" ),
41- " Method performing the decomposition of given matrix. Computes "
42- " Thin/Full "
43- " unitaries U/V if specified using the Options template parameter "
44- " or the class constructor. " ,
45- bp::return_self<>())
46- .def (" compute" ,
47- (JacobiSVD & (JacobiSVD::*)(const MatrixType &matrix,
48- unsigned int computationOptions)) &
49- JacobiSVD::compute,
50- bp::args (" self" , " matrix" , " computationOptions" ),
51- " Method performing the decomposition of given matrix, as "
52- " specified by the computationOptions parameter. " ,
53- bp::return_self<>())
39+ .def (
40+ " compute" ,
41+ +[](Solver &self, const MatrixType &matrix) -> Solver & {
42+ return self.compute (matrix);
43+ },
44+ bp::args (" self" , " matrix" ),
45+ " Method performing the decomposition of given matrix. Computes "
46+ " Thin/Full "
47+ " unitaries U/V if specified using the Options template parameter "
48+ " or the class constructor. " ,
49+ bp::return_self<>())
50+ .def (
51+ " compute" ,
52+ +[](Solver &self, const MatrixType &matrix,
53+ unsigned int computationOptions) -> Solver & {
54+ return self.compute (matrix, computationOptions);
55+ },
56+ bp::args (" self" , " matrix" , " computation_options" ),
57+ " Method performing the decomposition of given matrix, as "
58+ " specified by the computationOptions parameter. " ,
59+ bp::return_self<>())
5460 .def (" rows" , &JacobiSVD::rows, bp::arg (" self" ),
5561 " Returns the number of rows." )
5662
0 commit comments