NDEVR
API Documentation
OptimizationAlgorithmDogleg< t_solver >

Implementation of Powell's Dogleg Algorithm. More...

Inheritance diagram for OptimizationAlgorithmDogleg< t_solver >:
[legend]
Collaboration diagram for OptimizationAlgorithmDogleg< t_solver >:
[legend]

Public Types

enum  
 type of the step to take
Public Types inherited from OptimizationAlgorithm
enum  SolverResult { Terminate =2 , OK =1 , Fail =-1 }
 Result codes returned by the solver after each iteration. More...

Public Member Functions

 OptimizationAlgorithmDogleg ()
 construct the Dogleg algorithm, which will use the given Solver for solving the linearized system.
int lastStep () const
 return the type of the last step taken by the algorithm
virtual void printVerbose (std::ostream &os) const
 Prints verbose information about the current Dogleg state.
virtual OptimizationAlgorithm::SolverResult solve (int iteration, bool online, int *blockPoseIndices, int *blockLandmarkIndices)
 Performs a single Dogleg iteration.
g_type trustRegion () const
 return the diameter of the trust region
Public Member Functions inherited from OptimizationAlgorithmWithHessian< t_solver >
 OptimizationAlgorithmWithHessian ()
 Default constructor.
void addEdge (HyperGraph::HGEdge *e)
 Adds an edge to the optimizer.
void addVertex (HyperGraph::HGVertex &v)
 Adds a vertex to the optimizer.
bool buildLinearStructure (IndexScratch &scratch)
 Builds the linear system structure.
void clear ()
 Clears the solver state.
bool init (bool online=false)
 Initializes the solver, detecting whether Schur complement should be used.
SparseOptimizeroptimizer ()
 Returns a mutable reference to the underlying sparse optimizer.
const SparseOptimizeroptimizer () const
 Returns a const reference to the underlying sparse optimizer.
void updateLinearSystem ()
 Rebuilds the linear system (Hessian and gradient) from the current graph state.
bool updateStructure (const Buffer< HyperGraph::HGVertex * > &vset, const Set< HyperGraph::HGVertex * > &edges)
 Updates the linear system structure after graph topology changes.

Static Public Member Functions

static const char * stepType2Str (int stepType)
 convert the type into an integer

Protected Attributes

Eigen::VectorX< g_type > _auxVector
 auxilary vector used to perform multiplications or other stuff
g_type _currentLambda
 The damping factor to force positive definite matrix.
g_type _delta
 Trust region radius.
Eigen::VectorX< g_type > _hdl
 final dogleg step
Eigen::VectorX< g_type > _hsd
 steepest decent step
g_type _initialLambda
 Initial damping factor for positive-definite enforcement.
g_type _lamdbaFactor
 Multiplicative factor for adjusting lambda.
int _lastNumTries
 Number of tries in the last iteration.
int _lastStep
 Type of the step taken by the algorithm.
int _maxTrialsAfterFailure
 Maximum number of trials before declaring failure.
g_type _userDeltaInit
 User-specified initial trust region radius.
bool _wasPDInAllIterations
 Whether the matrix was positive definite in all iterations.

Additional Inherited Members

Public Attributes inherited from OptimizationAlgorithmWithHessian< t_solver >
t_solver solver
 The underlying solver instance.

Detailed Description

template<class t_solver>
class OptimizationAlgorithmDogleg< t_solver >

Implementation of Powell's Dogleg Algorithm.

Definition at line 41 of file optimization_algorithm_dogleg.h.

Member Function Documentation

◆ printVerbose()

template<class t_solver>
virtual void OptimizationAlgorithmDogleg< t_solver >::printVerbose ( std::ostream & os) const
inlinevirtual

Prints verbose information about the current Dogleg state.

Parameters
[in]osThe output stream.

Definition at line 217 of file optimization_algorithm_dogleg.h.

References _currentLambda, _delta, _lastNumTries, _lastStep, _wasPDInAllIterations, and stepType2Str().

◆ solve()

template<class t_solver>
virtual OptimizationAlgorithm::SolverResult OptimizationAlgorithmDogleg< t_solver >::solve ( int iteration,
bool online,
int * blockPoseIndices,
int * blockLandmarkIndices )
inlinevirtual

Performs a single Dogleg iteration.

Parameters
[in]iterationCurrent iteration index.
[in]onlineWhether this is an online step.
[in]blockPoseIndicesPose block index array.
[in]blockLandmarkIndicesLandmark block index array.
Returns
The solver result (OK, Fail, or Terminate).

Definition at line 73 of file optimization_algorithm_dogleg.h.

References OptimizationAlgorithmWithHessian< t_solver >::OptimizationAlgorithmWithHessian(), _auxVector, _currentLambda, _delta, _hdl, _hsd, _initialLambda, _lamdbaFactor, _lastNumTries, _lastStep, _maxTrialsAfterFailure, _userDeltaInit, _wasPDInAllIterations, OptimizationAlgorithm::Fail, getMax(), OptimizationAlgorithm::OK, OptimizationAlgorithmWithHessian< t_solver >::optimizer(), OptimizationAlgorithmWithHessian< t_solver >::solver, sqrt(), and OptimizationAlgorithm::Terminate.


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