g2o
|
stop iterating based on the gain which is (oldChi - currentChi) / currentChi. More...
#include <sparse_optimizer_terminate_action.h>
Public Member Functions | |
SparseOptimizerTerminateAction () | |
virtual HyperGraphAction * | operator() (const HyperGraph *graph, Parameters *parameters=0) |
double | gainThreshold () const |
void | setGainThreshold (double gainThreshold) |
int | maxIterations () const |
void | setMaxIterations (int maxit) |
Public Member Functions inherited from g2o::HyperGraphAction | |
virtual | ~HyperGraphAction () |
Protected Member Functions | |
void | setOptimizerStopFlag (const SparseOptimizer *optimizer, bool stop) |
Protected Attributes | |
double | _gainThreshold |
double | _lastChi |
bool | _auxTerminateFlag |
int | _maxIterations |
stop iterating based on the gain which is (oldChi - currentChi) / currentChi.
stop iterating based on the gain which is (oldChi - currentChi) / currentChi. If the gain is larger than zero and below the threshold, then the optimizer is stopped. Typically usage of this action includes adding it as a postIteration action, by calling addPostIterationAction on a sparse optimizer.
Definition at line 19 of file sparse_optimizer_terminate_action.h.
g2o::SparseOptimizerTerminateAction::SparseOptimizerTerminateAction | ( | ) |
Definition at line 9 of file sparse_optimizer_terminate_action.cpp.
|
inline |
Definition at line 25 of file sparse_optimizer_terminate_action.h.
Referenced by setGainThreshold().
|
inline |
Definition at line 28 of file sparse_optimizer_terminate_action.h.
|
virtual |
re-implement to carry out an action given the graph
Reimplemented from g2o::HyperGraphAction.
Definition at line 21 of file sparse_optimizer_terminate_action.cpp.
References _gainThreshold, _lastChi, _maxIterations, g2o::SparseOptimizer::activeRobustChi2(), graph, g2o::HyperGraphAction::ParametersIteration::iteration, and setOptimizerStopFlag().
void g2o::SparseOptimizerTerminateAction::setGainThreshold | ( | double | gainThreshold | ) |
Definition at line 16 of file sparse_optimizer_terminate_action.cpp.
References _gainThreshold, and gainThreshold().
Referenced by main().
void g2o::SparseOptimizerTerminateAction::setMaxIterations | ( | int | maxit | ) |
Definition at line 59 of file sparse_optimizer_terminate_action.cpp.
References _maxIterations.
Referenced by main().
|
protected |
Definition at line 64 of file sparse_optimizer_terminate_action.cpp.
References _auxTerminateFlag, and g2o::SparseOptimizer::forceStopFlag().
Referenced by operator()().
|
protected |
Definition at line 34 of file sparse_optimizer_terminate_action.h.
Referenced by setOptimizerStopFlag().
|
protected |
Definition at line 32 of file sparse_optimizer_terminate_action.h.
Referenced by operator()(), and setGainThreshold().
|
protected |
Definition at line 33 of file sparse_optimizer_terminate_action.h.
Referenced by operator()().
|
protected |
Definition at line 35 of file sparse_optimizer_terminate_action.h.
Referenced by operator()(), and setMaxIterations().