decompositions/sparse/SparseSolverBase.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2024 INRIA
3  */
4 
5 #ifndef __eigenpy_decompositions_sparse_sparse_solver_base_hpp__
6 #define __eigenpy_decompositions_sparse_sparse_solver_base_hpp__
7 
8 #include "eigenpy/eigenpy.hpp"
10 
11 #include <Eigen/SparseCholesky>
12 
13 namespace eigenpy {
14 
15 template <typename SimplicialDerived>
17  : public boost::python::def_visitor<
18  SparseSolverBaseVisitor<SimplicialDerived> > {
19  typedef SimplicialDerived Solver;
20 
21  typedef typename SimplicialDerived::MatrixType MatrixType;
22  typedef typename MatrixType::Scalar Scalar;
23  typedef typename MatrixType::RealScalar RealScalar;
24 
25  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1, MatrixType::Options>
27  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic,
28  MatrixType::Options>
30 
31  template <class PyClass>
32  void visit(PyClass &cl) const {
33  cl.def("solve", &solve<DenseVectorXs>, bp::args("self", "b"),
34  "Returns the solution x of A x = b using the current "
35  "decomposition of A.")
36  .def("solve", &solve<DenseMatrixXs>, bp::args("self", "B"),
37  "Returns the solution X of A X = B using the current "
38  "decomposition of A where B is a right hand side matrix.")
39 
40  .def("solve", &solve<MatrixType>, bp::args("self", "B"),
41  "Returns the solution X of A X = B using the current "
42  "decomposition of A where B is a right hand side matrix.");
43  }
44 
45  private:
46  template <typename MatrixOrVector>
47  static MatrixOrVector solve(const Solver &self, const MatrixOrVector &vec) {
48  return self.solve(vec);
49  }
50 };
51 
52 } // namespace eigenpy
53 
54 #endif // ifndef __eigenpy_decompositions_sparse_sparse_solver_base_hpp__
eigenpy::SparseSolverBaseVisitor
Definition: decompositions/sparse/SparseSolverBase.hpp:16
test_matrix.vec
vec
Definition: test_matrix.py:180
eigenpy::SparseSolverBaseVisitor::DenseMatrixXs
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, MatrixType::Options > DenseMatrixXs
Definition: decompositions/sparse/SparseSolverBase.hpp:29
eigenpy::SparseSolverBaseVisitor::visit
void visit(PyClass &cl) const
Definition: decompositions/sparse/SparseSolverBase.hpp:32
eigenpy::SparseSolverBaseVisitor::MatrixType
SimplicialDerived::MatrixType MatrixType
Definition: decompositions/sparse/SparseSolverBase.hpp:21
eigenpy
Definition: alignment.hpp:14
eigenpy::SparseSolverBaseVisitor::RealScalar
MatrixType::RealScalar RealScalar
Definition: decompositions/sparse/SparseSolverBase.hpp:23
eigenpy::SparseSolverBaseVisitor::Scalar
MatrixType::Scalar Scalar
Definition: decompositions/sparse/SparseSolverBase.hpp:22
eigenpy::SparseSolverBaseVisitor::Solver
SimplicialDerived Solver
Definition: decompositions/sparse/SparseSolverBase.hpp:19
eigenpy.hpp
eigenpy::SparseSolverBaseVisitor::solve
static MatrixOrVector solve(const Solver &self, const MatrixOrVector &vec)
Definition: decompositions/sparse/SparseSolverBase.hpp:47
eigenpy::SparseSolverBaseVisitor::DenseVectorXs
Eigen::Matrix< Scalar, Eigen::Dynamic, 1, MatrixType::Options > DenseVectorXs
Definition: decompositions/sparse/SparseSolverBase.hpp:26
EigenBase.hpp


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Nov 2 2024 02:14:45