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();
virtual bool updateInitialization(HyperGraph::VertexSet &vset, HyperGraph::EdgeSet &eset)
virtual void computeInitialGuess()
const BatchStatisticsContainer & batchStatistics() const
std::vector< OptimizableGraph::Vertex * > VertexContainer
vector container for vertices
bool terminate()
if external stop flag is given, return its state. False otherwise
VertexContainer _activeVertices
sorted according to VertexIDCompare
virtual ~SparseOptimizer()
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 ...
std::set< Vertex * > VertexSet
int optimize(int iterations, bool online=false)
OptimizationAlgorithm * solver()
bool computeMarginals(SparseBlockMatrix< MatrixXd > &spinv, const VertexContainer &vertices)
const EdgeContainer & activeEdges() const
the edges active in the current optimization
void computeActiveErrors()
virtual void setToOrigin()
const VertexIDMap & vertices() const
Vertex * vertex(int id)
returns the vertex number id appropriately casted
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
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.
virtual bool removeVertex(HyperGraph::Vertex *v)
void setVerbose(bool verbose)
bool computeMarginals(SparseBlockMatrix< MatrixXd > &spinv, const std::vector< std::pair< int, int > > &blockIndices)
VertexContainer::const_iterator findActiveVertex(const OptimizableGraph::Vertex *v) const
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
const VertexContainer & indexMapping() const
the index mapping of the vertices
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
bool computeBatchStatistics() const
bool * forceStopFlag() const
EdgeContainer::const_iterator findActiveEdge(const OptimizableGraph::Edge *e) const
#define G2O_ATTRIBUTE_DEPRECATED(func)
const VertexContainer & activeVertices() const
the vertices active in the current optimization
double activeRobustChi2() const
void discardTop()
same as above, but for the active vertices
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.
bool verbose() const
verbose information during optimization
const OptimizationAlgorithm * algorithm() const
the solver used by the optimizer
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)
double activeChi2() const