|
g2o
|
#include <sparse_optimizer.h>


Public Types | |
| enum | { AT_COMPUTEACTIVERROR = OptimizableGraph::AT_NUM_ELEMENTS , AT_NUM_ELEMENTS } |
Public Types inherited from g2o::OptimizableGraph | |
| enum | ActionType { AT_PREITERATION , AT_POSTITERATION , AT_NUM_ELEMENTS } |
| typedef std::set< HyperGraphAction * > | HyperGraphActionSet |
| typedef std::vector< OptimizableGraph::Vertex * > | VertexContainer |
| vector container for vertices | |
| typedef std::vector< OptimizableGraph::Edge * > | EdgeContainer |
| vector container for edges | |
Public Types inherited from g2o::HyperGraph | |
| typedef std::bitset< HyperGraph::HGET_NUM_ELEMS > | GraphElemBitset |
| typedef std::set< Edge * > | EdgeSet |
| typedef std::set< Vertex * > | VertexSet |
| typedef std::unordered_map< int, Vertex * > | VertexIDMap |
| typedef std::vector< Vertex * > | VertexContainer |
Public Member Functions | |
| SparseOptimizer () | |
| virtual | ~SparseOptimizer () |
| virtual bool | initializeOptimization (HyperGraph::EdgeSet &eset) |
| virtual bool | initializeOptimization (HyperGraph::VertexSet &vset, int level=0) |
| virtual bool | initializeOptimization (int level=0) |
| virtual bool | updateInitialization (HyperGraph::VertexSet &vset, HyperGraph::EdgeSet &eset) |
| virtual void | computeInitialGuess () |
| virtual void | computeInitialGuess (EstimatePropagatorCost &propagator) |
| virtual void | setToOrigin () |
| int | optimize (int iterations, bool online=false) |
| bool | computeMarginals (SparseBlockMatrix< MatrixX > &spinv, const std::vector< std::pair< int, int > > &blockIndices) |
| bool | computeMarginals (SparseBlockMatrix< MatrixX > &spinv, const Vertex *vertex) |
| bool | computeMarginals (SparseBlockMatrix< MatrixX > &spinv, const VertexContainer &vertices) |
| virtual Vertex * | findGauge () |
| finds a gauge in the graph to remove the undefined dof. | |
| bool | gaugeFreedom () |
| double | activeChi2 () const |
| double | activeRobustChi2 () const |
| bool | verbose () const |
| verbose information during optimization | |
| void | setVerbose (bool verbose) |
| void | setForceStopFlag (bool *flag) |
| bool * | forceStopFlag () const |
| bool | terminate () |
| if external stop flag is given, return its state. False otherwise | |
| const VertexContainer & | indexMapping () const |
| the index mapping of the vertices | |
| const VertexContainer & | activeVertices () const |
| the vertices active in the current optimization | |
| const EdgeContainer & | activeEdges () const |
| the edges active in the current optimization | |
| virtual bool | removeVertex (HyperGraph::Vertex *v, bool detach=false) |
| VertexContainer::const_iterator | findActiveVertex (const OptimizableGraph::Vertex *v) const |
| EdgeContainer::const_iterator | findActiveEdge (const OptimizableGraph::Edge *e) const |
| const OptimizationAlgorithm * | algorithm () const |
| the solver used by the optimizer | |
| OptimizationAlgorithm * | solver () |
| void | setAlgorithm (OptimizationAlgorithm *algorithm) |
| void | push (SparseOptimizer::VertexContainer &vlist) |
| push the estimate of a subset of the variables onto a stack | |
| void | push (HyperGraph::VertexSet &vlist) |
| push the estimate of a subset of the variables onto a stack | |
| void | push () |
| push all the active vertices onto a stack | |
| void | pop (SparseOptimizer::VertexContainer &vlist) |
| pop (restore) the estimate a subset of the variables from the stack | |
| void | pop (HyperGraph::VertexSet &vlist) |
| pop (restore) the estimate a subset of the variables from the stack | |
| void | pop () |
| pop (restore) the estimate of the active vertices from the stack | |
| void | discardTop (SparseOptimizer::VertexContainer &vlist) |
| void | discardTop () |
| same as above, but for the active vertices | |
| virtual void | clear () |
| void | computeActiveErrors () |
| G2O_ATTRIBUTE_DEPRECATED (void linearizeSystem()) | |
| void | update (const double *update) |
| const BatchStatisticsContainer & | batchStatistics () const |
| BatchStatisticsContainer & | batchStatistics () |
| void | setComputeBatchStatistics (bool computeBatchStatistics) |
| bool | computeBatchStatistics () const |
| bool | addComputeErrorAction (HyperGraphAction *action) |
| add an action to be executed before the error vectors are computed | |
| bool | removeComputeErrorAction (HyperGraphAction *action) |
| virtual void | discardTop () |
| virtual void | discardTop (HyperGraph::VertexSet &vset) |
Public Member Functions inherited from g2o::OptimizableGraph | |
| Vertex * | vertex (int id) |
| returns the vertex number id appropriately casted | |
| const Vertex * | vertex (int id) const |
| returns the vertex number id appropriately casted | |
| OptimizableGraph () | |
| empty constructor | |
| virtual | ~OptimizableGraph () |
| virtual bool | addVertex (HyperGraph::Vertex *v, Data *userData) |
| virtual bool | addVertex (HyperGraph::Vertex *v) |
| bool | addVertex (OptimizableGraph::Vertex *v, Data *userData) |
| bool | addVertex (OptimizableGraph::Vertex *v) |
| virtual bool | addEdge (HyperGraph::Edge *e) |
| bool | addEdge (OptimizableGraph::Edge *e) |
| virtual bool | setEdgeVertex (HyperGraph::Edge *e, int pos, HyperGraph::Vertex *v) |
| double | chi2 () const |
| returns the chi2 of the current configuration | |
| int | maxDimension () const |
| return the maximum dimension of all vertices in the graph | |
| void | recomputeJacobianWorkspaceSize () |
| std::set< int > | dimensions () const |
| virtual void | preIteration (int) |
| virtual void | postIteration (int) |
| bool | addPreIterationAction (HyperGraphAction *action) |
| add an action to be executed before each iteration | |
| bool | addPostIterationAction (HyperGraphAction *action) |
| add an action to be executed after each iteration | |
| bool | removePreIterationAction (HyperGraphAction *action) |
| remove an action that should no longer be executed before each iteration | |
| bool | removePostIterationAction (HyperGraphAction *action) |
| remove an action that should no longer be executed after each iteration | |
| virtual bool | load (std::istream &is) |
| bool | load (const char *filename) |
| virtual bool | save (std::ostream &os, int level=0) const |
| save the graph to a stream. Again uses the Factory system. | |
| bool | save (const char *filename, int level=0) const |
| function provided for convenience, see save() above | |
| bool | saveSubset (std::ostream &os, HyperGraph::VertexSet &vset, int level=0) |
| save a subgraph to a stream. Again uses the Factory system. | |
| bool | saveSubset (std::ostream &os, HyperGraph::EdgeSet &eset) |
| save a subgraph to a stream. Again uses the Factory system. | |
| virtual void | setFixed (HyperGraph::VertexSet &vset, bool fixed) |
| fixes/releases a set of vertices | |
| void | setRenamedTypesFromString (const std::string &types) |
| bool | isSolverSuitable (const OptimizationAlgorithmProperty &solverProperty, const std::set< int > &vertDims=std::set< int >()) const |
| virtual void | clearParameters () |
| bool | addParameter (Parameter *p) |
| Parameter * | parameter (int id) |
| bool | verifyInformationMatrices (bool verbose=false) const |
| bool | saveVertex (std::ostream &os, Vertex *v) const |
| bool | saveParameter (std::ostream &os, Parameter *v) const |
| bool | saveEdge (std::ostream &os, Edge *e) const |
| bool | saveUserData (std::ostream &os, HyperGraph::Data *v) const |
| JacobianWorkspace & | jacobianWorkspace () |
| the workspace for storing the Jacobians of the graph | |
| const JacobianWorkspace & | jacobianWorkspace () const |
| ParameterContainer & | parameters () |
| const ParameterContainer & | parameters () const |
| void | forEachVertex (std::function< void(OptimizableGraph::Vertex *)> fn) |
| apply a unary function to all vertices | |
| void | forEachVertex (HyperGraph::VertexSet &vset, std::function< void(OptimizableGraph::Vertex *)> fn) |
| apply a unary function to the vertices in vset | |
Public Member Functions inherited from g2o::HyperGraph | |
| HyperGraph () | |
| constructs an empty hyper graph | |
| virtual | ~HyperGraph () |
| destroys the hyper-graph and all the vertices of the graph | |
| Vertex * | vertex (int id) |
| const Vertex * | vertex (int id) const |
| virtual bool | removeEdge (Edge *e) |
| const VertexIDMap & | vertices () const |
| VertexIDMap & | vertices () |
| const EdgeSet & | edges () const |
| EdgeSet & | edges () |
| virtual bool | mergeVertices (Vertex *vBig, Vertex *vSmall, bool erase) |
| virtual bool | detachVertex (Vertex *v) |
| virtual bool | changeId (Vertex *v, int newId) |
Protected Member Functions | |
| void | sortVectorContainers () |
| bool | buildIndexMapping (SparseOptimizer::VertexContainer &vlist) |
| void | clearIndexMapping () |
Protected Member Functions inherited from g2o::OptimizableGraph | |
| void | performActions (int iter, HyperGraphActionSet &actions) |
Protected Attributes | |
| bool * | _forceStopFlag |
| bool | _verbose |
| VertexContainer | _ivMap |
| VertexContainer | _activeVertices |
| sorted according to VertexIDCompare | |
| EdgeContainer | _activeEdges |
| sorted according to EdgeIDCompare | |
| OptimizationAlgorithm * | _algorithm |
| BatchStatisticsContainer | _batchStatistics |
| bool | _computeBatchStatistics |
Protected Attributes inherited from g2o::OptimizableGraph | |
| std::map< std::string, std::string > | _renamedTypesLookup |
| long long | _nextEdgeId |
| std::vector< HyperGraphActionSet > | _graphActions |
| ParameterContainer | _parameters |
| JacobianWorkspace | _jacobianWorkspace |
Protected Attributes inherited from g2o::HyperGraph | |
| VertexIDMap | _vertices |
| EdgeSet | _edges |
Friends | |
| class | ActivePathCostFunction |
Additional Inherited Members | |
Static Public Member Functions inherited from g2o::OptimizableGraph | |
| static bool | initMultiThreading () |
Public Attributes inherited from g2o::OptimizableGraph | |
| class G2O_CORE_API | Vertex |
| class G2O_CORE_API | Edge |
Public Attributes inherited from g2o::HyperGraph | |
| class G2O_CORE_API | Data |
| class G2O_CORE_API | DataContainer |
| class G2O_CORE_API | Vertex |
| class G2O_CORE_API | Edge |
Static Public Attributes inherited from g2o::HyperGraph | |
| static const int | UnassignedId = -1 |
| static const int | InvalidId = -2 |
Definition at line 42 of file sparse_optimizer.h.
| anonymous enum |
| Enumerator | |
|---|---|
| AT_COMPUTEACTIVERROR | |
| AT_NUM_ELEMENTS | |
Definition at line 44 of file sparse_optimizer.h.
| g2o::SparseOptimizer::SparseOptimizer | ( | ) |
Definition at line 52 of file sparse_optimizer.cpp.
References g2o::OptimizableGraph::_graphActions, and AT_NUM_ELEMENTS.
|
virtual |
Definition at line 60 of file sparse_optimizer.cpp.
References _algorithm, g2o::release(), and g2o::G2OBatchStatistics::setGlobalStats().
| double g2o::SparseOptimizer::activeChi2 | ( | ) | const |
returns the cached chi2 of the active portion of the graph
Definition at line 94 of file sparse_optimizer.cpp.
References _activeEdges, and g2o::OptimizableGraph::Edge::chi2().
Referenced by computeInitialGuess(), main(), g2o::SparseOptimizerIncremental::optimize(), and g2o::SparseOptimizerOnline::optimize().
|
inline |
the edges active in the current optimization
Definition at line 190 of file sparse_optimizer.h.
Referenced by g2o::activeVertexChi(), g2o::EstimatePropagatorCost::operator()(), g2o::EstimatePropagatorCostOdometry::operator()(), and g2o::SolverSLAM2DLinear::solveOrientation().
| double g2o::SparseOptimizer::activeRobustChi2 | ( | ) | const |
returns the cached chi2 of the active portion of the graph. In contrast to activeChi2() this functions considers the weighting of the error according to the robustification of the error functions.
Definition at line 104 of file sparse_optimizer.cpp.
References _activeEdges, g2o::OptimizableGraph::Edge::chi2(), g2o::RobustKernel::robustify(), and g2o::OptimizableGraph::Edge::robustKernel().
Referenced by g2o::SparseOptimizerTerminateAction::operator()(), optimize(), g2o::OptimizationAlgorithmDogleg::solve(), and g2o::OptimizationAlgorithmLevenberg::solve().
|
inline |
the vertices active in the current optimization
Definition at line 188 of file sparse_optimizer.h.
Referenced by g2o::OptimizationAlgorithmWithHessian::init(), g2o::StructureOnlySolver< PointDoF >::init(), g2o::Star::labelStarEdges(), main(), and testMarginals().
| bool g2o::SparseOptimizer::addComputeErrorAction | ( | HyperGraphAction * | action | ) |
add an action to be executed before the error vectors are computed
Definition at line 614 of file sparse_optimizer.cpp.
References g2o::OptimizableGraph::_graphActions, and AT_COMPUTEACTIVERROR.
|
inline |
the solver used by the optimizer
Definition at line 214 of file sparse_optimizer.h.
Referenced by setAlgorithm().
|
inline |
returns the set of batch statistics about the optimisation
Definition at line 274 of file sparse_optimizer.h.
|
inline |
returns the set of batch statistics about the optimisation
Definition at line 268 of file sparse_optimizer.h.
Referenced by main().
|
protected |
builds the mapping of the active vertices to the (block) row / column in the Hessian
Definition at line 162 of file sparse_optimizer.cpp.
References _ivMap, g2o::OptimizableGraph::Vertex::fixed(), g2o::OptimizableGraph::Vertex::marginalized(), g2o::HyperGraph::Edge::resize(), and g2o::OptimizableGraph::Vertex::setHessianIndex().
Referenced by initializeOptimization(), and initializeOptimization().
|
virtual |
clears the graph, and polishes some intermediate structures Note that this only removes nodes / edges. Parameters can be removed with clearParameters().
Reimplemented from g2o::HyperGraph.
Definition at line 513 of file sparse_optimizer.cpp.
References _activeEdges, _activeVertices, _ivMap, and g2o::HyperGraph::clear().
Referenced by g2o::BlockSolver< Traits >::init(), main(), main(), and g2o::Gm2dlIO::readGm2dl().
|
protected |
Definition at line 189 of file sparse_optimizer.cpp.
References _ivMap.
Referenced by initializeOptimization(), initializeOptimization(), and removeVertex().
| void g2o::SparseOptimizer::computeActiveErrors | ( | ) |
computes the error vectors of all edges in the activeSet, and caches them
Definition at line 65 of file sparse_optimizer.cpp.
References _activeEdges, g2o::OptimizableGraph::_graphActions, g2o::arrayHasNaN(), AT_COMPUTEACTIVERROR, g2o::OptimizableGraph::Edge::computeError(), g2o::OptimizableGraph::Edge::dimension(), g2o::OptimizableGraph::Edge::errorData(), and G2O_WARN.
Referenced by computeInitialGuess(), g2o::computeSimpleStars(), g2o::Star::labelStarEdges(), main(), main(), optimize(), g2o::SparseOptimizerIncremental::optimize(), g2o::SparseOptimizerOnline::optimize(), g2o::OptimizationAlgorithmDogleg::solve(), g2o::OptimizationAlgorithmGaussNewton::solve(), and g2o::OptimizationAlgorithmLevenberg::solve().
|
inline |
|
virtual |
Propagates an initial guess from the vertex specified as origin. It should be called after initializeOptimization(...), as it relies on the _activeVertices/_edges structures. It constructs a set of trees starting from the nodes in the graph which are fixed and eligible for preforming optimization. The trees are constructed by utlizing a cost-function specified.
| costFunction | the cost function used @patam maxDistance: the distance where to stop the search |
Definition at line 320 of file sparse_optimizer.cpp.
References computeInitialGuess().
Referenced by computeInitialGuess(), g2o::computeSimpleStars(), g2o::Star::labelStarEdges(), and main().
|
virtual |
Same as above but using a specific propagator
Definition at line 325 of file sparse_optimizer.cpp.
References _activeEdges, activeChi2(), computeActiveErrors(), g2o::HyperGraph::Vertex::edges(), g2o::OptimizableGraph::Vertex::fixed(), g2o::OptimizableGraph::Vertex::hessianIndex(), g2o::OptimizableGraph::Edge::initialEstimate(), g2o::OptimizableGraph::Edge::initialEstimatePossible(), g2o::EstimatePropagatorCost::name(), g2o::EstimatePropagator::propagate(), g2o::OptimizableGraph::Vertex::push(), verbose(), g2o::HyperGraph::Edge::vertex(), and g2o::HyperGraph::Edge::vertices().
| bool g2o::SparseOptimizer::computeMarginals | ( | SparseBlockMatrix< MatrixX > & | spinv, |
| const std::vector< std::pair< int, int > > & | blockIndices | ||
| ) |
computes the blocks of the inverse of the specified pattern. the pattern is given via pairs <row, col> of the blocks in the hessian
| blockIndices | the pattern |
| spinv | the sparse block matrix with the result |
Definition at line 576 of file sparse_optimizer.cpp.
References _algorithm, and g2o::OptimizationAlgorithm::computeMarginals().
Referenced by computeMarginals(), computeMarginals(), g2o::EdgeLabeler::computePartialInverse(), main(), main(), and testMarginals().
| bool g2o::SparseOptimizer::computeMarginals | ( | SparseBlockMatrix< MatrixX > & | spinv, |
| const Vertex * | vertex | ||
| ) |
computes the inverse of the specified vertex.
| vertex | the vertex whose state is to be marginalised |
| spinv | the sparse block matrix with the result |
Definition at line 582 of file sparse_optimizer.cpp.
References computeMarginals(), and g2o::OptimizableGraph::vertex().
| bool g2o::SparseOptimizer::computeMarginals | ( | SparseBlockMatrix< MatrixX > & | spinv, |
| const VertexContainer & | vertices | ||
| ) |
computes the inverse of the set specified vertices, assembled into a single covariance matrix.
| vertex | the pattern |
| spinv | the sparse block matrix with the result |
Definition at line 592 of file sparse_optimizer.cpp.
References computeMarginals(), and g2o::HyperGraph::vertices().
|
virtual |
same as above, but for the active vertices
Reimplemented from g2o::OptimizableGraph.
Definition at line 628 of file sparse_optimizer.cpp.
References _activeVertices, and discardTop().
Referenced by discardTop().
|
virtual |
discard the last backup of the estimate for all variables by removing it from the stack
Reimplemented from g2o::OptimizableGraph.
Definition at line 665 of file optimizable_graph.cpp.
References g2o::OptimizationAlgorithmProperty::landmarkDim, g2o::OptimizationAlgorithmProperty::poseDim, and g2o::OptimizationAlgorithmProperty::requiresMarginalize.
|
virtual |
ignore the latest stored element on the stack, remove it from the stack but do not restore the estimate
Reimplemented from g2o::OptimizableGraph.
Definition at line 688 of file optimizable_graph.cpp.
| void g2o::SparseOptimizer::discardTop | ( | SparseOptimizer::VertexContainer & | vlist | ) |
ignore the latest stored element on the stack, remove it from the stack but do not restore the estimate
Definition at line 556 of file sparse_optimizer.cpp.
Referenced by g2o::OptimizationAlgorithmDogleg::solve(), and g2o::OptimizationAlgorithmLevenberg::solve().
| SparseOptimizer::EdgeContainer::const_iterator g2o::SparseOptimizer::findActiveEdge | ( | const OptimizableGraph::Edge * | e | ) | const |
search for an edge in _activeEdges and return the iterator pointing to it getActiveEdges().end() if not found
Definition at line 529 of file sparse_optimizer.cpp.
References _activeEdges.
Referenced by g2o::activeVertexChi(), g2o::EstimatePropagatorCost::operator()(), and g2o::EstimatePropagatorCostOdometry::operator()().
| SparseOptimizer::VertexContainer::const_iterator g2o::SparseOptimizer::findActiveVertex | ( | const OptimizableGraph::Vertex * | v | ) | const |
search for an edge in _activeVertices and return the iterator pointing to it getActiveVertices().end() if not found
Definition at line 521 of file sparse_optimizer.cpp.
References _activeVertices.
|
virtual |
finds a gauge in the graph to remove the undefined dof.
Definition at line 119 of file sparse_optimizer.cpp.
References g2o::OptimizableGraph::Vertex::dimension(), g2o::OptimizableGraph::maxDimension(), and g2o::HyperGraph::vertices().
Referenced by main().
|
inline |
Definition at line 180 of file sparse_optimizer.h.
Referenced by g2o::SparseOptimizerTerminateAction::setOptimizerStopFlag().
|
inline |
Linearizes the system by computing the Jacobians for the nodes and edges in the graph
Definition at line 254 of file sparse_optimizer.h.
| bool g2o::SparseOptimizer::gaugeFreedom | ( | ) |
Definition at line 137 of file sparse_optimizer.cpp.
References g2o::OptimizableGraph::Vertex::dimension(), g2o::OptimizableGraph::Edge::dimension(), g2o::HyperGraph::Vertex::edges(), g2o::OptimizableGraph::Vertex::fixed(), g2o::OptimizableGraph::maxDimension(), g2o::HyperGraph::Edge::vertices(), and g2o::HyperGraph::vertices().
Referenced by main().
|
inline |
the index mapping of the vertices
Definition at line 186 of file sparse_optimizer.h.
Referenced by g2o::OptimizationAlgorithmLevenberg::computeLambdaInit(), g2o::Star::labelStarEdges(), g2o::SparseOptimizerIncremental::optimize(), g2o::SparseOptimizerOnline::optimize(), and g2o::SolverSLAM2DLinear::solveOrientation().
|
virtual |
Initializes the structures for optimizing a portion of the graph specified by a subset of edges. Before calling it be sure to invoke marginalized() and fixed() to the vertices you want to include in the schur complement or to set as fixed during the optimization.
| eset | the subgraph to be optimized. |
Definition at line 277 of file sparse_optimizer.cpp.
References _activeEdges, _activeVertices, g2o::OptimizableGraph::_jacobianWorkspace, g2o::JacobianWorkspace::allocate(), buildIndexMapping(), clearIndexMapping(), g2o::HyperGraph::Edge::numUndefinedVertices(), g2o::OptimizableGraph::postIteration(), g2o::OptimizableGraph::preIteration(), sortVectorContainers(), and g2o::HyperGraph::Edge::vertices().
Referenced by g2o::computeSimpleStars(), initializeOptimization(), g2o::Star::labelStarEdges(), main(), main(), main(), and g2o::G2oSlamInterface::solve().
|
virtual |
Initializes the structures for optimizing a portion of the graph specified by a subset of vertices. Before calling it be sure to invoke marginalized() and fixed() to the vertices you want to include in the schur complement or to set as fixed during the optimization.
| vset | the subgraph to be optimized. |
| level | is the level (in multilevel optimization) |
Definition at line 204 of file sparse_optimizer.cpp.
References __PRETTY_FUNCTION__, _activeEdges, _activeVertices, g2o::OptimizableGraph::_jacobianWorkspace, g2o::JacobianWorkspace::allocate(), g2o::OptimizableGraph::Edge::allVerticesFixed(), g2o::arrayHasNaN(), buildIndexMapping(), clearIndexMapping(), g2o::HyperGraph::Vertex::edges(), g2o::HyperGraph::edges(), g2o::OptimizableGraph::Vertex::estimateDimension(), G2O_WARN, g2o::OptimizableGraph::Vertex::getEstimateData(), g2o::HyperGraph::Vertex::id(), g2o::OptimizableGraph::postIteration(), g2o::OptimizableGraph::preIteration(), sortVectorContainers(), and g2o::HyperGraph::Edge::vertices().
|
virtual |
Initializes the structures for optimizing the whole graph. Before calling it be sure to invoke marginalized() and fixed() to the vertices you want to include in the schur complement or to set as fixed during the optimization.
| level | is the level (in multilevel optimization) |
Definition at line 196 of file sparse_optimizer.cpp.
References initializeOptimization(), and g2o::HyperGraph::vertices().
|
virtual |
starts one optimization run given the current configuration of the graph, and the current settings stored in the class instance. It can be called only after initializeOptimization
Reimplemented from g2o::OptimizableGraph.
Reimplemented in g2o::SparseOptimizerIncremental, and g2o::SparseOptimizerOnline.
Definition at line 381 of file sparse_optimizer.cpp.
References __PRETTY_FUNCTION__, _activeEdges, _activeVertices, _algorithm, _batchStatistics, _computeBatchStatistics, _ivMap, activeRobustChi2(), computeActiveErrors(), G2O_ERROR, G2O_WARN, g2o::get_monotonic_time(), g2o::OptimizationAlgorithm::init(), g2o::G2OBatchStatistics::iteration, g2o::G2OBatchStatistics::numEdges, g2o::G2OBatchStatistics::numVertices, g2o::OptimizableGraph::postIteration(), g2o::OptimizableGraph::preIteration(), g2o::OptimizationAlgorithm::printVerbose(), g2o::G2OBatchStatistics::setGlobalStats(), g2o::OptimizationAlgorithm::solve(), terminate(), and verbose().
Referenced by g2o::computeSimpleStars(), g2o::Star::labelStarEdges(), main(), main(), and main().
|
virtual |
pop (restore) the estimate of the active vertices from the stack
Reimplemented from g2o::OptimizableGraph.
Definition at line 626 of file sparse_optimizer.cpp.
References _activeVertices, and pop().
Referenced by pop().
|
virtual |
pop (restore) the estimate a subset of the variables from the stack
Reimplemented from g2o::OptimizableGraph.
Definition at line 552 of file sparse_optimizer.cpp.
References g2o::OptimizableGraph::pop().
| void g2o::SparseOptimizer::pop | ( | SparseOptimizer::VertexContainer & | vlist | ) |
pop (restore) the estimate a subset of the variables from the stack
Definition at line 543 of file sparse_optimizer.cpp.
Referenced by g2o::computeSimpleStars(), g2o::OptimizationAlgorithmDogleg::solve(), and g2o::OptimizationAlgorithmLevenberg::solve().
|
virtual |
push all the active vertices onto a stack
Reimplemented from g2o::OptimizableGraph.
Definition at line 624 of file sparse_optimizer.cpp.
References _activeVertices, and push().
Referenced by push().
|
virtual |
push the estimate of a subset of the variables onto a stack
Reimplemented from g2o::OptimizableGraph.
Definition at line 548 of file sparse_optimizer.cpp.
References g2o::OptimizableGraph::push().
| void g2o::SparseOptimizer::push | ( | SparseOptimizer::VertexContainer & | vlist | ) |
push the estimate of a subset of the variables onto a stack
Definition at line 538 of file sparse_optimizer.cpp.
Referenced by g2o::computeSimpleStars(), g2o::OptimizationAlgorithmDogleg::solve(), and g2o::OptimizationAlgorithmLevenberg::solve().
| bool g2o::SparseOptimizer::removeComputeErrorAction | ( | HyperGraphAction * | action | ) |
remove an action that should no longer be executed before computing the error vectors
Definition at line 620 of file sparse_optimizer.cpp.
References g2o::OptimizableGraph::_graphActions, and AT_COMPUTEACTIVERROR.
|
virtual |
Remove a vertex. If the vertex is contained in the currently active set of vertices, then the internal temporary structures are cleaned, e.g., the index mapping is erased. In case you need the index mapping for manipulating the graph, you have to store it in your own copy.
Reimplemented from g2o::HyperGraph.
Definition at line 605 of file sparse_optimizer.cpp.
References _ivMap, clearIndexMapping(), g2o::OptimizableGraph::Vertex::hessianIndex(), and g2o::HyperGraph::removeVertex().
| void g2o::SparseOptimizer::setAlgorithm | ( | OptimizationAlgorithm * | algorithm | ) |
Definition at line 563 of file sparse_optimizer.cpp.
References _algorithm, algorithm(), g2o::release(), and g2o::OptimizationAlgorithm::setOptimizer().
Referenced by g2o::allocateSolverForSclam(), g2o::SparseOptimizerIncremental::initSolver(), g2o::SparseOptimizerOnline::initSolver(), main(), main(), and main().
| void g2o::SparseOptimizer::setComputeBatchStatistics | ( | bool | computeBatchStatistics | ) |
Definition at line 461 of file sparse_optimizer.cpp.
References _batchStatistics, _computeBatchStatistics, computeBatchStatistics(), and g2o::G2OBatchStatistics::setGlobalStats().
Referenced by main().
| void g2o::SparseOptimizer::setForceStopFlag | ( | bool * | flag | ) |
sets a variable checked at every iteration to force a user stop. The iteration exits when the variable is true;
Definition at line 603 of file sparse_optimizer.cpp.
References _forceStopFlag.
Referenced by main().
|
virtual |
sets all vertices to their origin.
Definition at line 311 of file sparse_optimizer.cpp.
References g2o::OptimizableGraph::Vertex::setToOrigin(), and g2o::HyperGraph::vertices().
| void g2o::SparseOptimizer::setVerbose | ( | bool | verbose | ) |
|
inline |
Definition at line 215 of file sparse_optimizer.h.
Referenced by g2o::computeSimpleStars(), g2o::SparseOptimizerIncremental::initSolver(), g2o::SparseOptimizerOnline::initSolver(), g2o::Star::labelStarEdges(), main(), g2o::SparseOptimizerIncremental::optimize(), and g2o::SparseOptimizerOnline::optimize().
|
protected |
Definition at line 507 of file sparse_optimizer.cpp.
References _activeEdges, and _activeVertices.
Referenced by initializeOptimization(), and initializeOptimization().
|
inline |
if external stop flag is given, return its state. False otherwise
Definition at line 183 of file sparse_optimizer.h.
Referenced by optimize(), and g2o::OptimizationAlgorithmLevenberg::solve().
| void g2o::SparseOptimizer::update | ( | const double * | update | ) |
update the estimate of the active vertices
| update | the double vector containing the stacked elements of the increments on the vertices. |
Definition at line 446 of file sparse_optimizer.cpp.
References __PRETTY_FUNCTION__, _ivMap, g2o::arrayHasNaN(), g2o::OptimizableGraph::Vertex::dimension(), G2O_WARN, g2o::HyperGraph::Vertex::id(), g2o::OptimizableGraph::Vertex::oplus(), and update().
Referenced by g2o::OptimizationAlgorithmDogleg::solve(), g2o::OptimizationAlgorithmGaussNewton::solve(), g2o::OptimizationAlgorithmLevenberg::solve(), and update().
|
virtual |
HACK updating the internal structures for online processing
Reimplemented in g2o::SparseOptimizerIncremental, and g2o::SparseOptimizerOnline.
Definition at line 469 of file sparse_optimizer.cpp.
References _activeEdges, _activeVertices, _algorithm, _ivMap, g2o::OptimizableGraph::Edge::allVerticesFixed(), g2o::OptimizableGraph::Vertex::fixed(), G2O_ERROR, g2o::OptimizableGraph::Vertex::marginalized(), g2o::OptimizableGraph::Vertex::setHessianIndex(), and g2o::OptimizationAlgorithm::updateStructure().
Referenced by main(), and g2o::SparseOptimizerOnline::updateInitialization().
|
inline |
verbose information during optimization
Definition at line 172 of file sparse_optimizer.h.
Referenced by computeInitialGuess(), main(), optimize(), g2o::SparseOptimizerIncremental::optimize(), g2o::SparseOptimizerOnline::optimize(), and setVerbose().
|
friend |
Definition at line 49 of file sparse_optimizer.h.
|
protected |
sorted according to EdgeIDCompare
Definition at line 293 of file sparse_optimizer.h.
Referenced by activeChi2(), activeRobustChi2(), clear(), computeActiveErrors(), computeInitialGuess(), findActiveEdge(), initializeOptimization(), initializeOptimization(), optimize(), g2o::SparseOptimizerIncremental::optimize(), g2o::SparseOptimizerOnline::optimize(), sortVectorContainers(), updateInitialization(), and g2o::SparseOptimizerIncremental::updateInitialization().
|
protected |
sorted according to VertexIDCompare
Definition at line 292 of file sparse_optimizer.h.
Referenced by clear(), discardTop(), findActiveVertex(), initializeOptimization(), initializeOptimization(), optimize(), pop(), push(), sortVectorContainers(), updateInitialization(), and g2o::SparseOptimizerIncremental::updateInitialization().
|
protected |
Definition at line 297 of file sparse_optimizer.h.
Referenced by computeMarginals(), optimize(), g2o::SparseOptimizerIncremental::optimize(), g2o::SparseOptimizerOnline::optimize(), setAlgorithm(), updateInitialization(), g2o::SparseOptimizerIncremental::updateInitialization(), and ~SparseOptimizer().
|
protected |
global statistics of the optimizer, e.g., timing, num-non-zeros
Definition at line 307 of file sparse_optimizer.h.
Referenced by optimize(), and setComputeBatchStatistics().
|
protected |
Definition at line 309 of file sparse_optimizer.h.
Referenced by optimize(), and setComputeBatchStatistics().
|
protected |
Definition at line 288 of file sparse_optimizer.h.
Referenced by setForceStopFlag().
|
protected |
Definition at line 291 of file sparse_optimizer.h.
Referenced by buildIndexMapping(), clear(), clearIndexMapping(), optimize(), g2o::SparseOptimizerIncremental::optimize(), removeVertex(), update(), g2o::SparseOptimizerOnline::update(), updateInitialization(), and g2o::SparseOptimizerIncremental::updateInitialization().
|
protected |
Definition at line 289 of file sparse_optimizer.h.
Referenced by setVerbose().