|
g2o
|
linear solver using PCG, pre-conditioner is block Jacobi More...
#include <linear_solver_pcg.h>


Public Member Functions | |
| LinearSolverPCG () | |
| virtual | ~LinearSolverPCG () |
| virtual bool | init () |
| bool | solve (const SparseBlockMatrix< MatrixType > &A, double *x, double *b) |
| double | tolerance () const |
| return the tolerance for terminating PCG before convergence | |
| void | setTolerance (double tolerance) |
| int | maxIterations () const |
| void | setMaxIterations (int maxIter) |
| bool | absoluteTolerance () const |
| void | setAbsoluteTolerance (bool absoluteTolerance) |
Public Member Functions inherited from g2o::LinearSolver< MatrixType > | |
| LinearSolver () | |
| virtual | ~LinearSolver () |
| 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 | writeDebug () const |
| write a debug dump of the system matrix if it is not PSD in solve | |
| void | setWriteDebug (bool b) |
Protected Types | |
| using | MatrixVector = std::vector< MatrixType > |
| using | MatrixPtrVector = std::vector< const MatrixType * > |
Protected Member Functions | |
| void | multDiag (const std::vector< int > &colBlockIndices, MatrixVector &A, const VectorX &src, VectorX &dest) |
| void | multDiag (const std::vector< int > &colBlockIndices, MatrixPtrVector &A, const VectorX &src, VectorX &dest) |
| void | mult (const std::vector< int > &colBlockIndices, const VectorX &src, VectorX &dest) |
Protected Attributes | |
| double | _tolerance |
| double | _residual |
| bool | _absoluteTolerance |
| int | _maxIter |
| MatrixPtrVector | _diag |
| MatrixVector | _J |
| std::vector< std::pair< int, int > > | _indices |
| MatrixPtrVector | _sparseMat |
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 using PCG, pre-conditioner is block Jacobi
Definition at line 43 of file linear_solver_pcg.h.
|
protected |
Definition at line 77 of file linear_solver_pcg.h.
|
protected |
Definition at line 76 of file linear_solver_pcg.h.
|
inline |
Definition at line 45 of file linear_solver_pcg.h.
References g2o::LinearSolverPCG< MatrixType >::_absoluteTolerance, g2o::LinearSolverPCG< MatrixType >::_maxIter, g2o::LinearSolverPCG< MatrixType >::_residual, g2o::LinearSolverPCG< MatrixType >::_tolerance, and g2o::cst().
|
inlinevirtual |
Definition at line 52 of file linear_solver_pcg.h.
|
inline |
Definition at line 70 of file linear_solver_pcg.h.
References g2o::LinearSolverPCG< MatrixType >::_absoluteTolerance.
Referenced by g2o::LinearSolverPCG< MatrixType >::setAbsoluteTolerance().
|
inlinevirtual |
init for operating on matrices with a different non-zero pattern like before
Implements g2o::LinearSolver< MatrixType >.
Definition at line 54 of file linear_solver_pcg.h.
References g2o::LinearSolverPCG< MatrixType >::_indices, g2o::LinearSolverPCG< MatrixType >::_residual, and g2o::LinearSolverPCG< MatrixType >::_sparseMat.
|
inline |
Definition at line 67 of file linear_solver_pcg.h.
References g2o::LinearSolverPCG< MatrixType >::_maxIter.
|
protected |
Definition at line 186 of file linear_solver_pcg.hpp.
References internal::pcg_atxpy(), and internal::pcg_axpy().
|
protected |
Definition at line 175 of file linear_solver_pcg.hpp.
References internal::pcg_axy().
|
protected |
Definition at line 164 of file linear_solver_pcg.hpp.
References internal::pcg_axy().
|
inline |
Definition at line 71 of file linear_solver_pcg.h.
References g2o::LinearSolverPCG< MatrixType >::_absoluteTolerance, and g2o::LinearSolverPCG< MatrixType >::absoluteTolerance().
|
inline |
Definition at line 68 of file linear_solver_pcg.h.
References g2o::LinearSolverPCG< MatrixType >::_maxIter.
|
inline |
Definition at line 65 of file linear_solver_pcg.h.
References g2o::LinearSolverPCG< MatrixType >::_tolerance, and g2o::LinearSolverPCG< MatrixType >::tolerance().
|
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!!
Implements g2o::LinearSolver< MatrixType >.
Definition at line 88 of file linear_solver_pcg.hpp.
References g2o::SparseBlockMatrix< MatrixType >::blockCols(), g2o::SparseBlockMatrix< MatrixType >::colBlockIndices(), g2o::SparseBlockMatrix< MatrixType >::cols(), G2O_DEBUG, g2o::G2OBatchStatistics::iterationsLinearSolver, g2o::SparseBlockMatrix< MatrixType >::rowBlockIndices(), and g2o::SparseBlockMatrix< MatrixType >::rows().
|
inline |
return the tolerance for terminating PCG before convergence
Definition at line 64 of file linear_solver_pcg.h.
References g2o::LinearSolverPCG< MatrixType >::_tolerance.
Referenced by g2o::LinearSolverPCG< MatrixType >::setTolerance().
|
protected |
Definition at line 81 of file linear_solver_pcg.h.
Referenced by g2o::LinearSolverPCG< MatrixType >::absoluteTolerance(), g2o::LinearSolverPCG< MatrixType >::LinearSolverPCG(), and g2o::LinearSolverPCG< MatrixType >::setAbsoluteTolerance().
|
protected |
Definition at line 84 of file linear_solver_pcg.h.
|
protected |
Definition at line 87 of file linear_solver_pcg.h.
Referenced by g2o::LinearSolverPCG< MatrixType >::init().
|
protected |
Definition at line 85 of file linear_solver_pcg.h.
|
protected |
Definition at line 82 of file linear_solver_pcg.h.
Referenced by g2o::LinearSolverPCG< MatrixType >::LinearSolverPCG(), g2o::LinearSolverPCG< MatrixType >::maxIterations(), and g2o::LinearSolverPCG< MatrixType >::setMaxIterations().
|
protected |
Definition at line 80 of file linear_solver_pcg.h.
Referenced by g2o::LinearSolverPCG< MatrixType >::init(), and g2o::LinearSolverPCG< MatrixType >::LinearSolverPCG().
|
protected |
Definition at line 88 of file linear_solver_pcg.h.
Referenced by g2o::LinearSolverPCG< MatrixType >::init().
|
protected |
Definition at line 79 of file linear_solver_pcg.h.
Referenced by g2o::LinearSolverPCG< MatrixType >::LinearSolverPCG(), g2o::LinearSolverPCG< MatrixType >::setTolerance(), and g2o::LinearSolverPCG< MatrixType >::tolerance().