sparse/LLT.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2024 INRIA
3  */
4 
5 #ifndef __eigenpy_decompositions_sparse_llt_hpp__
6 #define __eigenpy_decompositions_sparse_llt_hpp__
7 
8 #include "eigenpy/eigenpy.hpp"
11 
12 namespace eigenpy {
13 
14 template <typename _MatrixType, int _UpLo = Eigen::Lower,
15  typename _Ordering =
16  Eigen::AMDOrdering<typename _MatrixType::StorageIndex> >
18  : public boost::python::def_visitor<
19  SimplicialLLTVisitor<_MatrixType, _UpLo, _Ordering> > {
21  typedef _MatrixType MatrixType;
22 
23  typedef Eigen::SimplicialLLT<MatrixType> Solver;
24  typedef typename MatrixType::Scalar Scalar;
25  typedef typename MatrixType::RealScalar RealScalar;
26  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1, MatrixType::Options>
28  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic,
29  MatrixType::Options>
31 
32  template <class PyClass>
33  void visit(PyClass &cl) const {
34  cl.def(bp::init<>(bp::arg("self"), "Default constructor"))
35  .def(bp::init<MatrixType>(bp::args("self", "matrix"),
36  "Constructs and performs the LLT "
37  "factorization from a given matrix."))
38 
40  }
41 
42  static void expose() {
43  static const std::string classname =
44  "SimplicialLLT_" + scalar_name<Scalar>::shortname();
45  expose(classname);
46  }
47 
48  static void expose(const std::string &name) {
49  bp::class_<Solver, boost::noncopyable>(
50  name.c_str(),
51  "A direct sparse LLT Cholesky factorizations.\n\n"
52  "This class provides a LL^T Cholesky factorizations of sparse matrices "
53  "that are selfadjoint and positive definite."
54  "The factorization allows for solving A.X = B where X and B can be "
55  "either dense or sparse.\n\n"
56  "In order to reduce the fill-in, a symmetric permutation P is applied "
57  "prior to the factorization such that the factorized matrix is P A "
58  "P^-1.",
59  bp::no_init)
60  .def(SimplicialLLTVisitor())
61  .def(IdVisitor<Solver>());
62  }
63 };
64 
65 } // namespace eigenpy
66 
67 #endif // ifndef __eigenpy_decompositions_sparse_llt_hpp__
eigenpy::SimplicialLLTVisitor::RealScalar
MatrixType::RealScalar RealScalar
Definition: sparse/LLT.hpp:25
eigenpy::SimplicialLLTVisitor::MatrixType
_MatrixType MatrixType
Definition: sparse/LLT.hpp:21
eigenpy::SimplicialLLTVisitor::visit
void visit(PyClass &cl) const
Definition: sparse/LLT.hpp:33
scalar-name.hpp
eigenpy::SimplicialLLTVisitor::Solver
Eigen::SimplicialLLT< MatrixType > Solver
Definition: sparse/LLT.hpp:23
eigenpy
Definition: alignment.hpp:14
eigenpy::SimplicialLLTVisitor::DenseVectorXs
Eigen::Matrix< Scalar, Eigen::Dynamic, 1, MatrixType::Options > DenseVectorXs
Definition: sparse/LLT.hpp:27
eigenpy::scalar_name::shortname
static std::string shortname()
eigenpy::SimplicialLLTVisitor
Definition: sparse/LLT.hpp:17
SimplicialCholesky.hpp
eigenpy::IdVisitor
Add the Python method id to retrieving a unique id for a given object exposed with Boost....
Definition: id.hpp:18
setup.name
name
Definition: setup.in.py:179
eigenpy.hpp
eigenpy::SimplicialLLTVisitor::expose
static void expose()
Definition: sparse/LLT.hpp:42
eigenpy::SimplicialLLTVisitor::DenseMatrixXs
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, MatrixType::Options > DenseMatrixXs
Definition: sparse/LLT.hpp:30
eigenpy::SimplicialLLTVisitor::expose
static void expose(const std::string &name)
Definition: sparse/LLT.hpp:48
eigenpy::SimplicialCholeskyVisitor
Definition: SimplicialCholesky.hpp:17
eigenpy::SimplicialLLTVisitor::Scalar
MatrixType::Scalar Scalar
Definition: sparse/LLT.hpp:24
eigenpy::SimplicialLLTVisitor::Visitor
SimplicialLLTVisitor< _MatrixType, _UpLo, _Ordering > Visitor
Definition: sparse/LLT.hpp:20


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