21 #ifndef BASIC_DATA_CALCULATORS_H
22 #define BASIC_DATA_CALCULATORS_H
37 template <
typename T = u
int32_t>
118 template <
typename T>
128 m_varianceCurr =
NaN;
134 template <
typename T>
138 template <
typename T>
146 template <
typename T>
154 m_squareTotal += i*i;
195 m_varianceCurr = m_sCurr;
200 m_meanPrev = m_meanCurr;
204 m_meanCurr = m_meanPrev + (i - m_meanPrev) / m_count;
205 m_sCurr = m_sPrev + (i - m_meanPrev) * (i - m_meanCurr);
206 m_varianceCurr = m_sCurr / (m_count - 1);
212 template <
typename T>
223 m_varianceCurr =
NaN;
230 template <
typename T>
246 template <
typename T = u
int32_t>
284 template <
typename T>
290 template <
typename T>
294 template <
typename T>
302 template <
typename T>
312 template <
typename T>
322 template <
typename T>
330 template <
typename T>
double getSum() const
Returns the sum.
Abstract class for calculating statistical data.
double getMax() const
Returns the maximum value.
T m_min
Minimum value of MinMaxAvgTotalCalculator.
double getMin() const
Returns the minimum value.
T GetCount() const
Returns the count of the CounterCalculator.
T m_total
Total value of MinMaxAvgTotalCalculator.
double getSqrSum() const
Returns the sum of squares.
virtual ~MinMaxAvgTotalCalculator()
double getVariance() const
Returns the current variance.
virtual void Output(DataOutputCallback &callback) const
Outputs data based on the provided callback.
void Reset()
Reinitializes all variables of MinMaxAvgTotalCalculator.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
MinMaxAvgTotalCalculator()
const double NaN
Stored representation of NaN.
T m_count
Count value of CounterCalculator.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Template class MinMaxAvgTotalCalculator.
double m_meanPrev
Previous mean of MinMaxAvgTotalCalculator.
double m_meanCurr
Current mean of MinMaxAvgTotalCalculator.
Callback class for the DataOutput classes.
void Update(const T i)
Updates all variables of MinMaxAvgTotalCalculator.
double getStddev() const
Returns the standard deviation.
double m_varianceCurr
Current variance of MinMaxAvgTotalCalculator.
double m_sPrev
Previous s of MinMaxAvgTotalCalculator.
Calculates data during a simulation.
T m_max
Maximum value of MinMaxAvgTotalCalculator.
void Update()
Increments count by 1.
double getMean() const
Returns the mean value.
virtual void Output(DataOutputCallback &callback) const
Outputs the data based on the provided callback.
virtual void OutputStatistic(std::string key, std::string variable, const StatisticalSummary *statSum)=0
Outputs the data from the specified StatisticalSummary.
Template class CounterCalculator.
virtual ~CounterCalculator()
virtual void OutputSingleton(std::string key, std::string variable, int val)=0
Associates the integer value with the variable name for a specific output format. ...
T m_squareTotal
Sum of squares value of MinMaxAvgTotalCalculator.
double m_sCurr
Current s of MinMaxAvgTotalCalculator.
long getCount() const
Returns the count.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
uint32_t m_count
Count value of MinMaxAvgTotalCalculator.