|
g2o
|
linear solver which uses the sparse Cholesky solver from Eigen More...
#include <linear_solver_eigen.h>


Classes | |
| class | CholeskyDecomposition |
| Sub-classing Eigen's SimplicialLLT 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 |
| using | CholeskyDecompositionBase = Eigen::SimplicialLLT< SparseMatrix, Eigen::Upper > |
Public Member Functions | |
| LinearSolverEigen () | |
| 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) |
Public Attributes | |
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW | |
Protected Member Functions | |
| bool | computeCholesky (const SparseBlockMatrix< MatrixType > &A, double &t) |
| void | computeSymbolicDecomposition (const SparseBlockMatrix< MatrixType > &A) |
| void | fillSparseMatrix (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 | |
| bool | _init |
| SparseMatrix | _sparseMatrix |
| CholeskyDecomposition | _cholesky |
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) |
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.
Definition at line 51 of file linear_solver_eigen.h.
| using g2o::LinearSolverEigen< MatrixType >::CholeskyDecompositionBase = Eigen::SimplicialLLT<SparseMatrix, Eigen::Upper> |
Definition at line 58 of file linear_solver_eigen.h.
| typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic> g2o::LinearSolverEigen< MatrixType >::PermutationMatrix |
Definition at line 56 of file linear_solver_eigen.h.
| typedef Eigen::SparseMatrix<double, Eigen::ColMajor> g2o::LinearSolverEigen< MatrixType >::SparseMatrix |
Definition at line 53 of file linear_solver_eigen.h.
| typedef Eigen::Triplet<double> g2o::LinearSolverEigen< MatrixType >::Triplet |
Definition at line 54 of file linear_solver_eigen.h.
|
inline |
Definition at line 87 of file linear_solver_eigen.h.
|
inlineprotected |
Definition at line 118 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_cholesky, g2o::LinearSolverEigen< MatrixType >::_init, g2o::LinearSolverEigen< MatrixType >::_sparseMatrix, g2o::SparseBlockMatrix< MatrixType >::cols(), g2o::LinearSolverEigen< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverEigen< MatrixType >::fillSparseMatrix(), G2O_DEBUG, G2O_ERROR, g2o::get_monotonic_time(), g2o::SparseBlockMatrix< MatrixType >::rows(), g2o::LinearSolver< MatrixType >::writeDebug(), and g2o::SparseBlockMatrix< MatrixType >::writeOctave().
Referenced by g2o::LinearSolverEigen< MatrixType >::solve(), and g2o::LinearSolverEigen< MatrixType >::solveBlocks_impl().
|
inlineprotected |
compute the symbolic decomposition 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 147 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_cholesky, g2o::LinearSolverEigen< MatrixType >::_sparseMatrix, g2o::LinearSolverEigen< MatrixType >::CholeskyDecomposition::analyzePatternWithPermutation(), g2o::SparseBlockMatrix< MatrixType >::blockCols(), g2o::LinearSolverCCS< MatrixType >::blockOrdering(), g2o::LinearSolver< MatrixType >::blockToScalarPermutation(), g2o::SparseBlockMatrix< MatrixType >::cols(), g2o::SparseBlockMatrix< MatrixType >::fillBlockStructure(), g2o::get_monotonic_time(), g2o::G2OBatchStatistics::globalStats(), g2o::SparseBlockMatrix< MatrixType >::nonZeroBlocks(), g2o::SparseBlockMatrix< MatrixType >::rows(), and g2o::G2OBatchStatistics::timeSymbolicDecomposition.
Referenced by g2o::LinearSolverEigen< MatrixType >::computeCholesky().
|
inlineprotected |
Definition at line 178 of file linear_solver_eigen.h.
References g2o::LinearSolverCCS< MatrixType >::_ccsMatrix, g2o::LinearSolverEigen< MatrixType >::_sparseMatrix, g2o::LinearSolverCCS< MatrixType >::initMatrixStructure(), and g2o::SparseBlockMatrix< MatrixType >::nonZeros().
Referenced by g2o::LinearSolverEigen< MatrixType >::computeCholesky().
|
inlinevirtual |
init for operating on matrices with a different non-zero pattern like before
Implements g2o::LinearSolver< MatrixType >.
Definition at line 89 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_init.
Referenced by g2o::SolverSLAM2DLinear::solveOrientation().
|
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 94 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_cholesky, g2o::LinearSolverEigen< MatrixType >::_sparseMatrix, g2o::G2OBatchStatistics::choleskyNNZ, g2o::LinearSolverEigen< MatrixType >::computeCholesky(), g2o::get_monotonic_time(), g2o::G2OBatchStatistics::globalStats(), and g2o::G2OBatchStatistics::timeNumericDecomposition.
|
inlineprotectedvirtual |
Implementation of the general parts for computing the inverse blocks of the linear system matrix. Here we call a function to do the underlying computation.
Implements g2o::LinearSolverCCS< MatrixType >.
Definition at line 198 of file linear_solver_eigen.h.
References g2o::LinearSolverEigen< MatrixType >::_cholesky, g2o::G2OBatchStatistics::choleskyNNZ, g2o::LinearSolverEigen< MatrixType >::computeCholesky(), g2o::G2OBatchStatistics::globalStats(), and g2o::MarginalCovarianceCholesky::setCholeskyFactor().
|
protected |
Definition at line 115 of file linear_solver_eigen.h.
Referenced by g2o::LinearSolverEigen< MatrixType >::computeCholesky(), g2o::LinearSolverEigen< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverEigen< MatrixType >::solve(), and g2o::LinearSolverEigen< MatrixType >::solveBlocks_impl().
|
protected |
Definition at line 113 of file linear_solver_eigen.h.
Referenced by g2o::LinearSolverEigen< MatrixType >::computeCholesky(), and g2o::LinearSolverEigen< MatrixType >::init().
|
protected |
Definition at line 114 of file linear_solver_eigen.h.
Referenced by g2o::LinearSolverEigen< MatrixType >::computeCholesky(), g2o::LinearSolverEigen< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverEigen< MatrixType >::fillSparseMatrix(), and g2o::LinearSolverEigen< MatrixType >::solve().
| g2o::LinearSolverEigen< MatrixType >::EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
Definition at line 86 of file linear_solver_eigen.h.