Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cValueStatsRate< TYPE > Class Template Reference

#include <cValueStats.h>

Inheritance diagram for GrayLib::cValueStatsRate< TYPE >:
GrayLib::cValueStats< double > GrayLib::cValueRange< double > Gray::cRangeT< TYPE >

Public Member Functions

 cValueStatsRate (TYPE nValAvgEst=0, UINT uSamplesMax=cTimeSys::k_FREQ)
 
void ResetStatsTime ()
 
bool AddStat (TYPE nVal)
 
bool AddStatDiff (TYPE nVal)
 
bool AddStatDiffX (TYPE nVal)
 
 UNITTEST2_PREDEF (cValueStats)
 
- Public Member Functions inherited from GrayLib::cValueStats< double >
 cValueStats (double nValAvgStartingEst=0, UINT uSamplesMax=100)
 
double get_ValAvg () const
 
void put_ValAvg (double nValAvg)
 
void AddStat (double nVal)
 
- Public Member Functions inherited from GrayLib::cValueRange< double >
 cValueRange (double tLo=cTypeLimit< double >::k_Min, double tHi=cTypeLimit< double >::k_Min)
 
void InitX (double nVal=cTypeLimit< double >::k_Min)
 
bool isRangeValid () const
 
double GetLinearX (double nVal2, double nRange2) const
 
double GetLinearI (int nVal2, int nRange2=1000) const
 
- Public Member Functions inherited from Gray::cRangeT< TYPE >
TYPE get_Min () const
 
TYPE get_Max () const
 
TYPE get_Avg () const
 
TYPE GetClampValue (TYPE nVal) const
 
bool IsInsideI (TYPE nVal) const
 
bool IsInsideX (TYPE nVal) const
 
TYPE get_RangeI () const
 
TYPE get_RangeX () const
 
TYPE GetLinear1 (float fOne) const
 
int GetSpinValueI (int iVal) const
 
void SetZero ()
 
void put_Min (TYPE iLo)
 
void put_Max (TYPE iHi)
 
void SetRange (TYPE iLo, TYPE iHi)
 
void NormalizeRange ()
 
void UnionValue (TYPE nVal)
 
bool IsRangeOverlapI (const THIS_t &x) const
 
void SetUnionRange (const THIS_t &x)
 

Additional Inherited Members

- Public Attributes inherited from Gray::cRangeT< TYPE >
TYPE m_Lo
 low range value. More...
 
TYPE m_Hi
 inclusive high side of range. int size = (hi-lo)+1, float size = hi-lo ?? weird. More...
 
- Protected Member Functions inherited from GrayLib::cValueStats< double >
void AddStatW (double nVal, double nWeight)
 
- Protected Attributes inherited from GrayLib::cValueStats< double >
const UINT m_uSamplesMax
 average is calculated over n samples. More...
 
UINT m_uSamplesQty
 current number of samples I have processed. for AddStat(). More...
 
double m_nValAvg
 running average. More...
 

Detailed Description

template<typename TYPE = double>
class GrayLib::cValueStatsRate< TYPE >

Calculate a average of a number over time. m_nValAvg = per second average. Add stats at an arbitrary time rate. Can be used as a rate of change as well using Diff. uSamplesMax = the average window size in seconds. ASSUME TYPE = double or float.

Constructor & Destructor Documentation

◆ cValueStatsRate()

template<typename TYPE = double>
GrayLib::cValueStatsRate< TYPE >::cValueStatsRate ( TYPE  nValAvgEst = 0,
UINT  uSamplesMax = cTimeSys::k_FREQ 
)
inline
  • uSamplesMax = default is to average over 1 second

Member Function Documentation

◆ AddStat()

template<typename TYPE = double>
bool GrayLib::cValueStatsRate< TYPE >::AddStat ( TYPE  nVal)
inline

Add stats at an arbitrary time rate. update m_nValAvg. (per second average change)

◆ AddStatDiff()

template<typename TYPE = double>
bool GrayLib::cValueStatsRate< TYPE >::AddStatDiff ( TYPE  nVal)
inline

Add stats at an arbitrary time rate. Add diff from cumulative total.

◆ AddStatDiffX()

template<typename TYPE = double>
bool GrayLib::cValueStatsRate< TYPE >::AddStatDiffX ( TYPE  nVal)
inline

Add diff from nVal as cumulative total. Watch for nVal wrapping around.

◆ ResetStatsTime()

template<typename TYPE = double>
void GrayLib::cValueStatsRate< TYPE >::ResetStatsTime ( )
inline

◆ UNITTEST2_PREDEF()

template<typename TYPE = double>
GrayLib::cValueStatsRate< TYPE >::UNITTEST2_PREDEF ( cValueStats  )

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