batch_stats.cpp
Go to the documentation of this file.
00001 // g2o - General Graph Optimization
00002 // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
00003 // 
00004 // g2o is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU Lesser General Public License as published
00006 // by the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 // 
00009 // g2o is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU Lesser General Public License for more details.
00013 // 
00014 // You should have received a copy of the GNU Lesser General Public License
00015 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017 #include "batch_stats.h"
00018 #include <cstring>
00019 
00020 namespace g2o {
00021   using namespace std;
00022 
00023   G2OBatchStatistics * globalStats=0;
00024 
00025   #ifndef PTHING
00026   #define PTHING(s) \
00027     #s << "= " << (st.s) << "\t "
00028   #endif
00029 
00030   G2OBatchStatistics::G2OBatchStatistics(){
00031     // zero all.
00032     memset (this, 0, sizeof(G2OBatchStatistics));
00033   }
00034 
00035   std::ostream& operator << (std::ostream& os , const G2OBatchStatistics& st)
00036   {
00037     os << PTHING(iteration);
00038 
00039     os << PTHING( numVertices ); // how many vertices are involved
00040     os << PTHING( numEdges ); // hoe many edges
00041     os << PTHING(  chi2 );  // total chi2
00042     
00044     // nonlinear part
00045     os << PTHING(  timeResiduals );  
00046     os << PTHING(  timeLinearize );   // jacobians
00047     os << PTHING(  timeQuadraticForm ); // construct the quadratic form in the graph
00048     
00049     // block_solver (constructs Ax=b, plus maybe schur);
00050     os << PTHING(  timeSchurrComplement ); // compute schurr complement (0 if not done);
00051     
00052     // linear solver (computes Ax=b); );
00053     os << PTHING(  timeSymbolicDecomposition ); // symbolic decomposition (0 if not done);
00054     os << PTHING(  timeNumericDecomposition ); // numeric decomposition  (0 if not done);
00055     os << PTHING(  timeLinearSolution );             // total time for solving Ax=b
00056     os << PTHING(  iterationsLinearSolver );  // iterations of PCG
00057     os << PTHING(  timeUpdate ); // oplus
00058     os << PTHING(  timeIteration ); // total time );
00059 
00060     os << PTHING( levenbergIterations );
00061     os << PTHING( timeLinearSolver);
00062 
00063     os << PTHING(hessianDimension);
00064     os << PTHING(hessianPoseDimension);
00065     os << PTHING(hessianLandmarkDimension);
00066     os << PTHING(choleskyNNZ);
00067     os << PTHING(timeMarginals);
00068 
00069     return os;
00070   };
00071 
00072 }


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:30:47