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

Stats computation running in parallel. More...

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

Public Member Functions

 ParallelCalc (const CalcSetup &s, const T *data, int sz, const T *weights=0)
 
 ParallelCalc (const CalcSetup &s)
 
void setValues (const T *inp, int sz, const T *wght=0)
 
void setEmpty ()
 
const uiString errMsg () const
 
virtual double variance () const
 
template<>
double variance () const
 
- Public Member Functions inherited from ParallelTask
virtual ~ParallelTask ()
 
bool execute ()
 
virtual bool executeParallel (bool parallel)
 
void setProgressMeter (ProgressMeter *)
 Must be called before execute() More...
 
int64_t nrDone () const
 May be -1, i.e. class does not report nrdone. More...
 
int64_t totalNr () const
 
- Public Member Functions inherited from Task
virtual ~Task ()
 
virtual uiString uiMessage () const
 will be message() again in 7.x More...
 
virtual uiString uiNrDoneText () const
 will be nrDoneText() in 7.x More...
 
virtual void enableWorkControl (bool=true)
 Must be called before execute() More...
 
bool workControlEnabled () const
 
virtual void controlWork (Control)
 
virtual Control getState () const
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject *linkedto)
 
 NamedObject (const NamedObject &)
 
virtual ~NamedObject ()
 
void setLinkedTo (NamedObject *)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
virtual const OD::StringannotName () const
 
virtual void setName (const char *)
 
void setCleanName (const char *)
 cleans string first More...
 
void deleteNotify (const CallBack &)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
- 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
 
clipVal (float ratio, bool upper) const
 require median; 0 <= ratio <= 1 More...
 
template<>
double variance () const
 
template<>
float_complex mostFreq () const
 

Protected Member Functions

od_int64 nrIterations () const
 
bool doPrepare (int)
 
bool doWork (od_int64, od_int64, int)
 
bool doFinish (bool)
 
template<>
bool doWork (od_int64, od_int64, int)
 
template<>
bool doFinish (bool)
 
- Protected Member Functions inherited from ParallelTask
virtual int maxNrThreads () const
 
virtual int minThreadSize () const
 
virtual bool stopAllOnFailure () const
 
 ParallelTask (const char *nm=0)
 
 ParallelTask (const ParallelTask &)
 
int64_t calculateThreadSize (int64_t totalnr, int nrthreads, int thread) const
 
void addToNrDone (int64_t increment)
 
void quickAddToNrDone (int64_t loopidx)
 
void resetNrDone ()
 
- Protected Member Functions inherited from Task
 Task (const char *nm=0)
 
virtual bool shouldContinue ()
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 
- 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
 

Protected Attributes

uiString errmsg_
 
Threads::Barrier barrier_
 
const T * data_
 
const T * weights_
 
meanval_
 
meanval_w_
 
variance_
 
variance_w_
 
- Protected Attributes inherited from Task
Control control_
 
Threads::ConditionVarworkcontrolcondvar_
 
- Protected Attributes inherited from NamedObject
BufferStringname_
 
NamedObjectlinkedto_
 
CallBackSetdelnotify_
 
- 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_
 

Private Member Functions

 mODTextTranslationClass (ParallelCalc)
 

Additional Inherited Members

- Public Types inherited from Task
enum  Control { Run, Pause, Stop }
 
- Static Public Member Functions inherited from ParallelTask
static uiString sPosFinished ()
 
static uiString sTrcFinished ()
 
- Static Public Member Functions inherited from Task
static uiString stdNrDoneText ()
 
static uiString uiStdNrDoneText ()
 
- Public Attributes inherited from Stats::BaseCalc< T >
TypeSet< T > medvals_
 

Detailed Description

template<class T>
class Stats::ParallelCalc< T >

Stats computation running in parallel.

The difference with the running values (Stats::RunCalc) is that you have to pass the entire data array prior to the execution.

It also works with optional weights.

Constructor & Destructor Documentation

template<class T>
Stats::ParallelCalc< T >::ParallelCalc ( const CalcSetup s,
const T *  data,
int  sz,
const T *  weights = 0 
)
inline
template<class T>
Stats::ParallelCalc< T >::ParallelCalc ( const CalcSetup s)
inline

Member Function Documentation

template<class T >
bool Stats::ParallelCalc< T >::doFinish ( bool  success)
inlineprotectedvirtual

Called after all doWork have finished.

Parameters
successindicates whether all doWork returned true.

Reimplemented from ParallelTask.

template<>
bool Stats::ParallelCalc< float_complex >::doFinish ( bool  success)
inlineprotectedvirtual

Called after all doWork have finished.

Parameters
successindicates whether all doWork returned true.

Reimplemented from ParallelTask.

template<class T >
bool Stats::ParallelCalc< T >::doPrepare ( int  nrthreads)
inlineprotectedvirtual

Called once, before any doWork is called.

Reimplemented from ParallelTask.

template<class T >
bool Stats::ParallelCalc< T >::doWork ( od_int64  start,
od_int64  stop,
int  thread 
)
inlineprotected
template<>
bool Stats::ParallelCalc< float_complex >::doWork ( od_int64  ,
od_int64  ,
int   
)
inlineprotected
template<class T>
const uiString Stats::ParallelCalc< T >::errMsg ( ) const
inline
template<class T>
Stats::ParallelCalc< T >::mODTextTranslationClass ( ParallelCalc< T >  )
private
template<class T>
od_int64 Stats::ParallelCalc< T >::nrIterations ( ) const
inlineprotectedvirtual
Returns
the number of times the process should be run.

Implements ParallelTask.

template<class T >
void Stats::ParallelCalc< T >::setEmpty ( )
inline
template<class T>
void Stats::ParallelCalc< T >::setValues ( const T *  inp,
int  sz,
const T *  wght = 0 
)
inline
template<class T >
double Stats::ParallelCalc< T >::variance ( ) const
inlinevirtual

Reimplemented from Stats::BaseCalc< T >.

template<>
double Stats::ParallelCalc< float_complex >::variance ( ) const
inlinevirtual

Reimplemented from Stats::BaseCalc< T >.

Member Data Documentation

template<class T>
Threads::Barrier Stats::ParallelCalc< T >::barrier_
mutableprotected
template<class T>
const T* Stats::ParallelCalc< T >::data_
protected
template<class T>
uiString Stats::ParallelCalc< T >::errmsg_
protected
template<class T>
T Stats::ParallelCalc< T >::meanval_
protected
template<class T>
T Stats::ParallelCalc< T >::meanval_w_
protected
template<class T>
T Stats::ParallelCalc< T >::variance_
protected
template<class T>
T Stats::ParallelCalc< T >::variance_w_
protected
template<class T>
const T* Stats::ParallelCalc< T >::weights_
protected

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