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 (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 More... | |
double | trustRegion () const |
return the diameter of the trust region More... | |
Public Member Functions inherited from g2o::OptimizationAlgorithmWithHessian | |
OptimizationAlgorithmWithHessian (Solver *solver) | |
virtual | ~OptimizationAlgorithmWithHessian () |
virtual bool | init (bool online=false) |
virtual bool | computeMarginals (SparseBlockMatrix< MatrixXD > &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 More... | |
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 More... | |
SparseOptimizer * | optimizer () |
void | setOptimizer (SparseOptimizer *optimizer) |
const PropertyMap & | properties () const |
return the properties of the solver More... | |
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 More... | |
Protected Attributes | |
Property< int > * | _maxTrialsAfterFailure |
Property< double > * | _userDeltaInit |
Property< double > * | _initialLambda |
Property< double > * | _lamdbaFactor |
VectorXD | _hsd |
steepest decent step More... | |
VectorXD | _hdl |
final dogleg step More... | |
VectorXD | _auxVector |
auxilary vector used to perform multiplications or other stuff More... | |
double | _currentLambda |
the damping factor to force positive definite matrix More... | |
double | _delta |
trust region More... | |
int | _lastStep |
type of the step taken by the algorithm More... | |
bool | _wasPDInAllIterations |
the matrix we solve was positive definite in all iterations -> if not apply damping More... | |
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 More... | |
PropertyMap | _properties |
the properties of your solver, use this to store the parameters of your solver More... | |
Implementation of Powell's Dogleg Algorithm.
Definition at line 40 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 44 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 41 of file optimization_algorithm_dogleg.cpp.
References _delta, _initialLambda, _lamdbaFactor, _lastStep, _maxTrialsAfterFailure, g2o::OptimizationAlgorithm::_properties, _userDeltaInit, _wasPDInAllIterations, g2o::PropertyMap::makeProperty(), STEP_UNDEFINED, and g2o::Property< T >::value().
|
virtual |
Definition at line 53 of file optimization_algorithm_dogleg.cpp.
|
inline |
return the type of the last step taken by the algorithm
Definition at line 62 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 209 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 57 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::SparseOptimizer::discardTop(), 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::Property< T >::value(), g2o::Solver::vectorSize(), and g2o::Solver::x().
|
static |
convert the type into an integer
Definition at line 219 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 64 of file optimization_algorithm_dogleg.h.
|
protected |
auxilary vector used to perform multiplications or other stuff
Definition at line 79 of file optimization_algorithm_dogleg.h.
Referenced by solve().
|
protected |
the damping factor to force positive definite matrix
Definition at line 81 of file optimization_algorithm_dogleg.h.
Referenced by printVerbose(), and solve().
|
protected |
trust region
Definition at line 82 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), printVerbose(), and solve().
|
protected |
final dogleg step
Definition at line 78 of file optimization_algorithm_dogleg.h.
Referenced by solve().
|
protected |
steepest decent step
Definition at line 77 of file optimization_algorithm_dogleg.h.
Referenced by solve().
|
protected |
Definition at line 74 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), and solve().
|
protected |
Definition at line 75 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), and solve().
|
protected |
Definition at line 85 of file optimization_algorithm_dogleg.h.
Referenced by printVerbose(), and solve().
|
protected |
type of the step taken by the algorithm
Definition at line 83 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), printVerbose(), and solve().
|
protected |
Definition at line 71 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), and solve().
|
protected |
Definition at line 72 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 84 of file optimization_algorithm_dogleg.h.
Referenced by OptimizationAlgorithmDogleg(), printVerbose(), and solve().