MRPT
2.0.1
|
Auxiliary class to hold the results of a Cholesky factorization of a sparse matrix.
This implementation does not allow updating/downdating.
Usage example:
Definition at line 439 of file CSparseMatrix.h.
#include <mrpt/math/CSparseMatrix.h>
Public Member Functions | |
CholeskyDecomp (const CSparseMatrix &A) | |
Constructor from a square definite-positive sparse matrix A, which can be use to solve Ax=b The actual Cholesky decomposition takes places in this constructor. More... | |
CholeskyDecomp (const CholeskyDecomp &A)=delete | |
CholeskyDecomp & | operator= (const CholeskyDecomp &)=delete |
virtual | ~CholeskyDecomp () |
Destructor. More... | |
CMatrixDouble | get_L () const |
Return the L matrix (L*L' = M), as a dense matrix. More... | |
void | get_L (CMatrixDouble &out_L) const |
Return the L matrix (L*L' = M), as a dense matrix. More... | |
template<class VECTOR > | |
VECTOR | backsub (const VECTOR &b) const |
Return the vector from a back-substitution step that solves: Ux=b. More... | |
void | backsub (const CVectorDouble &b, CVectorDouble &result_x) const |
Return the vector from a back-substitution step that solves: Ux=b. More... | |
void | backsub (const double *b, double *result, const size_t N) const |
overload for double pointers which assume the user has reserved the output memory for result More... | |
void | update (const CSparseMatrix &new_SM) |
Update the Cholesky factorization from an updated vesion of the original input, square definite-positive sparse matrix. More... | |
Private Attributes | |
css * | m_symbolic_structure |
csn * | m_numeric_structure |
const CSparseMatrix * | m_originalSM |
A const reference to the original matrix used to build this decomposition. More... | |
CSparseMatrix::CholeskyDecomp::CholeskyDecomp | ( | const CSparseMatrix & | SM | ) |
Constructor from a square definite-positive sparse matrix A, which can be use to solve Ax=b The actual Cholesky decomposition takes places in this constructor.
Constructor from a square semidefinite-positive sparse matrix.
std::runtime_error | On non-square input matrix. |
mrpt::math::CExceptionNotDefPos | On non-definite-positive matrix as input. |
The actual Cholesky decomposition takes places in this constructor.
std::runtime_error | On non-square input matrix. |
mrpt::math::CExceptionNotDefPos | On non-semidefinite-positive matrix as input. |
Definition at line 358 of file CSparseMatrix.cpp.
References ASSERT_, mrpt::math::CSparseMatrix::cols(), mrpt::math::CSparseMatrix::isColumnCompressed(), m_numeric_structure, m_originalSM, m_symbolic_structure, mrpt::math::CSparseMatrix::rows(), and mrpt::math::CSparseMatrix::sparse_matrix.
|
delete |
|
virtual |
Destructor.
Definition at line 380 of file CSparseMatrix.cpp.
|
inline |
Return the vector from a back-substitution step that solves: Ux=b.
Definition at line 479 of file CSparseMatrix.h.
void CSparseMatrix::CholeskyDecomp::backsub | ( | const CVectorDouble & | b, |
CVectorDouble & | result_x | ||
) | const |
Return the vector from a back-substitution step that solves: Ux=b.
Vectors can be Eigen::VectorXd or mrpt::math::CVectorDouble
Definition at line 393 of file CSparseMatrix.cpp.
References ASSERT_, mrpt::math::CVectorDynamic< T >::resize(), and mrpt::math::CVectorDynamic< T >::size().
void CSparseMatrix::CholeskyDecomp::backsub | ( | const double * | b, |
double * | result, | ||
const size_t | N | ||
) | const |
overload for double pointers which assume the user has reserved the output memory for result
Return the vector from a back-substitution step that solves: Ux=b.
Definition at line 402 of file CSparseMatrix.cpp.
References ASSERT_.
|
inline |
Return the L matrix (L*L' = M), as a dense matrix.
Definition at line 467 of file CSparseMatrix.h.
Referenced by TEST().
void CSparseMatrix::CholeskyDecomp::get_L | ( | CMatrixDouble & | L | ) | const |
Return the L matrix (L*L' = M), as a dense matrix.
Definition at line 387 of file CSparseMatrix.cpp.
References mrpt::math::CSparseMatrix::cs2dense().
|
delete |
void CSparseMatrix::CholeskyDecomp::update | ( | const CSparseMatrix & | new_SM | ) |
Update the Cholesky factorization from an updated vesion of the original input, square definite-positive sparse matrix.
NOTE: This new matrix MUST HAVE exactly the same sparse structure than the original one.
Definition at line 426 of file CSparseMatrix.cpp.
References ASSERTMSG_, and mrpt::math::CSparseMatrix::sparse_matrix.
|
private |
Definition at line 443 of file CSparseMatrix.h.
Referenced by CholeskyDecomp().
|
private |
A const reference to the original matrix used to build this decomposition.
Definition at line 446 of file CSparseMatrix.h.
Referenced by CholeskyDecomp().
|
private |
Definition at line 442 of file CSparseMatrix.h.
Referenced by CholeskyDecomp().
Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020 |