g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
core
batch_stats.cpp
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
#include "
batch_stats.h
"
28
29
#include <cstring>
30
31
namespace
g2o
{
32
using namespace
std;
33
34
G2OBatchStatistics
*
G2OBatchStatistics::_globalStats
= 0;
35
36
#ifndef PTHING
37
#define PTHING(s) #s << "= " << (st.s) << "\t "
38
#endif
39
40
G2OBatchStatistics::G2OBatchStatistics
() {
41
// zero all.
42
memset(
this
, 0,
sizeof
(
G2OBatchStatistics
));
43
44
// set the iteration to -1 to show that it isn't valid
45
iteration
= -1;
46
}
47
48
std::ostream&
operator<<
(std::ostream& os,
const
G2OBatchStatistics
& st) {
49
os <<
PTHING
(iteration);
50
51
os <<
PTHING
(numVertices);
// how many vertices are involved
52
os <<
PTHING
(numEdges);
// hoe many edges
53
os <<
PTHING
(chi2);
// total chi2
54
56
// nonlinear part
57
os <<
PTHING
(timeResiduals);
58
os <<
PTHING
(timeLinearize);
// jacobians
59
os <<
PTHING
(timeQuadraticForm);
// construct the quadratic form in the graph
60
61
// block_solver (constructs Ax=b, plus maybe schur);
62
os <<
PTHING
(
63
timeSchurComplement);
// compute schur complement (0 if not done);
64
65
// linear solver (computes Ax=b); );
66
os <<
PTHING
(
67
timeSymbolicDecomposition);
// symbolic decomposition (0 if not done);
68
os <<
PTHING
(
69
timeNumericDecomposition);
// numeric decomposition (0 if not done);
70
os <<
PTHING
(timeLinearSolution);
// total time for solving Ax=b
71
os <<
PTHING
(iterationsLinearSolver);
// iterations of PCG
72
os <<
PTHING
(timeUpdate);
// oplus
73
os <<
PTHING
(timeIteration);
// total time );
74
75
os <<
PTHING
(levenbergIterations);
76
os <<
PTHING
(timeLinearSolver);
77
78
os <<
PTHING
(hessianDimension);
79
os <<
PTHING
(hessianPoseDimension);
80
os <<
PTHING
(hessianLandmarkDimension);
81
os <<
PTHING
(choleskyNNZ);
82
os <<
PTHING
(timeMarginals);
83
84
return
os;
85
};
86
87
void
G2OBatchStatistics::setGlobalStats
(
G2OBatchStatistics
* b) {
88
_globalStats
= b;
89
}
90
91
}
// namespace g2o
PTHING
#define PTHING(s)
Definition
batch_stats.cpp:37
batch_stats.h
g2o
Definition
dl_wrapper.cpp:55
g2o::operator<<
std::ostream & operator<<(std::ostream &os, const G2OBatchStatistics &st)
Definition
batch_stats.cpp:48
g2o::G2OBatchStatistics
statistics about the optimization
Definition
batch_stats.h:40
g2o::G2OBatchStatistics::iteration
int iteration
which iteration
Definition
batch_stats.h:42
g2o::G2OBatchStatistics::setGlobalStats
static void setGlobalStats(G2OBatchStatistics *b)
Definition
batch_stats.cpp:87
g2o::G2OBatchStatistics::G2OBatchStatistics
G2OBatchStatistics()
Definition
batch_stats.cpp:40
g2o::G2OBatchStatistics::_globalStats
static G2OBatchStatistics * _globalStats
Definition
batch_stats.h:81
Generated on
for g2o by
1.17.0