OpendTect-6_4  6.4
Public Member Functions | Protected Member Functions | List of all members
Stats::RunCalc< T > Class Template Reference

Calculates mean, min, max etc., as running values. More...

Inheritance diagram for Stats::RunCalc< T >:
[legend]

Public Member Functions

 RunCalc (const CalcSetup &s)
 
RunCalc< T > & addValue (T data, T weight=1)
 
RunCalc< T > & addValues (int sz, const T *data, const T *weights=0)
 
RunCalc< T > & replaceValue (T olddata, T newdata, T wt=1)
 
RunCalc< T > & removeValue (T data, T weight=1)
 
RunCalc< T > & operator+= (T t)
 
- Public Member Functions inherited from Stats::BaseCalc< T >
virtual ~BaseCalc ()
 
void clear ()
 
const CalcSetupsetup () const
 
bool isWeighted () const
 
double getValue (Type) const
 
int getIndex (Type) const
 only for Median, Min and Max More...
 
bool hasUndefs () const
 
int size (bool used=true) const
 
bool isEmpty () const
 
int count () const
 
double average () const
 
mostFreq () const
 
sum () const
 
min (int *index_of_min=0) const
 
max (int *index_of_max=0) const
 
extreme (int *index_of_extr=0) const
 
median (int *index_of_median=0) const
 
sqSum () const
 
double rms () const
 
double stdDev () const
 
double normvariance () const
 
virtual double variance () const
 
clipVal (float ratio, bool upper) const
 require median; 0 <= ratio <= 1 More...
 
template<>
double variance () const
 
template<>
float_complex mostFreq () const
 

Protected Member Functions

void setMostFrequent (T val, T wt)
 
template<>
void setMostFrequent (float_complex val, float_complex wt)
 
- Protected Member Functions inherited from Stats::BaseCalc< T >
 BaseCalc (const CalcSetup &s)
 
bool isZero (const T &t) const
 
template<>
bool isZero (const float &val) const
 
template<>
bool isZero (const double &val) const
 

Additional Inherited Members

- Public Attributes inherited from Stats::BaseCalc< T >
TypeSet< T > medvals_
 
- Protected Attributes inherited from Stats::BaseCalc< T >
CalcSetup setup_
 
int nradded_
 
int nrused_
 
int minidx_
 
int maxidx_
 
minval_
 
maxval_
 
sum_x_
 
sum_xx_
 
sum_w_
 
sum_wx_
 
sum_wxx_
 
TypeSet< int > clss_
 
TypeSet< T > clsswt_
 
TypeSet< T > medwts_
 

Detailed Description

template<class T>
class Stats::RunCalc< T >

Calculates mean, min, max etc., as running values.

The idea is that you simply add values and ask for a stat whenever needed. The clear() method resets the object and makes it able to work with new data.

Adding values can be doing with weight (addValue) or without (operator +=). You can remove a value; for Min or Max this has no effect as this would require buffering all data.

Constructor & Destructor Documentation

template<class T>
Stats::RunCalc< T >::RunCalc ( const CalcSetup s)
inline

Member Function Documentation

template<class T>
RunCalc< T > & Stats::RunCalc< T >::addValue ( data,
weight = 1 
)
inline
template<class T>
RunCalc< T > & Stats::RunCalc< T >::addValues ( int  sz,
const T *  data,
const T *  weights = 0 
)
inline
template<class T>
RunCalc<T>& Stats::RunCalc< T >::operator+= ( t)
inline
template<class T>
RunCalc< T > & Stats::RunCalc< T >::removeValue ( data,
weight = 1 
)
inline
template<class T>
RunCalc< T > & Stats::RunCalc< T >::replaceValue ( olddata,
newdata,
wt = 1 
)
inline
template<class T>
void Stats::RunCalc< T >::setMostFrequent ( val,
wt 
)
inlineprotected
template<>
void Stats::RunCalc< float_complex >::setMostFrequent ( float_complex  val,
float_complex  wt 
)
inlineprotected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019