triskele/include/TreeStats.hpp
Git Merciol c8714ca77a nouveau fichier : include/TreeStats.hpp
nouveau fichier : include/TreeStats.tpp
	nouveau fichier : src/TreeStats.cpp
2018-02-26 13:50:36 +01:00

68 lines
1.9 KiB
C++

#ifndef _OTB_TRISKELE_TREE_STATS_HPP
#define _OTB_TRISKELE_TREE_STATS_HPP
#include <iostream>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/sum.hpp>
#include <boost/accumulators/statistics/count.hpp>
#include <boost/accumulators/statistics/min.hpp>
#include <boost/accumulators/statistics/max.hpp>
#include <boost/accumulators/statistics/mean.hpp>
#include "ArrayTree/triskeleArrayTreeBase.hpp"
namespace otb {
namespace triskele {
using namespace otb::triskele::arrayTree;
using namespace std;
namespace ba = boost::accumulators;
typedef ba::accumulator_set<DimImg, ba::stats<ba::tag::count,
ba::tag::mean,
ba::tag::min,
ba::tag::max> > TreeStatsDim;
typedef ba::accumulator_set<double, ba::stats<ba::tag::sum,
ba::tag::count,
ba::tag::mean,
ba::tag::min,
ba::tag::max> > TreeStatsDouble;
enum statsIdxType {
buildTreeStats,
areaStats,
averageStats,
xyStats,
moiStats,
sdStats,
filteringStats,
copyImageStats,
readStats,
writeStats,
allStats,
statsIdxTypeCount
};
class TreeStats {
public :
//void reset ();
inline void addDim (const treeType &type, const DimImg& leafCount, const DimImg& compCount);
inline void addTime (const statsIdxType &type, const double &duration);
ostream &printDim (ostream &out);
ostream &printTime (ostream &out);
private :
ostream &printDim (ostream &out, const TreeStatsDim stats[], const string &msg);
TreeStatsDim leavesStats[treeTypeCount], compStats[treeTypeCount];
TreeStatsDouble timeStats[statsIdxTypeCount];
};
static TreeStats globalTreeStats;
#include "TreeStats.tpp"
} // triskele
} // otb
#endif // _OTB_TRISKELE_TREE_HPP