SparseSolverBase.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2017, Justin Carpentier, LAAS-CNRS
3  *
4  * This file is part of eigenpy.
5  * eigenpy is free software: you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public License
7  * as published by the Free Software Foundation, either version 3 of
8  * the License, or (at your option) any later version.
9  * eigenpy is distributed in the hope that it will be
10  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details. You should
13  * have received a copy of the GNU Lesser General Public License along
14  * with eigenpy. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef __eigenpy_sparse_solver_base_hpp__
18 #define __eigenpy_sparse_solver_base_hpp__
19 
20 #include "eigenpy/fwd.hpp"
21 
22 namespace eigenpy {
23 
24 template <typename SparseSolver>
26  : public bp::def_visitor<SparseSolverVisitor<SparseSolver> > {
27  typedef Eigen::VectorXd VectorType;
28 
29  template <class PyClass>
30  void visit(PyClass& cl) const {
31  cl.def("solve", &solve, bp::arg("b"),
32  "Returns the solution x of Ax = b using the current decomposition "
33  "of A.");
34  }
35 
36  private:
37  static VectorType solve(SparseSolver& self, const VectorType& b) {
38  return self.solve(b);
39  }
40 };
41 
42 } // namespace eigenpy
43 
44 #endif // ifndef __eigenpy_sparse_solver_base_hpp__
void visit(PyClass &cl) const
static VectorType solve(SparseSolver &self, const VectorType &b)


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Jun 2 2023 02:10:26