queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
ANNsampStat Class Reference

#include <ANNperf.h>

Public Member Functions

void reset ()
 
 ANNsampStat ()
 
void operator+= (double x)
 
int samples ()
 
double mean ()
 
double stdDev ()
 
double min ()
 
double max ()
 

Private Attributes

int n
 
double sum
 
double sum2
 
double minVal
 
double maxVal
 

Detailed Description

Definition at line 85 of file ANNperf.h.

Constructor & Destructor Documentation

ANNsampStat::ANNsampStat ( )
inline

Definition at line 99 of file ANNperf.h.

99 { reset(); } // constructor
void reset()
Definition: ANNperf.h:91

Member Function Documentation

double ANNsampStat::max ( )
inline

Definition at line 116 of file ANNperf.h.

Referenced by print_one_stat().

116 { return maxVal; } // maximum
double maxVal
Definition: ANNperf.h:89
double ANNsampStat::mean ( )
inline

Definition at line 110 of file ANNperf.h.

Referenced by print_one_stat().

110 { return sum/n; } // mean
double sum
Definition: ANNperf.h:87
double ANNsampStat::min ( )
inline

Definition at line 115 of file ANNperf.h.

Referenced by print_one_stat().

115 { return minVal; } // minimum
double minVal
Definition: ANNperf.h:89
void ANNsampStat::operator+= ( double  x)
inline

Definition at line 101 of file ANNperf.h.

102  {
103  n++; sum += x; sum2 += x*x;
104  if (x < minVal) minVal = x;
105  if (x > maxVal) maxVal = x;
106  }
double minVal
Definition: ANNperf.h:89
double maxVal
Definition: ANNperf.h:89
double sum
Definition: ANNperf.h:87
double sum2
Definition: ANNperf.h:88
void ANNsampStat::reset ( )
inline

Definition at line 91 of file ANNperf.h.

References ANN_DBL_MAX.

Referenced by annResetStats().

92  {
93  n = 0;
94  sum = sum2 = 0;
97  }
double minVal
Definition: ANNperf.h:89
double maxVal
Definition: ANNperf.h:89
const double ANN_DBL_MAX
Definition: ANN.h:114
double sum
Definition: ANNperf.h:87
double sum2
Definition: ANNperf.h:88
int ANNsampStat::samples ( )
inline

Definition at line 108 of file ANNperf.h.

108 { return n; } // number of samples
double ANNsampStat::stdDev ( )
inline

Definition at line 113 of file ANNperf.h.

Referenced by print_one_stat().

113 { return sqrt((sum2 - (sum*sum)/n)/(n-1));}
double sum
Definition: ANNperf.h:87
double sum2
Definition: ANNperf.h:88

Member Data Documentation

double ANNsampStat::maxVal
private

Definition at line 89 of file ANNperf.h.

double ANNsampStat::minVal
private

Definition at line 89 of file ANNperf.h.

int ANNsampStat::n
private

Definition at line 86 of file ANNperf.h.

double ANNsampStat::sum
private

Definition at line 87 of file ANNperf.h.

double ANNsampStat::sum2
private

Definition at line 88 of file ANNperf.h.


The documentation for this class was generated from the following file:

Generated on Tue Jun 5 2018 19:48:57 for queso-0.57.1 by  doxygen 1.8.5