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

linear solver which uses CSparse More...

#include <linear_solver_csparse.h>

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

Public Member Functions

 LinearSolverCSparse ()
 LinearSolverCSparse (LinearSolverCSparse< MatrixType > const &)=delete
LinearSolverCSparse & operator= (LinearSolverCSparse< MatrixType > const &)=delete
virtual ~LinearSolverCSparse ()=default
virtual bool init ()
bool solve (const SparseBlockMatrix< MatrixType > &A, double *x, double *b)
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 prepareSolve (const SparseBlockMatrix< MatrixType > &A)
void computeSymbolicDecomposition (const SparseBlockMatrix< MatrixType > &A)
void fillCSparse (const SparseBlockMatrix< MatrixType > &A, bool onlyValues)
bool solveBlocks_impl (const SparseBlockMatrix< MatrixType > &A, std::function< void(MarginalCovarianceCholesky &)> compute)
Protected Member Functions inherited from g2o::LinearSolverCCS< MatrixType >
void initMatrixStructure (const SparseBlockMatrix< MatrixType > &A)

Protected Attributes

csparse::CSparse csparse
MatrixStructure _matrixStructure
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::LinearSolverCSparse< MatrixType >

linear solver which uses CSparse

Definition at line 47 of file linear_solver_csparse.h.

Constructor & Destructor Documentation

◆ LinearSolverCSparse() [1/2]

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

◆ LinearSolverCSparse() [2/2]

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

References LinearSolverCSparse().

◆ ~LinearSolverCSparse()

template<typename MatrixType>
virtual g2o::LinearSolverCSparse< MatrixType >::~LinearSolverCSparse ( )
virtualdefault

Member Function Documentation

◆ computeSymbolicDecomposition()

◆ fillCSparse()

◆ init()

template<typename MatrixType>
virtual bool g2o::LinearSolverCSparse< 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_csparse.h.

References csparse.

◆ operator=()

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

References LinearSolverCSparse().

◆ prepareSolve()

template<typename MatrixType>
void g2o::LinearSolverCSparse< MatrixType >::prepareSolve ( const SparseBlockMatrix< MatrixType > & A)
inlineprotected

Definition at line 88 of file linear_solver_csparse.h.

References computeSymbolicDecomposition(), csparse, and fillCSparse().

Referenced by solve(), and solveBlocks_impl().

◆ solve()

template<typename MatrixType>
bool g2o::LinearSolverCSparse< 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_csparse.h.

References g2o::G2OBatchStatistics::choleskyNNZ, csparse, G2O_DEBUG, G2O_ERROR, g2o::get_monotonic_time(), g2o::G2OBatchStatistics::globalStats(), prepareSolve(), g2o::G2OBatchStatistics::timeNumericDecomposition, and g2o::LinearSolver< MatrixType >::writeDebug().

◆ solveBlocks_impl()

template<typename MatrixType>
bool g2o::LinearSolverCSparse< MatrixType >::solveBlocks_impl ( const SparseBlockMatrix< MatrixType > & A,
std::function< void(MarginalCovarianceCholesky &)> compute )
inlineprotectedvirtual

Member Data Documentation

◆ _matrixStructure

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

Definition at line 86 of file linear_solver_csparse.h.

Referenced by computeSymbolicDecomposition().

◆ csparse

template<typename MatrixType>
csparse::CSparse g2o::LinearSolverCSparse< MatrixType >::csparse
protected

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