g2o
|
linear solver which uses the sparse Cholesky solver from Eigen More...
#include <linear_solver_eigen.h>
Classes | |
class | CholeskyDecomposition |
Sub-classing Eigen's SimplicialLDLT to perform ordering with a given ordering. More... | |
Public Types | |
typedef Eigen::SparseMatrix< double, Eigen::ColMajor > | SparseMatrix |
typedef Eigen::Triplet< double > | Triplet |
typedef Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic > | PermutationMatrix |
Public Member Functions | |
LinearSolverEigen () | |
virtual | ~LinearSolverEigen () |
virtual bool | init () |
bool | solve (const SparseBlockMatrix< MatrixType > &A, double *x, double *b) |
bool | blockOrdering () const |
do the AMD ordering on the blocks or on the scalar matrix More... | |
void | setBlockOrdering (bool blockOrdering) |
virtual bool | writeDebug () const |
write a debug dump of the system matrix if it is not SPD in solve More... | |
virtual void | setWriteDebug (bool b) |
Public Member Functions inherited from g2o::LinearSolver< MatrixType > | |
LinearSolver () | |
virtual | ~LinearSolver () |
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) |
Protected Member Functions | |
void | computeSymbolicDecomposition (const SparseBlockMatrix< MatrixType > &A) |
void | fillSparseMatrix (const SparseBlockMatrix< MatrixType > &A, bool onlyValues) |
Protected Attributes | |
bool | _init |
bool | _blockOrdering |
bool | _writeDebug |
SparseMatrix | _sparseMatrix |
CholeskyDecomposition | _cholesky |
linear solver which uses the sparse Cholesky solver from Eigen
Has no dependencies except Eigen. Hence, should compile almost everywhere without to much issues. Performance should be similar to CSparse, I guess.
Definition at line 49 of file linear_solver_eigen.h.
typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic> g2o::LinearSolverEigen< MatrixType >::PermutationMatrix |
Definition at line 54 of file linear_solver_eigen.h.
typedef Eigen::SparseMatrix<double, Eigen::ColMajor> g2o::LinearSolverEigen< MatrixType >::SparseMatrix |
Definition at line 52 of file linear_solver_eigen.h.
typedef Eigen::Triplet<double> g2o::LinearSolverEigen< MatrixType >::Triplet |
Definition at line 53 of file linear_solver_eigen.h.
|
inline |
Definition at line 76 of file linear_solver_eigen.h.
|
inlinevirtual |
Definition at line 82 of file linear_solver_eigen.h.
|
inline |
do the AMD ordering on the blocks or on the scalar matrix
Definition at line 125 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_blockOrdering.
Referenced by g2o::LinearSolverEigen< MatrixType >::setBlockOrdering().
|
inlineprotected |
compute the symbolic decompostion of the matrix only once. Since A has the same pattern in all the iterations, we only compute the fill-in reducing ordering once and re-use for all the following iterations.
Definition at line 145 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::CholeskyDecomposition::analyzePatternWithPermutation(), g2o::SparseBlockMatrix< MatrixType >::blockCols(), g2o::SparseBlockMatrix< MatrixType >::colBaseOfBlock(), g2o::SparseBlockMatrix< MatrixType >::cols(), g2o::SparseBlockMatrix< MatrixType >::colsOfBlock(), g2o::get_monotonic_time(), g2o::G2OBatchStatistics::globalStats(), g2o::SparseBlockMatrix< MatrixType >::rows(), and g2o::G2OBatchStatistics::timeSymbolicDecomposition.
Referenced by g2o::LinearSolverEigen< MatrixType >::solve().
|
inlineprotected |
Definition at line 201 of file linear_solver_eigen.h.
References g2o::SparseBlockMatrix< MatrixType >::blockCols(), g2o::SparseBlockMatrix< MatrixType >::colBaseOfBlock(), g2o::SparseBlockMatrix< MatrixType >::fillCCS(), g2o::SparseBlockMatrix< MatrixType >::nonZeros(), and g2o::SparseBlockMatrix< MatrixType >::rowBaseOfBlock().
Referenced by g2o::LinearSolverEigen< MatrixType >::solve().
|
inlinevirtual |
init for operating on matrices with a different non-zero pattern like before
Implements g2o::LinearSolver< MatrixType >.
Definition at line 86 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_init.
|
inline |
Definition at line 126 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_blockOrdering, and g2o::LinearSolverEigen< MatrixType >::blockOrdering().
|
inlinevirtual |
Reimplemented from g2o::LinearSolver< MatrixType >.
Definition at line 130 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_writeDebug.
|
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 92 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_cholesky, g2o::LinearSolverEigen< MatrixType >::_init, g2o::LinearSolverEigen< MatrixType >::_sparseMatrix, g2o::LinearSolverEigen< MatrixType >::_writeDebug, g2o::G2OBatchStatistics::choleskyNNZ, g2o::SparseBlockMatrix< MatrixType >::cols(), g2o::LinearSolverEigen< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverEigen< MatrixType >::fillSparseMatrix(), g2o::get_monotonic_time(), g2o::G2OBatchStatistics::globalStats(), g2o::SparseBlockMatrix< MatrixType >::rows(), g2o::G2OBatchStatistics::timeNumericDecomposition, and g2o::SparseBlockMatrix< MatrixType >::writeOctave().
|
inlinevirtual |
write a debug dump of the system matrix if it is not SPD in solve
Reimplemented from g2o::LinearSolver< MatrixType >.
Definition at line 129 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_writeDebug.
|
protected |
Definition at line 134 of file linear_solver_eigen.h.
Referenced by g2o::LinearSolverEigen< MatrixType >::blockOrdering(), and g2o::LinearSolverEigen< MatrixType >::setBlockOrdering().
|
protected |
Definition at line 137 of file linear_solver_eigen.h.
Referenced by g2o::LinearSolverEigen< MatrixType >::solve().
|
protected |
Definition at line 133 of file linear_solver_eigen.h.
Referenced by g2o::LinearSolverEigen< MatrixType >::init(), and g2o::LinearSolverEigen< MatrixType >::solve().
|
protected |
Definition at line 136 of file linear_solver_eigen.h.
Referenced by g2o::LinearSolverEigen< MatrixType >::solve().
|
protected |
Definition at line 135 of file linear_solver_eigen.h.
Referenced by g2o::LinearSolverEigen< MatrixType >::setWriteDebug(), g2o::LinearSolverEigen< MatrixType >::solve(), and g2o::LinearSolverEigen< MatrixType >::writeDebug().