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

Protected Member Functions

void setMostFrequent (float_complex val, float_complex wt)
 
void setMostFrequent (T val, T wt)
 
- Protected Member Functions inherited from Stats::BaseCalc< T >
 BaseCalc (const CalcSetup &s)
 
computeMedian (idx_type *index_of_median=nullptr) const
 
computeWeightedMedian (idx_type *index_of_median=nullptr) const
 
bool isZero (const double &val) const
 
bool isZero (const float &val) const
 
bool isZero (const T &) const
 
const float_complex * sort (idx_type *idx_of_med)
 
virtual const T * sort (idx_type *index_of_median=nullptr)
 

Additional Inherited Members

- Protected Attributes inherited from Stats::BaseCalc< T >
LargeValVec< idx_type > clss_
 
LargeValVec< T > clsswt_
 
bool issorted_ = false
 
idx_type maxidx_
 
maxval_
 
LargeValVec< idx_type > medidxs_
 
LargeValVec< T > medvals_
 
LargeValVec< T > medwts_
 
idx_type minidx_
 
minval_
 
size_type nradded_
 
Threads::Atomic< size_type > nrused_
 
CalcSetup setup_
 
sum_w_
 
sum_wx_
 
sum_wxx_
 
sum_x_
 
sum_xx_
 

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

◆ RunCalc()

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

Member Function Documentation

◆ addValue()

template<class T >
RunCalc< T > & Stats::RunCalc< T >::addValue ( data,
weight = 1 
)
inline

◆ addValues()

template<class T >
RunCalc< T > & Stats::RunCalc< T >::addValues ( size_type  sz,
const T *  data,
const T *  weights = 0 
)
inline

◆ mUseType() [1/2]

template<class T >
Stats::RunCalc< T >::mUseType ( CalcSetup  ,
idx_type   
)

◆ mUseType() [2/2]

template<class T >
Stats::RunCalc< T >::mUseType ( CalcSetup  ,
size_type   
)

◆ operator+=()

template<class T >
RunCalc<T>& Stats::RunCalc< T >::operator+= ( t)
inline

◆ removeValue()

template<class T >
RunCalc< T > & Stats::RunCalc< T >::removeValue ( data,
weight = 1 
)
inline

◆ replaceValue()

template<class T >
RunCalc< T > & Stats::RunCalc< T >::replaceValue ( olddata,
newdata,
wt = 1 
)
inline

◆ setMostFrequent() [1/2]

void Stats::RunCalc< float_complex >::setMostFrequent ( float_complex  val,
float_complex  wt 
)
inlineprotected

◆ setMostFrequent() [2/2]

template<class T >
void Stats::RunCalc< T >::setMostFrequent ( val,
wt 
)
inlineprotected

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