template<typename _MatrixType, int _UpLo = Eigen::Lower>
A * x = b, where A is a sparse matrix and b is a dense vector or matrix, using the LDLT cholesky factorization
A = L * D * L^T, where L is a unit triangular matrix and D is a diagonal matrix.
When repeatedly solving systems where A changes but its sparsity pattern remains identical, this class can analyze the sparsity pattern once and use it to more efficiently factorize and solve on subsequent calls.
using PermutationMatrixType = Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, StorageIndex>#
inline SparseCholeskySolver(const Ordering &ordering = Eigen::MetisOrdering<StorageIndex>())#
ordering – Functor to compute the variable ordering to use. Can be any functor with signature void(const MatrixType&, PermutationMatrixType&) which takes in the sparsity pattern of the matrix A and fills out the permutation of variables to use in the second argument. The first argument is the full matrix A, not just the upper or lower triangle; the values may not be the same as in A, but will be nonzero for entries in A that are nonzero. Typically this will be an instance of one of the orderings provided by Eigen, such as Eigen::NaturalOrdering().
inline explicit SparseCholeskySolver(const MatrixType &A, const Ordering &ordering = Eigen::MetisOrdering<StorageIndex>())#
Construct with a representative sparse matrix
A – The matrix to be factorized
inline bool IsInitialized() const#
Whether we have computed a symbolic sparsity and are ready to factorize/solve.
void ComputePermutationMatrix(const MatrixType &A)#
Compute an efficient permutation matrix (ordering) for A and store internally.
void ComputeSymbolicSparsity(const MatrixType &A)#
Compute symbolic sparsity pattern for A and store internally.
bool Factorize(const MatrixType &A)#
Decompose A into A = L * D * L^T and store internally. A must have the same sparsity as the matrix used for construction. Returns true if factorization was successful, and false otherwise. NOTE(brad): Currently always returns true.
RhsType Solve(const Eigen::MatrixBase<Rhs> &b) const#
Returns x for A x = b, where x and b are dense.
void SolveInPlace(Eigen::MatrixBase<Rhs> &b) const#
Solves in place for x in A x = b, where x and b are dense.
- using PermutationMatrixType = Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, StorageIndex>#