g2o
batch_stats.h
Go to the documentation of this file.
1 // g2o - General Graph Optimization
2 // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright notice,
10 // this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above copyright
12 // notice, this list of conditions and the following disclaimer in the
13 // documentation and/or other materials provided with the distribution.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
16 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21 // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 
27 #ifndef G2O_BATCH_STATS_H_
28 #define G2O_BATCH_STATS_H_
29 
30 #include <iostream>
31 #include <vector>
32 
33 #include "g2o_core_api.h"
34 
35 namespace g2o {
36 
42  int iteration;
44  int numEdges;
45  double chi2;
46 
48  // nonlinear part
49  double timeResiduals;
50  double timeLinearize;
53  // block_solver (constructs Ax=b, plus maybe schur)
55 
56  // linear solver (computes Ax=b);
62  double timeUpdate;
63  double timeIteration;
64 
65  double timeMarginals;
66 
67  // information about the Hessian matrix
71  size_t choleskyNNZ;
72 
73  static G2OBatchStatistics* globalStats() {return _globalStats;}
74  static void setGlobalStats(G2OBatchStatistics* b);
75  protected:
76  static G2OBatchStatistics* _globalStats;
77  };
78 
79  G2O_CORE_API std::ostream& operator<<(std::ostream&, const G2OBatchStatistics&);
80 
81  typedef std::vector<G2OBatchStatistics> BatchStatisticsContainer;
82 }
83 
84 #endif
statistics about the optimization
Definition: batch_stats.h:40
int numVertices
how many vertices are involved
Definition: batch_stats.h:43
static G2OBatchStatistics * _globalStats
Definition: batch_stats.h:76
double timeIteration
total time;
Definition: batch_stats.h:63
double timeResiduals
residuals
Definition: batch_stats.h:49
int levenbergIterations
number of iterations performed by LM
Definition: batch_stats.h:52
int iteration
which iteration
Definition: batch_stats.h:42
size_t choleskyNNZ
number of non-zeros in the cholesky factor
Definition: batch_stats.h:71
size_t hessianPoseDimension
dimension of the pose matrix in Schur
Definition: batch_stats.h:69
int iterationsLinearSolver
iterations of PCG, (0 if not used, i.e., Cholesky)
Definition: batch_stats.h:61
size_t hessianLandmarkDimension
dimension of the landmark matrix in Schur
Definition: batch_stats.h:70
int numEdges
how many edges
Definition: batch_stats.h:44
static G2OBatchStatistics * globalStats()
Definition: batch_stats.h:73
double timeNumericDecomposition
numeric decomposition (0 if not done)
Definition: batch_stats.h:58
std::ostream & operator<<(std::ostream &os, const G2OBatchStatistics &st)
Definition: batch_stats.cpp:48
double timeUpdate
time to apply the update
Definition: batch_stats.h:62
double chi2
total chi2
Definition: batch_stats.h:45
size_t hessianDimension
rows / cols of the Hessian
Definition: batch_stats.h:68
double timeSchurComplement
compute schur complement (0 if not done)
Definition: batch_stats.h:54
double timeSymbolicDecomposition
symbolic decomposition (0 if not done)
Definition: batch_stats.h:57
double timeQuadraticForm
construct the quadratic form in the graph
Definition: batch_stats.h:51
double timeLinearize
jacobians
Definition: batch_stats.h:50
double timeLinearSolution
total time for solving Ax=b (including detup for schur)
Definition: batch_stats.h:59
#define G2O_CORE_API
Definition: g2o_core_api.h:29
std::vector< G2OBatchStatistics > BatchStatisticsContainer
Definition: batch_stats.h:81
double timeLinearSolver
time for solving, excluding Schur setup
Definition: batch_stats.h:60
double timeMarginals
computing the inverse elements (solve blocks) and thus the marginal covariances
Definition: batch_stats.h:65