g2o
Loading...
Searching...
No Matches
g2o::OptimizationAlgorithmWithHessian Class Reference

Base for solvers operating on the approximated Hessian, e.g., Gauss-Newton, Levenberg. More...

#include <optimization_algorithm_with_hessian.h>

Inheritance diagram for g2o::OptimizationAlgorithmWithHessian:
Collaboration diagram for g2o::OptimizationAlgorithmWithHessian:

Public Member Functions

 OptimizationAlgorithmWithHessian (Solver &solver)
virtual ~OptimizationAlgorithmWithHessian ()
virtual bool init (bool online=false)
virtual bool computeMarginals (SparseBlockMatrix< MatrixX > &spinv, const std::vector< std::pair< int, int > > &blockIndices)
virtual bool buildLinearStructure ()
virtual void updateLinearSystem ()
virtual bool updateStructure (const std::vector< HyperGraph::Vertex * > &vset, const HyperGraph::EdgeSet &edges)
Solver & solver ()
 return the underlying solver used to solve the linear system
virtual void setWriteDebug (bool writeDebug)
virtual bool writeDebug () const
Public Member Functions inherited from g2o::OptimizationAlgorithm
 OptimizationAlgorithm ()
virtual ~OptimizationAlgorithm ()
virtual SolverResult solve (int iteration, bool online=false)=0
virtual void printVerbose (std::ostream &os) const
const SparseOptimizer * optimizer () const
 return the optimizer operating on
SparseOptimizer * optimizer ()
void setOptimizer (SparseOptimizer *optimizer)
const PropertyMap & properties () const
 return the properties of the solver
bool updatePropertiesFromString (const std::string &propString)
void printProperties (std::ostream &os) const

Protected Attributes

Solver & _solver
Property< bool > * _writeDebug
Protected Attributes inherited from g2o::OptimizationAlgorithm
SparseOptimizer * _optimizer
 the optimizer the solver is working on
PropertyMap _properties

Detailed Description

Base for solvers operating on the approximated Hessian, e.g., Gauss-Newton, Levenberg.

Definition at line 41 of file optimization_algorithm_with_hessian.h.

Constructor & Destructor Documentation

◆ OptimizationAlgorithmWithHessian()

◆ ~OptimizationAlgorithmWithHessian()

g2o::OptimizationAlgorithmWithHessian::~OptimizationAlgorithmWithHessian ( )
virtual

Definition at line 45 of file optimization_algorithm_with_hessian.cpp.

Member Function Documentation

◆ buildLinearStructure()

bool g2o::OptimizationAlgorithmWithHessian::buildLinearStructure ( )
virtual

◆ computeMarginals()

bool g2o::OptimizationAlgorithmWithHessian::computeMarginals ( SparseBlockMatrix< MatrixX > & spinv,
const std::vector< std::pair< int, int > > & blockIndices )
virtual

computes the block diagonal elements of the pattern specified in the input and stores them in given SparseBlockMatrix. If your solver does not support computing the marginals, return false.

Implements g2o::OptimizationAlgorithm.

Definition at line 70 of file optimization_algorithm_with_hessian.cpp.

References _solver.

◆ init()

bool g2o::OptimizationAlgorithmWithHessian::init ( bool online = false)
virtual

initialize the solver, called once before the first call to solve()

Implements g2o::OptimizationAlgorithm.

Definition at line 47 of file optimization_algorithm_with_hessian.cpp.

References g2o::OptimizationAlgorithm::_optimizer, _solver, _writeDebug, and g2o::OptimizableGraph::Vertex::marginalized().

◆ setWriteDebug()

void g2o::OptimizationAlgorithmWithHessian::setWriteDebug ( bool writeDebug)
virtual

write debug output of the Hessian if system is not positive definite

Definition at line 90 of file optimization_algorithm_with_hessian.cpp.

References _writeDebug, and writeDebug().

◆ solver()

◆ updateLinearSystem()

void g2o::OptimizationAlgorithmWithHessian::updateLinearSystem ( )
virtual

◆ updateStructure()

bool g2o::OptimizationAlgorithmWithHessian::updateStructure ( const std::vector< HyperGraph::Vertex * > & vset,
const HyperGraph::EdgeSet & edges )
virtual

update the structures for online processing

Implements g2o::OptimizationAlgorithm.

Definition at line 84 of file optimization_algorithm_with_hessian.cpp.

References _solver.

◆ writeDebug()

virtual bool g2o::OptimizationAlgorithmWithHessian::writeDebug ( ) const
inlinevirtual

Definition at line 67 of file optimization_algorithm_with_hessian.h.

References _writeDebug.

Referenced by setWriteDebug().

Member Data Documentation

◆ _solver

◆ _writeDebug

Property<bool>* g2o::OptimizationAlgorithmWithHessian::_writeDebug
protected

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