OpendTect  7.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Stats::BaseCalc< T > Class Template Reference

Base class to calculate mean, min, max, etc.. can be used either as running values (Stats::RunCalc) or in parallel (Stats::ParallelCalc). More...

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

Public Member Functions

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

 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)
 

Protected Attributes

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::BaseCalc< T >

Base class to calculate mean, min, max, etc.. can be used either as running values (Stats::RunCalc) or in parallel (Stats::ParallelCalc).

The mostFrequent assumes the data contains integer classes. Then the class that is found most often will be the output. Weighting, again, assumes integer values. Beware that if you pass data that is not really class-data, the memory consumption can become large (and the result will be rather uninteresting).

The variance won't take the decreasing degrees of freedom into consideration when weights are provided.

The object is ready to use with int, float and double types. If other types are needed, you may need to specialize an isZero function for each new type.

Constructor & Destructor Documentation

◆ ~BaseCalc()

template<class T >
virtual Stats::BaseCalc< T >::~BaseCalc ( )
inlinevirtual

◆ BaseCalc()

template<class T >
Stats::BaseCalc< T >::BaseCalc ( const CalcSetup s)
inlineprotected

Member Function Documentation

◆ average()

template<class T >
double Stats::BaseCalc< T >::average
inline

◆ clear()

template<class T >
void Stats::BaseCalc< T >::clear
inline

◆ clipVal()

template<class T >
T Stats::BaseCalc< T >::clipVal ( float  ratio,
bool  upper 
) const
inline

requires sort; 0 <= ratio <= 1

◆ computeMedian()

template<class T >
T Stats::BaseCalc< T >::computeMedian ( idx_type *  index_of_median = nullptr) const
inlineprotected

◆ computeWeightedMedian()

template<class T >
T Stats::BaseCalc< T >::computeWeightedMedian ( idx_type *  index_of_median = nullptr) const
inlineprotected

◆ count()

template<class T >
size_type Stats::BaseCalc< T >::count ( ) const
inline

◆ extreme()

template<class T >
T Stats::BaseCalc< T >::extreme ( idx_type *  index_of_extr = 0) const
inline

◆ getIndex()

template<class T >
CalcSetup::idx_type Stats::BaseCalc< T >::getIndex ( Type  t) const
inline

only for Median, Min and Max

◆ getValue()

template<class T >
double Stats::BaseCalc< T >::getValue ( Stats::Type  t) const
inline

◆ hasUndefs()

template<class T >
bool Stats::BaseCalc< T >::hasUndefs ( ) const
inline

◆ isEmpty()

template<class T >
bool Stats::BaseCalc< T >::isEmpty ( ) const
inline

◆ isWeighted()

template<class T >
bool Stats::BaseCalc< T >::isWeighted ( ) const
inline

◆ isZero() [1/3]

bool Stats::BaseCalc< double >::isZero ( const double &  val) const
inlineprotected

◆ isZero() [2/3]

bool Stats::BaseCalc< float >::isZero ( const float &  val) const
inlineprotected

◆ isZero() [3/3]

template<class T >
bool Stats::BaseCalc< T >::isZero ( const T &  val) const
inlineprotected

◆ max()

template<class T >
T Stats::BaseCalc< T >::max ( idx_type *  index_of_max = 0) const
inline

◆ median()

template<class T >
T Stats::BaseCalc< T >::median ( idx_type *  index_of_median = 0) const
inline

◆ medValsArr()

template<class T >
const T* Stats::BaseCalc< T >::medValsArr ( ) const
inline

◆ min()

template<class T >
T Stats::BaseCalc< T >::min ( idx_type *  index_of_min = 0) const
inline

◆ mostFreq() [1/2]

template<class T >
T Stats::BaseCalc< T >::mostFreq
inline

◆ mostFreq() [2/2]

float_complex Stats::BaseCalc< float_complex >::mostFreq ( ) const
inline

◆ mUseType() [1/2]

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

◆ mUseType() [2/2]

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

◆ normvariance()

template<class T >
double Stats::BaseCalc< T >::normvariance
inline

◆ rms()

template<class T >
double Stats::BaseCalc< T >::rms
inline

◆ setup()

template<class T >
const CalcSetup& Stats::BaseCalc< T >::setup ( ) const
inline

◆ size()

template<class T >
size_type Stats::BaseCalc< T >::size ( bool  used = true) const
inline

◆ sort() [1/2]

const float_complex * Stats::BaseCalc< float_complex >::sort ( idx_type *  idx_of_med)
inlineprotected

◆ sort() [2/2]

template<class T >
const T * Stats::BaseCalc< T >::sort ( idx_type *  index_of_median = nullptr)
inlineprotectedvirtual

◆ sqSum()

template<class T >
T Stats::BaseCalc< T >::sqSum
inline

◆ stdDev()

template<class T >
double Stats::BaseCalc< T >::stdDev
inline

◆ sum()

template<class T >
T Stats::BaseCalc< T >::sum
inline

◆ variance() [1/2]

template<class T >
double Stats::BaseCalc< T >::variance
inlinevirtual

◆ variance() [2/2]

double Stats::BaseCalc< float_complex >::variance ( ) const
inline

Member Data Documentation

◆ clss_

template<class T >
LargeValVec<idx_type> Stats::BaseCalc< T >::clss_
protected

◆ clsswt_

template<class T >
LargeValVec<T> Stats::BaseCalc< T >::clsswt_
protected

◆ issorted_

template<class T >
bool Stats::BaseCalc< T >::issorted_ = false
protected

◆ maxidx_

template<class T >
idx_type Stats::BaseCalc< T >::maxidx_
protected

◆ maxval_

template<class T >
T Stats::BaseCalc< T >::maxval_
protected

◆ medidxs_

template<class T >
LargeValVec<idx_type> Stats::BaseCalc< T >::medidxs_
protected

◆ medvals_

template<class T >
LargeValVec<T> Stats::BaseCalc< T >::medvals_
protected

◆ medwts_

template<class T >
LargeValVec<T> Stats::BaseCalc< T >::medwts_
protected

◆ minidx_

template<class T >
idx_type Stats::BaseCalc< T >::minidx_
protected

◆ minval_

template<class T >
T Stats::BaseCalc< T >::minval_
protected

◆ nradded_

template<class T >
size_type Stats::BaseCalc< T >::nradded_
protected

◆ nrused_

template<class T >
Threads::Atomic<size_type> Stats::BaseCalc< T >::nrused_
protected

◆ setup_

template<class T >
CalcSetup Stats::BaseCalc< T >::setup_
protected

◆ sum_w_

template<class T >
T Stats::BaseCalc< T >::sum_w_
protected

◆ sum_wx_

template<class T >
T Stats::BaseCalc< T >::sum_wx_
protected

◆ sum_wxx_

template<class T >
T Stats::BaseCalc< T >::sum_wxx_
protected

◆ sum_x_

template<class T >
T Stats::BaseCalc< T >::sum_x_
protected

◆ sum_xx_

template<class T >
T Stats::BaseCalc< T >::sum_xx_
protected

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