27 #ifndef G2O_GRAPH_OPTIMIZER_CHOL_H_ 28 #define G2O_GRAPH_OPTIMIZER_CHOL_H_ 30 #include "../stuff/macros.h" 41 class ActivePathCostFunction;
42 class OptimizationAlgorithm;
43 class EstimatePropagatorCost;
121 int optimize(
int iterations,
bool online =
false);
139 if (vertex->hessianIndex() < 0) {
142 std::vector<std::pair<int, int> > index;
143 index.push_back(std::pair<int, int>(vertex->hessianIndex(), vertex->hessianIndex()));
154 std::vector<std::pair<int, int> > indices;
155 for (VertexContainer::const_iterator it = vertices.begin(); it != vertices.end(); ++it) {
156 indices.push_back(std::pair<int, int>((*it)->hessianIndex(),(*it)->hessianIndex()));
245 virtual void clear();
double activeChi2() const
double activeRobustChi2() const
virtual bool updateInitialization(HyperGraph::VertexSet &vset, HyperGraph::EdgeSet &eset)
virtual void computeInitialGuess()
std::vector< OptimizableGraph::Vertex * > VertexContainer
vector container for vertices
bool terminate()
if external stop flag is given, return its state. False otherwise
const OptimizationAlgorithm * algorithm() const
the solver used by the optimizer
VertexContainer _activeVertices
sorted according to VertexIDCompare
virtual ~SparseOptimizer()
const VertexIDMap & vertices() const
std::vector< Vertex * > VertexContainer
void setComputeBatchStatistics(bool computeBatchStatistics)
bool removeComputeErrorAction(HyperGraphAction *action)
remove an action that should no longer be execured before computing the error vectors ...
const EdgeContainer & activeEdges() const
the edges active in the current optimization
std::set< Vertex * > VertexSet
int optimize(int iterations, bool online=false)
bool verbose() const
verbose information during optimization
OptimizationAlgorithm * solver()
bool computeMarginals(SparseBlockMatrix< MatrixXd > &spinv, const VertexContainer &vertices)
bool computeBatchStatistics() const
void computeActiveErrors()
virtual void setToOrigin()
Vertex * vertex(int id)
returns the vertex number id appropriately casted
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
const VertexContainer & activeVertices() const
the vertices active in the current optimization
std::vector< OptimizableGraph::Edge * > EdgeContainer
vector container for edges
std::set< Edge * > EdgeSet
virtual Vertex * findGauge()
finds a gauge in the graph to remove the undefined dof.
const BatchStatisticsContainer & batchStatistics() const
virtual bool removeVertex(HyperGraph::Vertex *v)
void setVerbose(bool verbose)
bool computeMarginals(SparseBlockMatrix< MatrixXd > &spinv, const std::vector< std::pair< int, int > > &blockIndices)
void setForceStopFlag(bool *flag)
void setAlgorithm(OptimizationAlgorithm *algorithm)
BatchStatisticsContainer _batchStatistics
global statistics of the optimizer, e.g., timing, num-non-zeros
void push()
push all the active vertices onto a stack
EdgeContainer _activeEdges
sorted according to EdgeIDCompare
cost for traversing along active edges in the optimizer
friend class ActivePathCostFunction
BatchStatisticsContainer & batchStatistics()
bool buildIndexMapping(SparseOptimizer::VertexContainer &vlist)
void pop()
pop (restore) the estimate of the active vertices from the stack
void sortVectorContainers()
bool _computeBatchStatistics
A general case Vertex for optimization.
bool addComputeErrorAction(HyperGraphAction *action)
add an action to be executed before the error vectors are computed
abstract Vertex, your types must derive from that one
#define G2O_ATTRIBUTE_DEPRECATED(func)
void discardTop()
same as above, but for the active vertices
bool * forceStopFlag() const
virtual void discardTop()
discard the last backup of the estimate for all variables by removing it from the stack ...
virtual bool initializeOptimization(HyperGraph::EdgeSet &eset)
Generic interface for a non-linear solver operating on a graph.
EdgeContainer::const_iterator findActiveEdge(const OptimizableGraph::Edge *e) const
const VertexContainer & indexMapping() const
the index mapping of the vertices
VertexContainer::const_iterator findActiveVertex(const OptimizableGraph::Vertex *v) const
std::vector< G2OBatchStatistics > BatchStatisticsContainer
Sparse matrix which uses blocks.
OptimizationAlgorithm * _algorithm
Abstract action that operates on an entire graph.
bool computeMarginals(SparseBlockMatrix< MatrixXd > &spinv, const Vertex *vertex)