Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Private Attributes

mrpt::math::CSparseMatrix::CholeskyDecomp Class Reference


Detailed Description

Auxiliary class to hold the results of a Cholesky factorization of a sparse matrix.

Usage example:

     CSparseMatrix  SM(100,100);
     SM.insert_entry(i,j, val); ...
     SM.compressFromTriplet();

     // Do Cholesky decomposition:
                CSparseMatrix::CholeskyDecomp  CD(SM);
     CD.get_inverse();
     ...
Note:
This class was initially adapted from "robotvision", by Hauke Strasdat, Steven Lovegrove and Andrew J. Davison. See http://www.openslam.org/robotvision.html
This class designed to be "uncopiable".
See also:
The main class: CSparseMatrix

Definition at line 337 of file CSparseMatrix.h.

#include <mrpt/math/CSparseMatrix.h>

Inheritance diagram for mrpt::math::CSparseMatrix::CholeskyDecomp:
Inheritance graph
[legend]

List of all members.

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.
virtual ~CholeskyDecomp ()
 Destructor.
CMatrixDouble get_L () const
 Return the L matrix (L*L' = M), as a dense matrix.
void get_L (CMatrixDouble &out_L) const
 Return the L matrix (L*L' = M), as a dense matrix.
mrpt::vector_double backsub (const mrpt::vector_double &b) const
 Return the vector from a back-substitution step that solves: Ux=b.
void backsub (const mrpt::vector_double &b, mrpt::vector_double &result_x) const
 Return the vector from a back-substitution step that solves: Ux=b.
void update (const CSparseMatrix &new_SM)
 Update the Cholesky factorization from an updated vesion of the original input, square definite-positive sparse matrix.

Private Attributes

cssm_symbolic_structure
csnm_numeric_structure
const CSparseMatrixm_originalSM
 A const reference to the original matrix used to build this decomposition.

Constructor & Destructor Documentation

mrpt::math::CSparseMatrix::CholeskyDecomp::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.

Exceptions:
std::runtime_errorOn non-square input matrix.
mrpt::math::CExceptionNotDefPosOn non-definite-positive matrix as input.
virtual mrpt::math::CSparseMatrix::CholeskyDecomp::~CholeskyDecomp ( ) [virtual]

Destructor.


Member Function Documentation

mrpt::vector_double mrpt::math::CSparseMatrix::CholeskyDecomp::backsub ( const mrpt::vector_double b) const [inline]

Return the vector from a back-substitution step that solves: Ux=b.

Definition at line 362 of file CSparseMatrix.h.

References backsub().

Referenced by backsub().

void mrpt::math::CSparseMatrix::CholeskyDecomp::backsub ( const mrpt::vector_double b,
mrpt::vector_double result_x 
) const

Return the vector from a back-substitution step that solves: Ux=b.

void mrpt::math::CSparseMatrix::CholeskyDecomp::get_L ( CMatrixDouble out_L) const

Return the L matrix (L*L' = M), as a dense matrix.

CMatrixDouble mrpt::math::CSparseMatrix::CholeskyDecomp::get_L ( ) const [inline]

Return the L matrix (L*L' = M), as a dense matrix.

Definition at line 356 of file CSparseMatrix.h.

References get_L().

Referenced by get_L().

void mrpt::math::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.


Member Data Documentation

Definition at line 341 of file CSparseMatrix.h.

A const reference to the original matrix used to build this decomposition.

Definition at line 342 of file CSparseMatrix.h.

Definition at line 340 of file CSparseMatrix.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011