Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef ProcessStatistics_H
00030 #define ProcessStatistics_H
00031
00032 #include <math.h>
00033
00034 #include "StatisticalValue.h"
00035 #include "QGpCoreToolsDLLExport.h"
00036
00037 namespace QGpCoreTools {
00038
00039 class QGPCORETOOLS_EXPORT ProcessStatistics
00040 {
00041 public:
00042 ProcessStatistics() {clear();}
00043
00044 void add(double newval);
00045 void current(double& mean, double& stddev);
00046 double mean() {return _sumxi/_count;}
00047 double stddev();
00048 RealStatisticalValue value();
00049
00050 void addLog(double newval);
00051 void currentLog(double& mean, double& stddev);
00052 double meanLog() {return pow(10.0, _sumxi/_count);}
00053 double stddevLog();
00054 RealStatisticalValue valueLog();
00055
00056 void clear() {_sumxi=0.0; _sumxi2=0.0; _count=0;}
00057 int count() {return _count;}
00058 protected:
00059 double _sumxi;
00060 double _sumxi2;
00061 int _count;
00062 };
00063
00064 }
00065
00066 #endif // PROCESSSTATISTICS_H