@@ -12,9 +12,7 @@ namespace eigenpy {
1212
1313template <typename _MatrixType>
1414struct IncompleteLUTVisitor
15- : public boost::python::def_visitor<
16- IncompleteLUTVisitor<_MatrixType>> {
17-
15+ : public boost::python::def_visitor<IncompleteLUTVisitor<_MatrixType>> {
1816 typedef _MatrixType MatrixType;
1917 typedef typename MatrixType::Scalar Scalar;
2018 typedef typename MatrixType::RealScalar RealScalar;
@@ -26,68 +24,67 @@ struct IncompleteLUTVisitor
2624 DenseMatrixXs;
2725
2826 template <class PyClass >
29- void visit (PyClass & cl) const {
27+ void visit (PyClass& cl) const {
3028 cl.def (bp::init<>(bp::arg (" self" ), " Default constructor" ))
3129 .def (bp::init<MatrixType>(bp::args (" self" , " matrix" ),
3230 " Constructs and performs the LDLT "
3331 " factorization from a given matrix." ))
3432 .def (bp::init<const MatrixType&, RealScalar, int >(
35- (bp::arg (" matrix" ),
36- bp::arg (" droptol" ) = Eigen::NumTraits<Scalar>::dummy_precision (),
37- bp::arg (" fillfactor" ) = 10 ),
38- " Constructs an incomplete LU factorization from a given matrix." ))
33+ (bp::arg (" matrix" ),
34+ bp::arg (" droptol" ) = Eigen::NumTraits<Scalar>::dummy_precision (),
35+ bp::arg (" fillfactor" ) = 10 ),
36+ " Constructs an incomplete LU factorization from a given matrix." ))
3937
40- .def (" rows" , &Solver::rows, bp::arg (" self" ),
38+ .def (" rows" , &Solver::rows, bp::arg (" self" ),
4139 " Returns the number of rows of the matrix." )
42- .def (" cols" , &Solver::cols, bp::arg (" self" ),
40+ .def (" cols" , &Solver::cols, bp::arg (" self" ),
4341 " Returns the number of cols of the matrix." )
4442
4543 .def (" info" , &Solver::info, bp::arg (" self" ),
46- " Reports whether previous computation was successful." )
44+ " Reports whether previous computation was successful." )
4745
4846 .def (
49- " analyzePattern" ,
50- +[](Solver& self, const MatrixType& amat) {
51- self.analyzePattern (amat);
52- },
53- bp::arg (" matrix" ))
47+ " analyzePattern" ,
48+ +[](Solver& self, const MatrixType& amat) {
49+ self.analyzePattern (amat);
50+ },
51+ bp::arg (" matrix" ))
5452 .def (
55- " factorize" ,
56- +[](Solver& self, const MatrixType& amat) { self.factorize (amat); },
57- bp::arg (" matrix" ))
53+ " factorize" ,
54+ +[](Solver& self, const MatrixType& amat) { self.factorize (amat); },
55+ bp::arg (" matrix" ))
5856 .def (
59- " compute" ,
60- +[](Solver& self, const MatrixType& amat) { self.compute (amat); },
61- bp::arg (" matrix" ))
57+ " compute" ,
58+ +[](Solver& self, const MatrixType& amat) { self.compute (amat); },
59+ bp::arg (" matrix" ))
6260
6361 .def (" setDroptol" , &Solver::setDroptol, bp::arg (" self" ))
6462 .def (" setFillfactor" , &Solver::setFillfactor, bp::arg (" self" ))
6563
6664 .def (
67- " solve" ,
68- +[](Solver const & self, const Eigen::Ref<DenseVectorXs const >& b)
69- -> DenseVectorXs { return self.solve (b); },
70- bp::arg (" b" ),
71- " Returns the solution x of A x = b using the current decomposition "
72- " of A, where b is a right hand side vector." )
65+ " solve" ,
66+ +[](Solver const & self, const Eigen::Ref<DenseVectorXs const >& b)
67+ -> DenseVectorXs { return self.solve (b); },
68+ bp::arg (" b" ),
69+ " Returns the solution x of A x = b using the current decomposition "
70+ " of A, where b is a right hand side vector." )
7371 .def (
74- " solve" ,
75- +[](Solver const & self, const Eigen::Ref<DenseMatrixXs const >& B)
76- -> DenseMatrixXs { return self.solve (B); },
77- bp::arg (" b" ),
78- " Returns the solution X of A X = B using the current decomposition "
79- " of A where B is a right hand side matrix." )
72+ " solve" ,
73+ +[](Solver const & self, const Eigen::Ref<DenseMatrixXs const >& B)
74+ -> DenseMatrixXs { return self.solve (B); },
75+ bp::arg (" b" ),
76+ " Returns the solution X of A X = B using the current decomposition "
77+ " of A where B is a right hand side matrix." )
8078 .def (
81- " solve" ,
82- +[](Solver const & self, const MatrixType& B) -> MatrixType {
83- DenseMatrixXs B_dense = DenseMatrixXs (B);
84- DenseMatrixXs X_dense = self.solve (B_dense);
85- return MatrixType (X_dense.sparseView ());
86- },
87- bp::arg (" b" ),
88- " Returns the solution X of A X = B using the current decomposition "
89- " of A where B is a right hand side matrix." )
90- ;
79+ " solve" ,
80+ +[](Solver const & self, const MatrixType& B) -> MatrixType {
81+ DenseMatrixXs B_dense = DenseMatrixXs (B);
82+ DenseMatrixXs X_dense = self.solve (B_dense);
83+ return MatrixType (X_dense.sparseView ());
84+ },
85+ bp::arg (" b" ),
86+ " Returns the solution X of A X = B using the current decomposition "
87+ " of A where B is a right hand side matrix." );
9188 }
9289
9390 static void expose () {
@@ -96,7 +93,7 @@ struct IncompleteLUTVisitor
9693 expose (classname);
9794 }
9895
99- static void expose (const std::string & name) {
96+ static void expose (const std::string& name) {
10097 bp::class_<Solver, boost::noncopyable>(
10198 name.c_str (),
10299 " Incomplete LU factorization with dual-threshold strategy." ,
0 commit comments