g2o
Loading...
Searching...
No Matches
g2o::LinearSolverCholmod< MatrixType > Class Template Reference

basic solver for Ax = b which has to reimplemented for different linear algebra libraries More...

#include <linear_solver_cholmod.h>

Inheritance diagram for g2o::LinearSolverCholmod< MatrixType >:
Collaboration diagram for g2o::LinearSolverCholmod< MatrixType >:

Public Member Functions

 LinearSolverCholmod ()
 LinearSolverCholmod (LinearSolverCholmod< MatrixType > const &)=delete
LinearSolverCholmod & operator= (LinearSolverCholmod< MatrixType > const &)=delete
virtual ~LinearSolverCholmod ()
virtual bool init ()
bool solve (const SparseBlockMatrix< MatrixType > &A, double *x, double *b)
virtual bool saveMatrix (const std::string &fileName)
Public Member Functions inherited from g2o::LinearSolverCCS< MatrixType >
 LinearSolverCCS ()
 ~LinearSolverCCS ()
virtual bool solveBlocks (double **&blocks, const SparseBlockMatrix< MatrixType > &A)
virtual bool solvePattern (SparseBlockMatrix< MatrixX > &spinv, const std::vector< std::pair< int, int > > &blockIndices, const SparseBlockMatrix< MatrixType > &A)
bool blockOrdering () const
 do the AMD ordering on the blocks or on the scalar matrix
void setBlockOrdering (bool blockOrdering)
Public Member Functions inherited from g2o::LinearSolver< MatrixType >
 LinearSolver ()
virtual ~LinearSolver ()
bool writeDebug () const
 write a debug dump of the system matrix if it is not PSD in solve
void setWriteDebug (bool b)

Protected Member Functions

void computeSymbolicDecomposition (const SparseBlockMatrix< MatrixType > &A)
void fillCholmodExt (const SparseBlockMatrix< MatrixType > &A, bool onlyValues)
bool computeCholmodFactor (const SparseBlockMatrix< MatrixType > &A, double &t)
 compute the cholmodFactor for the given matrix A
bool solveBlocks_impl (const SparseBlockMatrix< MatrixType > &A, std::function< void(MarginalCovarianceCholesky &)> compute)
void freeCholdmodFactor ()
Protected Member Functions inherited from g2o::LinearSolverCCS< MatrixType >
void initMatrixStructure (const SparseBlockMatrix< MatrixType > &A)

Protected Attributes

cholmod::Cholmod _cholmod
MatrixStructure _matrixStructure
VectorXI _scalarPermutation
VectorXI _blockPermutation
Protected Attributes inherited from g2o::LinearSolverCCS< MatrixType >
SparseBlockMatrixCCS< MatrixType > * _ccsMatrix
bool _blockOrdering
Protected Attributes inherited from g2o::LinearSolver< MatrixType >
bool _writeDebug

Additional Inherited Members

Static Public Member Functions inherited from g2o::LinearSolver< MatrixType >
static void allocateBlocks (const SparseBlockMatrix< MatrixType > &A, double **&blocks)
 allocate block memory structure
static void deallocateBlocks (const SparseBlockMatrix< MatrixType > &A, double **&blocks)
 de-allocate the block structure
template<typename BlockDerived, typename ScalarDerived>
static void blockToScalarPermutation (const SparseBlockMatrix< MatrixType > &A, const Eigen::MatrixBase< BlockDerived > &p, const Eigen::MatrixBase< ScalarDerived > &scalar)

Detailed Description

template<typename MatrixType>
class g2o::LinearSolverCholmod< MatrixType >

basic solver for Ax = b which has to reimplemented for different linear algebra libraries

Definition at line 47 of file linear_solver_cholmod.h.

Constructor & Destructor Documentation

◆ LinearSolverCholmod() [1/2]

template<typename MatrixType>
g2o::LinearSolverCholmod< MatrixType >::LinearSolverCholmod ( )
inline

◆ LinearSolverCholmod() [2/2]

template<typename MatrixType>
g2o::LinearSolverCholmod< MatrixType >::LinearSolverCholmod ( LinearSolverCholmod< MatrixType > const & )
delete

References LinearSolverCholmod().

◆ ~LinearSolverCholmod()

template<typename MatrixType>
virtual g2o::LinearSolverCholmod< MatrixType >::~LinearSolverCholmod ( )
inlinevirtual

Definition at line 55 of file linear_solver_cholmod.h.

References freeCholdmodFactor().

Member Function Documentation

◆ computeCholmodFactor()

template<typename MatrixType>
bool g2o::LinearSolverCholmod< MatrixType >::computeCholmodFactor ( const SparseBlockMatrix< MatrixType > & A,
double & t )
inlineprotected

◆ computeSymbolicDecomposition()

◆ fillCholmodExt()

◆ freeCholdmodFactor()

template<typename MatrixType>
void g2o::LinearSolverCholmod< MatrixType >::freeCholdmodFactor ( )
inlineprotected

Definition at line 222 of file linear_solver_cholmod.h.

References _cholmod.

Referenced by init(), and ~LinearSolverCholmod().

◆ init()

template<typename MatrixType>
virtual bool g2o::LinearSolverCholmod< MatrixType >::init ( )
inlinevirtual

init for operating on matrices with a different non-zero pattern like before

Implements g2o::LinearSolver< MatrixType >.

Definition at line 57 of file linear_solver_cholmod.h.

References freeCholdmodFactor().

◆ operator=()

template<typename MatrixType>
LinearSolverCholmod & g2o::LinearSolverCholmod< MatrixType >::operator= ( LinearSolverCholmod< MatrixType > const & )
delete

References LinearSolverCholmod().

◆ saveMatrix()

template<typename MatrixType>
virtual bool g2o::LinearSolverCholmod< MatrixType >::saveMatrix ( const std::string & fileName)
inlinevirtual

◆ solve()

template<typename MatrixType>
bool g2o::LinearSolverCholmod< MatrixType >::solve ( const SparseBlockMatrix< MatrixType > & A,
double * x,
double * b )
inlinevirtual

Assumes that A is the same matrix for several calls. Among other assumptions, the non-zero pattern does not change! If the matrix changes call init() before. solve system Ax = b, x and b have to allocated beforehand!!

Implements g2o::LinearSolver< MatrixType >.

Definition at line 62 of file linear_solver_cholmod.h.

References _cholmod, g2o::G2OBatchStatistics::choleskyNNZ, computeCholmodFactor(), g2o::get_monotonic_time(), g2o::G2OBatchStatistics::globalStats(), and g2o::G2OBatchStatistics::timeNumericDecomposition.

◆ solveBlocks_impl()

Member Data Documentation

◆ _blockPermutation

template<typename MatrixType>
VectorXI g2o::LinearSolverCholmod< MatrixType >::_blockPermutation
protected

Definition at line 89 of file linear_solver_cholmod.h.

Referenced by computeSymbolicDecomposition().

◆ _cholmod

template<typename MatrixType>
cholmod::Cholmod g2o::LinearSolverCholmod< MatrixType >::_cholmod
protected

◆ _matrixStructure

template<typename MatrixType>
MatrixStructure g2o::LinearSolverCholmod< MatrixType >::_matrixStructure
protected

Definition at line 88 of file linear_solver_cholmod.h.

Referenced by computeSymbolicDecomposition().

◆ _scalarPermutation

template<typename MatrixType>
VectorXI g2o::LinearSolverCholmod< MatrixType >::_scalarPermutation
protected

Definition at line 89 of file linear_solver_cholmod.h.

Referenced by computeSymbolicDecomposition().


The documentation for this class was generated from the following file: