g2o
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
g2o::LinearSolverCCS< MatrixType > Class Template Referenceabstract

Solver with faster iterating structure for the linear matrix. More...

#include <linear_solver.h>

Inheritance diagram for g2o::LinearSolverCCS< MatrixType >:
Inheritance graph
[legend]
Collaboration diagram for g2o::LinearSolverCCS< MatrixType >:
Collaboration graph
[legend]

Public Member Functions

 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 ()
 
virtual bool init ()=0
 
virtual bool solve (const SparseBlockMatrix< MatrixType > &A, double *x, double *b)=0
 
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 initMatrixStructure (const SparseBlockMatrix< MatrixType > &A)
 
virtual bool solveBlocks_impl (const SparseBlockMatrix< MatrixType > &A, std::function< void(MarginalCovarianceCholesky &)> compute)=0
 

Protected Attributes

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::LinearSolverCCS< MatrixType >

Solver with faster iterating structure for the linear matrix.

Definition at line 150 of file linear_solver.h.

Constructor & Destructor Documentation

◆ LinearSolverCCS()

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

Definition at line 152 of file linear_solver.h.

153 : LinearSolver<MatrixType>(), _ccsMatrix(0), _blockOrdering(true) {}
SparseBlockMatrixCCS< MatrixType > * _ccsMatrix

◆ ~LinearSolverCCS()

template<typename MatrixType >
g2o::LinearSolverCCS< MatrixType >::~LinearSolverCCS ( )
inline

Definition at line 154 of file linear_solver.h.

154{ delete _ccsMatrix; }

References g2o::LinearSolverCCS< MatrixType >::_ccsMatrix.

Member Function Documentation

◆ blockOrdering()

template<typename MatrixType >
bool g2o::LinearSolverCCS< MatrixType >::blockOrdering ( ) const
inline

◆ initMatrixStructure()

template<typename MatrixType >
void g2o::LinearSolverCCS< MatrixType >::initMatrixStructure ( const SparseBlockMatrix< MatrixType > &  A)
inlineprotected

◆ setBlockOrdering()

template<typename MatrixType >
void g2o::LinearSolverCCS< MatrixType >::setBlockOrdering ( bool  blockOrdering)
inline

Definition at line 177 of file linear_solver.h.

bool blockOrdering() const
do the AMD ordering on the blocks or on the scalar matrix

References g2o::LinearSolverCCS< MatrixType >::_blockOrdering, and g2o::LinearSolverCCS< MatrixType >::blockOrdering().

◆ solveBlocks()

template<typename MatrixType >
virtual bool g2o::LinearSolverCCS< MatrixType >::solveBlocks ( double **&  blocks,
const SparseBlockMatrix< MatrixType > &  A 
)
inlinevirtual

Inverts the diagonal blocks of A

Returns
false if not defined.

Reimplemented from g2o::LinearSolver< MatrixType >.

Definition at line 156 of file linear_solver.h.

157 {
158 auto compute = [&](MarginalCovarianceCholesky& mcc) {
159 if (!blocks) LinearSolverCCS<MatrixType>::allocateBlocks(A, blocks);
160 mcc.computeCovariance(blocks, A.rowBlockIndices());
161 };
162 return solveBlocks_impl(A, compute);
163 }
virtual bool solveBlocks_impl(const SparseBlockMatrix< MatrixType > &A, std::function< void(MarginalCovarianceCholesky &)> compute)=0
static void allocateBlocks(const SparseBlockMatrix< MatrixType > &A, double **&blocks)
allocate block memory structure

References g2o::LinearSolver< MatrixType >::allocateBlocks(), g2o::SparseBlockMatrix< MatrixType >::rowBlockIndices(), and g2o::LinearSolverCCS< MatrixType >::solveBlocks_impl().

◆ solveBlocks_impl()

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

◆ solvePattern()

template<typename MatrixType >
virtual bool g2o::LinearSolverCCS< MatrixType >::solvePattern ( SparseBlockMatrix< MatrixX > &  spinv,
const std::vector< std::pair< int, int > > &  blockIndices,
const SparseBlockMatrix< MatrixType > &  A 
)
inlinevirtual

Inverts the a block pattern of A in spinv

Returns
false if not defined.

Reimplemented from g2o::LinearSolver< MatrixType >.

Definition at line 165 of file linear_solver.h.

168 {
169 auto compute = [&](MarginalCovarianceCholesky& mcc) {
170 mcc.computeCovariance(spinv, A.rowBlockIndices(), blockIndices);
171 };
172 return solveBlocks_impl(A, compute);
173 }

References g2o::SparseBlockMatrix< MatrixType >::rowBlockIndices(), and g2o::LinearSolverCCS< MatrixType >::solveBlocks_impl().

Member Data Documentation

◆ _blockOrdering

template<typename MatrixType >
bool g2o::LinearSolverCCS< MatrixType >::_blockOrdering
protected

◆ _ccsMatrix

template<typename MatrixType >
SparseBlockMatrixCCS<MatrixType>* g2o::LinearSolverCCS< MatrixType >::_ccsMatrix
protected

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