OpendTect-6_4  6.4
Public Member Functions | Public Attributes | 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 ()
 
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
 

Public Attributes

TypeSet< T > medvals_
 

Protected Member Functions

 BaseCalc (const CalcSetup &s)
 
bool isZero (const T &t) const
 
template<>
bool isZero (const float &val) const
 
template<>
bool isZero (const double &val) const
 

Protected Attributes

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

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

Member Function Documentation

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

require median; 0 <= ratio <= 1

template<class T >
int Stats::BaseCalc< T >::count ( ) const
inline
template<class T >
T Stats::BaseCalc< T >::extreme ( int *  index_of_extr = 0) const
inline
template<class T >
int Stats::BaseCalc< T >::getIndex ( Type  t) const
inline

only for Median, Min and Max

template<class T >
double Stats::BaseCalc< T >::getValue ( Stats::Type  t) const
inline
template<class T >
bool Stats::BaseCalc< T >::hasUndefs ( ) const
inline
template<class T >
bool Stats::BaseCalc< T >::isEmpty ( ) const
inline
template<class T >
bool Stats::BaseCalc< T >::isWeighted ( ) const
inline
template<class T >
bool Stats::BaseCalc< T >::isZero ( const T &  t) const
inlineprotected
template<>
bool Stats::BaseCalc< float >::isZero ( const float &  val) const
inlineprotected
template<>
bool Stats::BaseCalc< double >::isZero ( const double &  val) const
inlineprotected
template<class T >
T Stats::BaseCalc< T >::max ( int *  index_of_max = 0) const
inline
template<class T >
T Stats::BaseCalc< T >::median ( int *  index_of_median = 0) const
inline
template<class T >
T Stats::BaseCalc< T >::min ( int *  index_of_min = 0) const
inline
template<class T >
T Stats::BaseCalc< T >::mostFreq ( ) const
inline
template<>
float_complex Stats::BaseCalc< float_complex >::mostFreq ( ) const
inline
template<class T >
double Stats::BaseCalc< T >::normvariance ( ) const
inline
template<class T >
double Stats::BaseCalc< T >::rms ( ) const
inline
template<class T >
const CalcSetup& Stats::BaseCalc< T >::setup ( ) const
inline
template<class T >
int Stats::BaseCalc< T >::size ( bool  used = true) const
inline
template<class T >
T Stats::BaseCalc< T >::sqSum ( ) const
inline
template<class T >
double Stats::BaseCalc< T >::stdDev ( ) const
inline
template<class T >
T Stats::BaseCalc< T >::sum ( ) const
inline
template<class T >
double Stats::BaseCalc< T >::variance ( ) const
inlinevirtual
template<>
double Stats::BaseCalc< float_complex >::variance ( ) const
inline

Member Data Documentation

template<class T >
TypeSet<int> Stats::BaseCalc< T >::clss_
protected
template<class T >
TypeSet<T> Stats::BaseCalc< T >::clsswt_
protected
template<class T >
int Stats::BaseCalc< T >::maxidx_
protected
template<class T >
T Stats::BaseCalc< T >::maxval_
protected
template<class T >
TypeSet<T> Stats::BaseCalc< T >::medvals_
template<class T >
TypeSet<T> Stats::BaseCalc< T >::medwts_
protected
template<class T >
int Stats::BaseCalc< T >::minidx_
protected
template<class T >
T Stats::BaseCalc< T >::minval_
protected
template<class T >
int Stats::BaseCalc< T >::nradded_
protected
template<class T >
int Stats::BaseCalc< T >::nrused_
protected
template<class T >
CalcSetup Stats::BaseCalc< T >::setup_
protected
template<class T >
T Stats::BaseCalc< T >::sum_w_
protected
template<class T >
T Stats::BaseCalc< T >::sum_wx_
protected
template<class T >
T Stats::BaseCalc< T >::sum_wxx_
protected
template<class T >
T Stats::BaseCalc< T >::sum_x_
protected
template<class T >
T Stats::BaseCalc< T >::sum_xx_
protected

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