g2o
Public Member Functions | List of all members
g2o::LinearSolver< MatrixType > Class Template Referenceabstract

basic solver for Ax = b More...

#include <linear_solver.h>

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

Public Member Functions

 LinearSolver ()
 
virtual ~LinearSolver ()
 
virtual bool init ()=0
 
virtual bool solve (const SparseBlockMatrix< MatrixType > &A, double *x, double *b)=0
 
virtual bool solveBlocks (double **&blocks, const SparseBlockMatrix< MatrixType > &A)
 
virtual bool solvePattern (SparseBlockMatrix< MatrixXD > &spinv, const std::vector< std::pair< int, int > > &blockIndices, const SparseBlockMatrix< MatrixType > &A)
 
virtual bool writeDebug () const
 write a debug dump of the system matrix if it is not PSD in solve More...
 
virtual void setWriteDebug (bool)
 

Detailed Description

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

basic solver for Ax = b

basic solver for Ax = b which has to reimplemented for different linear algebra libraries. A is assumed to be symmetric (only upper triangular block is stored) and positive-semi-definit.

Definition at line 41 of file linear_solver.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file linear_solver.h.

44 {};
template<typename MatrixType>
virtual g2o::LinearSolver< MatrixType >::~LinearSolver ( )
inlinevirtual

Definition at line 45 of file linear_solver.h.

45 {}

Member Function Documentation

template<typename MatrixType>
virtual bool g2o::LinearSolver< MatrixType >::init ( )
pure virtual
template<typename MatrixType>
virtual void g2o::LinearSolver< MatrixType >::setWriteDebug ( bool  )
inlinevirtual
template<typename MatrixType>
virtual bool g2o::LinearSolver< MatrixType >::solve ( const SparseBlockMatrix< MatrixType > &  A,
double *  x,
double *  b 
)
pure virtual

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!!

Implemented in g2o::LinearSolverCholmod< MatrixType >, g2o::LinearSolverCSparse< MatrixType >, g2o::LinearSolverEigen< MatrixType >, g2o::LinearSolverCholmodOnline< MatrixType >, g2o::LinearSolverPCG< MatrixType >, and g2o::LinearSolverDense< MatrixType >.

Referenced by g2o::BlockSolver< Traits >::solve(), and g2o::LinearSolver< PoseMatrixType >::~LinearSolver().

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

Inverts the diagonal blocks of A

Returns
false if not defined.

Reimplemented in g2o::LinearSolverCholmod< MatrixType >, and g2o::LinearSolverCSparse< MatrixType >.

Definition at line 64 of file linear_solver.h.

64 { (void)blocks; (void) A; return false; }
template<typename MatrixType>
virtual bool g2o::LinearSolver< MatrixType >::solvePattern ( SparseBlockMatrix< MatrixXD > &  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 in g2o::LinearSolverCholmod< MatrixType >, and g2o::LinearSolverCSparse< MatrixType >.

Definition at line 71 of file linear_solver.h.

Referenced by g2o::BlockSolver< Traits >::computeMarginals().

71  {
72  (void) spinv;
73  (void) blockIndices;
74  (void) A;
75  return false;
76  }
template<typename MatrixType>
virtual bool g2o::LinearSolver< MatrixType >::writeDebug ( ) const
inlinevirtual

write a debug dump of the system matrix if it is not PSD in solve

Reimplemented in g2o::LinearSolverCholmod< MatrixType >, g2o::LinearSolverCSparse< MatrixType >, and g2o::LinearSolverEigen< MatrixType >.

Definition at line 79 of file linear_solver.h.

79 { return false;}

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