The ZX Ecosystem v5.1.0;_GUI_v3.1.0
Loading...
Searching...
No Matches
Modules | Classes | Macros
Simple statistics

Description

Statistics computed over a series of values.

http://jafma.net

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Collaboration diagram for Simple statistics:

Modules

 Overflow policies for the SimpleStats class
 

Classes

class  SSOvPol_ThrowExc< T >
 Overflow policy for SimpleStats that throws an exception if dataset is full. More...
 
class  SimpleStats< T, OverflowPolicy, MAXSIZE >
 Class that computes some statistics of a series of values of a given type. More...
 

Class Documentation

◆ SSOvPol_ThrowExc

class SSOvPol_ThrowExc
template<typename T>
class SSOvPol_ThrowExc< T >

Overflow policy for SimpleStats that throws an exception if dataset is full.

Definition at line 56 of file SimpleStatistics.h.

Public Member Functions

 SSOvPol_ThrowExc (unsigned *n)
 Default constructor. More...
 
bool full (void)
 Exception when full. More...
 

Constructor & Destructor Documentation

◆ SSOvPol_ThrowExc()

template<typename T >
SSOvPol_ThrowExc< T >::SSOvPol_ThrowExc ( unsigned *  n)
inline

Default constructor.

Definition at line 60 of file SimpleStatistics.h.

Member Function Documentation

◆ full()

template<typename T >
bool SSOvPol_ThrowExc< T >::full ( void  )
inline

Exception when full.

Definition at line 63 of file SimpleStatistics.h.

◆ SimpleStats

class SimpleStats
template<typename T, class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
class SimpleStats< T, OverflowPolicy, MAXSIZE >

Class that computes some statistics of a series of values of a given type.

Definition at line 112 of file SimpleStatistics.h.

Public Member Functions

 SimpleStats (void)
 Default constructor: an empty series. More...
 
virtual ~SimpleStats (void)
 Destructor. More...
 
void reset (void)
 Clear the series and the statistics. More...
 
void addDatum (T v)
 Add a new value to the series and recompute statistics. More...
 
unsigned sampleSize (void) const noexcept
 Return the number of values in the series. More...
 
min (void) const noexcept
 Statistic: Minimum of the series. More...
 
max (void) const noexcept
 Statistic: Maximum of the series. More...
 
avg (void) const noexcept
 Statistic: Average of the series. More...
 
std::string to_string (void) const noexcept
 Return a string that describes the statistics collected so far. More...
 

Constructor & Destructor Documentation

◆ SimpleStats()

template<typename T , class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
SimpleStats< T, OverflowPolicy, MAXSIZE >::SimpleStats ( void  )
inline

Default constructor: an empty series.

Definition at line 118 of file SimpleStatistics.h.

◆ ~SimpleStats()

template<typename T , class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
virtual SimpleStats< T, OverflowPolicy, MAXSIZE >::~SimpleStats ( void  )
inlinevirtual

Destructor.

Definition at line 123 of file SimpleStatistics.h.

Member Function Documentation

◆ reset()

template<typename T , class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
void SimpleStats< T, OverflowPolicy, MAXSIZE >::reset ( void  )
inline

Clear the series and the statistics.

Definition at line 128 of file SimpleStatistics.h.

◆ addDatum()

template<typename T , class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
void SimpleStats< T, OverflowPolicy, MAXSIZE >::addDatum ( v)
inline

Add a new value to the series and recompute statistics.

Definition at line 131 of file SimpleStatistics.h.

◆ sampleSize()

template<typename T , class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
unsigned SimpleStats< T, OverflowPolicy, MAXSIZE >::sampleSize ( void  ) const
inlinenoexcept

Return the number of values in the series.

Definition at line 151 of file SimpleStatistics.h.

◆ min()

template<typename T , class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
T SimpleStats< T, OverflowPolicy, MAXSIZE >::min ( void  ) const
inlinenoexcept

Statistic: Minimum of the series.

Definition at line 154 of file SimpleStatistics.h.

◆ max()

template<typename T , class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
T SimpleStats< T, OverflowPolicy, MAXSIZE >::max ( void  ) const
inlinenoexcept

Statistic: Maximum of the series.

Definition at line 157 of file SimpleStatistics.h.

◆ avg()

template<typename T , class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
T SimpleStats< T, OverflowPolicy, MAXSIZE >::avg ( void  ) const
inlinenoexcept

Statistic: Average of the series.

Definition at line 160 of file SimpleStatistics.h.

◆ to_string()

template<typename T , class OverflowPolicy = SSOvPol_ThrowExc<T>, unsigned MAXSIZE = std::numeric_limits<unsigned>::max()>
std::string SimpleStats< T, OverflowPolicy, MAXSIZE >::to_string ( void  ) const
inlinenoexcept

Return a string that describes the statistics collected so far.

Definition at line 163 of file SimpleStatistics.h.

Macro Definition Documentation

◆ SIMPLESTATISTICS_ELEMENT_FOR_AVOIDING_ERROR_IN_NESTING_GROUPS_IN_DOXYGEN

#define SIMPLESTATISTICS_ELEMENT_FOR_AVOIDING_ERROR_IN_NESTING_GROUPS_IN_DOXYGEN

#include <SimpleStatistics.h>

Definition at line 32 of file SimpleStatistics.h.