Implementation of a solver operating on the blocks of the Hessian. More...
#include <block_solver.h>
Public Types | |
typedef Traits::LandmarkHessianType | LandmarkHessianType |
typedef Traits::LandmarkMatrixType | LandmarkMatrixType |
typedef Traits::LandmarkVectorType | LandmarkVectorType |
typedef Traits::LinearSolverType | LinearSolverType |
typedef Traits::PoseHessianType | PoseHessianType |
typedef Traits::PoseLandmarkHessianType | PoseLandmarkHessianType |
typedef Traits::PoseLandmarkMatrixType | PoseLandmarkMatrixType |
typedef Traits::PoseMatrixType | PoseMatrixType |
typedef Traits::PoseVectorType | PoseVectorType |
Public Member Functions | |
BlockSolver (LinearSolverType *linearSolver) | |
virtual bool | buildStructure (bool zeroBlocks=false) |
virtual bool | buildSystem () |
virtual bool | computeMarginals (SparseBlockMatrix< MatrixXd > &spinv, const std::vector< std::pair< int, int > > &blockIndices) |
virtual bool | init (SparseOptimizer *optmizer, bool online=false) |
LinearSolver< PoseMatrixType > * | linearSolver () const |
virtual void | multiplyHessian (double *dest, const double *src) const |
virtual void | restoreDiagonal () |
virtual bool | saveHessian (const std::string &fileName) const |
write the hessian to disk using the specified file name More... | |
virtual bool | schur () |
should the solver perform the schur complement or not More... | |
virtual bool | setLambda (double lambda, bool backup=false) |
virtual void | setSchur (bool s) |
virtual void | setWriteDebug (bool writeDebug) |
virtual bool | solve () |
virtual bool | supportsSchur () |
virtual bool | updateStructure (const std::vector< HyperGraph::Vertex * > &vset, const HyperGraph::EdgeSet &edges) |
virtual bool | writeDebug () const |
~BlockSolver () | |
Public Member Functions inherited from g2o::BlockSolverBase | |
virtual | ~BlockSolverBase () |
Public Member Functions inherited from g2o::Solver | |
size_t | additionalVectorSpace () const |
double * | b () |
return b, the right hand side of the system More... | |
const double * | b () const |
bool | levenberg () const |
the system is Levenberg-Marquardt More... | |
SparseOptimizer * | optimizer () const |
the optimizer (graph) on which the solver works More... | |
void | setAdditionalVectorSpace (size_t s) |
void | setLevenberg (bool levenberg) |
void | setOptimizer (SparseOptimizer *optimizer) |
Solver () | |
size_t | vectorSize () const |
return the size of the solution vector (x) and b More... | |
double * | x () |
return x, the solution vector More... | |
const double * | x () const |
virtual | ~Solver () |
Static Public Attributes | |
static const int | LandmarkDim = Traits::LandmarkDim |
static const int | PoseDim = Traits::PoseDim |
Protected Member Functions | |
void | deallocate () |
void | resize (int *blockPoseIndices, int numPoseBlocks, int *blockLandmarkIndices, int numLandmarkBlocks, int totalDim) |
Protected Member Functions inherited from g2o::Solver | |
void | resizeVector (size_t sx) |
Implementation of a solver operating on the blocks of the Hessian.
Definition at line 97 of file block_solver.h.
typedef Traits::LandmarkHessianType g2o::BlockSolver< Traits >::LandmarkHessianType |
Definition at line 109 of file block_solver.h.
typedef Traits::LandmarkMatrixType g2o::BlockSolver< Traits >::LandmarkMatrixType |
Definition at line 103 of file block_solver.h.
typedef Traits::LandmarkVectorType g2o::BlockSolver< Traits >::LandmarkVectorType |
Definition at line 106 of file block_solver.h.
typedef Traits::LinearSolverType g2o::BlockSolver< Traits >::LinearSolverType |
Definition at line 111 of file block_solver.h.
typedef Traits::PoseHessianType g2o::BlockSolver< Traits >::PoseHessianType |
Definition at line 108 of file block_solver.h.
typedef Traits::PoseLandmarkHessianType g2o::BlockSolver< Traits >::PoseLandmarkHessianType |
Definition at line 110 of file block_solver.h.
typedef Traits::PoseLandmarkMatrixType g2o::BlockSolver< Traits >::PoseLandmarkMatrixType |
Definition at line 104 of file block_solver.h.
typedef Traits::PoseMatrixType g2o::BlockSolver< Traits >::PoseMatrixType |
Definition at line 102 of file block_solver.h.
typedef Traits::PoseVectorType g2o::BlockSolver< Traits >::PoseVectorType |
Definition at line 105 of file block_solver.h.
g2o::BlockSolver< Traits >::BlockSolver | ( | LinearSolverType * | linearSolver | ) |
allocate a block solver ontop of the underlying linear solver. NOTE: The BlockSolver assumes exclusive access to the linear solver and will therefore free the pointer in its destructor.
Definition at line 42 of file block_solver.hpp.
g2o::BlockSolver< Traits >::~BlockSolver | ( | ) |
Definition at line 136 of file block_solver.hpp.
|
virtual |
build the structure of the system
Implements g2o::Solver.
Definition at line 143 of file block_solver.hpp.
|
virtual |
|
virtual |
computes the block diagonal elements of the pattern specified in the input and stores them in given SparseBlockMatrix
Implements g2o::Solver.
Definition at line 490 of file block_solver.hpp.
|
protected |
Definition at line 95 of file block_solver.hpp.
|
virtual |
initialize the solver, called once before the first iteration
Implements g2o::Solver.
Definition at line 607 of file block_solver.hpp.
|
inline |
Definition at line 135 of file block_solver.h.
|
inlinevirtual |
compute dest = H * src
Implements g2o::BlockSolverBase.
Definition at line 142 of file block_solver.h.
|
protected |
Definition at line 65 of file block_solver.hpp.
|
virtual |
restore a previosly made backup of the diagonal
Implements g2o::Solver.
Definition at line 592 of file block_solver.hpp.
|
virtual |
write the hessian to disk using the specified file name
Implements g2o::Solver.
Definition at line 629 of file block_solver.hpp.
|
inlinevirtual |
should the solver perform the schur complement or not
Implements g2o::Solver.
Definition at line 132 of file block_solver.h.
|
virtual |
update the system while performing Levenberg, i.e., modifying the diagonal components of A by doing += lambda along the main diagonal of the Matrix. Note that this function may be called with a positive and a negative lambda. The latter is used to undo a former modification. If backup is true, then the solver should store a backup of the diagonal, which can be restored by restoreDiagonal()
Implements g2o::Solver.
Definition at line 564 of file block_solver.hpp.
|
inlinevirtual |
Implements g2o::Solver.
Definition at line 133 of file block_solver.h.
|
virtual |
write debug output of the Hessian if system is not positive definite
Implements g2o::Solver.
Definition at line 623 of file block_solver.hpp.
|
virtual |
|
inlinevirtual |
does this solver support the Schur complement for solving a system consisting of poses and landmarks. Re-implemement in a derived solver, if your solver supports it.
Reimplemented from g2o::Solver.
Definition at line 131 of file block_solver.h.
|
virtual |
update the structures for online processing
Implements g2o::Solver.
Definition at line 298 of file block_solver.hpp.
|
inlinevirtual |
Implements g2o::Solver.
Definition at line 138 of file block_solver.h.
|
protected |
Definition at line 172 of file block_solver.h.
|
protected |
Definition at line 171 of file block_solver.h.
|
protected |
Definition at line 163 of file block_solver.h.
|
protected |
Definition at line 162 of file block_solver.h.
|
protected |
Definition at line 155 of file block_solver.h.
|
protected |
Definition at line 169 of file block_solver.h.
|
protected |
Definition at line 151 of file block_solver.h.
|
protected |
Definition at line 152 of file block_solver.h.
|
protected |
Definition at line 157 of file block_solver.h.
|
protected |
Definition at line 150 of file block_solver.h.
|
protected |
Definition at line 154 of file block_solver.h.
|
protected |
Definition at line 158 of file block_solver.h.
|
protected |
Definition at line 160 of file block_solver.h.
|
protected |
Definition at line 174 of file block_solver.h.
|
protected |
Definition at line 174 of file block_solver.h.
|
protected |
Definition at line 175 of file block_solver.h.
|
protected |
Definition at line 175 of file block_solver.h.
|
static |
Definition at line 101 of file block_solver.h.
|
static |
Definition at line 100 of file block_solver.h.