|
g2o
|
Implementation of Powell's Dogleg Algorithm. More...
#include <optimization_algorithm_dogleg.h>


Public Types | |
| enum | { STEP_UNDEFINED , STEP_SD , STEP_GN , STEP_DL } |
| type of the step to take More... | |
Public Member Functions | |
| OptimizationAlgorithmDogleg (std::unique_ptr< BlockSolverBase > solver) | |
| virtual | ~OptimizationAlgorithmDogleg () |
| virtual SolverResult | solve (int iteration, bool online=false) |
| virtual void | printVerbose (std::ostream &os) const |
| int | lastStep () const |
| return the type of the last step taken by the algorithm | |
| double | trustRegion () const |
| return the diameter of the trust region | |
Public Member Functions inherited from g2o::OptimizationAlgorithmWithHessian | |
| 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 () |
| 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 |
Static Public Member Functions | |
| static const char * | stepType2Str (int stepType) |
| convert the type into an integer | |
Protected Attributes | |
| Property< int > * | _maxTrialsAfterFailure |
| Property< double > * | _userDeltaInit |
| Property< double > * | _initialLambda |
| Property< double > * | _lamdbaFactor |
| VectorX | _hsd |
| steepest decent step | |
| VectorX | _hdl |
| final dogleg step | |
| VectorX | _auxVector |
| double | _currentLambda |
| the damping factor to force positive definite matrix | |
| double | _delta |
| trust region | |
| int | _lastStep |
| type of the step taken by the algorithm | |
| bool | _wasPDInAllIterations |
| int | _lastNumTries |
Protected Attributes inherited from g2o::OptimizationAlgorithmWithHessian | |
| Solver & | _solver |
| Property< bool > * | _writeDebug |
Protected Attributes inherited from g2o::OptimizationAlgorithm | |
| SparseOptimizer * | _optimizer |
| the optimizer the solver is working on | |
| PropertyMap | _properties |
Private Attributes | |
| std::unique_ptr< BlockSolverBase > | m_solver |
Implementation of Powell's Dogleg Algorithm.
Definition at line 42 of file optimization_algorithm_dogleg.h.
| anonymous enum |
type of the step to take
| Enumerator | |
|---|---|
| STEP_UNDEFINED | |
| STEP_SD | |
| STEP_GN | |
| STEP_DL | |
Definition at line 46 of file optimization_algorithm_dogleg.h.
|
explicit |
construct the Dogleg algorithm, which will use the given Solver for solving the linearized system.
Definition at line 42 of file optimization_algorithm_dogleg.cpp.
References _currentLambda, _delta, _initialLambda, _lamdbaFactor, _lastNumTries, _lastStep, _maxTrialsAfterFailure, g2o::OptimizationAlgorithm::_properties, _userDeltaInit, _wasPDInAllIterations, g2o::PropertyMap::makeProperty(), STEP_UNDEFINED, and g2o::Property< T >::value().
|
virtual |
Definition at line 61 of file optimization_algorithm_dogleg.cpp.
|
inline |
return the type of the last step taken by the algorithm
Definition at line 61 of file optimization_algorithm_dogleg.h.
|
virtual |
called by the optimizer if verbose. re-implement, if you want to print something
Reimplemented from g2o::OptimizationAlgorithm.
Definition at line 219 of file optimization_algorithm_dogleg.cpp.
References _currentLambda, _delta, _lastNumTries, _lastStep, _wasPDInAllIterations, and stepType2Str().
|
virtual |
Solve one iteration. The SparseOptimizer running on-top will call this for the given number of iterations.
| iteration | indicates the current iteration |
Implements g2o::OptimizationAlgorithm.
Definition at line 63 of file optimization_algorithm_dogleg.cpp.
References __PRETTY_FUNCTION__, _auxVector, _currentLambda, _delta, _hdl, _hsd, _initialLambda, _lamdbaFactor, _lastNumTries, _lastStep, _maxTrialsAfterFailure, g2o::OptimizationAlgorithm::_optimizer, g2o::OptimizationAlgorithmWithHessian::_solver, _userDeltaInit, _wasPDInAllIterations, g2o::SparseOptimizer::activeRobustChi2(), g2o::Solver::b(), g2o::Solver::buildStructure(), g2o::Solver::buildSystem(), g2o::SparseOptimizer::computeActiveErrors(), g2o::cst(), g2o::SparseOptimizer::discardTop(), G2O_WARN, g2o::get_monotonic_time(), g2o::G2OBatchStatistics::globalStats(), g2o::BlockSolverBase::multiplyHessian(), OK, g2o::Solver::optimizer(), g2o::SparseOptimizer::pop(), g2o::SparseOptimizer::push(), g2o::Solver::restoreDiagonal(), g2o::Solver::setLambda(), g2o::Solver::solve(), STEP_DL, STEP_GN, STEP_SD, Terminate, g2o::G2OBatchStatistics::timeQuadraticForm, g2o::G2OBatchStatistics::timeResiduals, g2o::SparseOptimizer::update(), g2o::Property< T >::value(), g2o::Solver::vectorSize(), and g2o::Solver::x().
|
static |
convert the type into an integer
Definition at line 225 of file optimization_algorithm_dogleg.cpp.
References STEP_DL, STEP_GN, and STEP_SD.
Referenced by printVerbose().
|
inline |
return the diameter of the trust region
Definition at line 63 of file optimization_algorithm_dogleg.h.
|
protected |
auxiliary vector used to perform multiplications or other stuff
Definition at line 78 of file optimization_algorithm_dogleg.h.
Referenced by solve().
|
protected |
the damping factor to force positive definite matrix
Definition at line 82 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), printVerbose(), and solve().
|
protected |
trust region
Definition at line 83 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), printVerbose(), and solve().
|
protected |
final dogleg step
Definition at line 77 of file optimization_algorithm_dogleg.h.
Referenced by solve().
|
protected |
steepest decent step
Definition at line 76 of file optimization_algorithm_dogleg.h.
Referenced by solve().
|
protected |
Definition at line 73 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), and solve().
|
protected |
Definition at line 74 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), and solve().
|
protected |
Definition at line 87 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), printVerbose(), and solve().
|
protected |
type of the step taken by the algorithm
Definition at line 84 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), printVerbose(), and solve().
|
protected |
Definition at line 70 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), and solve().
|
protected |
Definition at line 71 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), and solve().
|
protected |
the matrix we solve was positive definite in all iterations -> if not apply damping
Definition at line 85 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), printVerbose(), and solve().
|
private |
Definition at line 90 of file optimization_algorithm_dogleg.h.