OpendTect  6.3
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType > Class Template Reference

Parallel task for computing the sum of element wise operations of one array and optionally a second input array. Should not be used directly, instead call getSum(const ArrayND) Template parameter SumType should be double (real or complex) for all float types. Should be od_int64 for all integer types. Template parameter OperType should be double (real) for all float types. Should be od_int64 for all integer types. More...

Inheritance diagram for ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >:
[legend]

Public Member Functions

 CumArrOperExec (const ArrayND< ArrType > &xvals, bool noudf, const ArrayOperExecSetup &setup)
 
uiString nrDoneText () const
 
uiString message () const
 
void setYVals (const ArrayND< ArrType > &yvals)
 
void setShift (SumType shift, bool forx=true)
 
void setScaler (OperType scaler, bool forx=true)
 
RetType getSum () 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 uiRetVal errorWithDetails () const
 
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 NamedCallBacker
 NamedCallBacker (const char *nm=0)
 
 NamedCallBacker (const NamedCallBacker &)
 
bool operator== (const NamedCallBacker &oth) const
 
bool operator== (const NamedObject &oth) const
 
virtual Notifier< NamedCallBacker > & objectToBeDeleted () const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
virtual bool isCapsule () const
 
void stopReceivingNotifications () const
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
virtual BufferString getName () const
 
virtual void setName (const char *nm)
 
bool getNameFromPar (const IOPar &)
 
void putNameInPar (IOPar &) const
 

Protected Member Functions

od_int64 nrIterations () const
 
- 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 NamedCallBacker
void sendDelNotif () const
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 

Private Member Functions

 mODTextTranslationClass (CumArrOperExec)
 
bool doPrepare (int nrthreads)
 
bool doWork (od_int64 start, od_int64 stop, int threadidx)
 
bool doFinish (bool success)
 

Private Attributes

const ArrayOperExecSetupsetup_
 
od_uint64 sz_
 
bool noudf_
 
Threads::Lock writelock_
 
const ArrayND< ArrType > & xarr_
 
const ArrayND< ArrType > * yarr_
 
SumType xshift_
 
SumType yshift_
 
OperType xfact_
 
OperType yfact_
 
SumType cumsum_
 
od_uint64 count_
 

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 stdMessage ()
 
static uiString stdNrDoneText ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- Protected Attributes inherited from Task
Control control_
 
Threads::ConditionVarworkcontrolcondvar_
 
- Protected Attributes inherited from NamedCallBacker
Notifier< NamedCallBackerdelnotif_
 
Threads::Atomic< bool > delalreadytriggered_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

Detailed Description

template<class ArrType, class SumType, class OperType, class RetType>
class ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >

Parallel task for computing the sum of element wise operations of one array and optionally a second input array. Should not be used directly, instead call getSum(const ArrayND) Template parameter SumType should be double (real or complex) for all float types. Should be od_int64 for all integer types. Template parameter OperType should be double (real) for all float types. Should be od_int64 for all integer types.

Constructor & Destructor Documentation

template<class ArrType, class SumType, class OperType, class RetType>
ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::CumArrOperExec ( const ArrayND< ArrType > &  xvals,
bool  noudf,
const ArrayOperExecSetup setup 
)
inline

Member Function Documentation

template<class ArrType, class SumType, class OperType, class RetType>
bool ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::doFinish ( bool  success)
inlineprivatevirtual

Called after all doWork have finished.

Parameters
successindicates whether all doWork returned true.

Reimplemented from ParallelTask.

template<class ArrType, class SumType, class OperType, class RetType>
bool ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::doPrepare ( int  nrthreads)
inlineprivatevirtual

Called once, before any doWork is called.

Reimplemented from ParallelTask.

template<class ArrType, class SumType, class OperType, class RetType>
bool ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::doWork ( od_int64  start,
od_int64  stop,
int  threadidx 
)
inlineprivate
template<class ArrType, class SumType, class OperType, class RetType>
RetType ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::getSum ( ) const
inline
template<class ArrType, class SumType, class OperType, class RetType>
uiString ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::message ( ) const
inlinevirtual

Reimplemented from Task.

template<class ArrType, class SumType, class OperType, class RetType>
ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::mODTextTranslationClass ( CumArrOperExec< ArrType, SumType, OperType, RetType >  )
private
template<class ArrType, class SumType, class OperType, class RetType>
uiString ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::nrDoneText ( ) const
inlinevirtual

Reimplemented from Task.

template<class ArrType, class SumType, class OperType, class RetType>
od_int64 ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::nrIterations ( ) const
inlineprotectedvirtual
Returns
the number of times the process should be run.

Implements ParallelTask.

template<class ArrType, class SumType, class OperType, class RetType>
void ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::setScaler ( OperType  scaler,
bool  forx = true 
)
inline
template<class ArrType, class SumType, class OperType, class RetType>
void ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::setShift ( SumType  shift,
bool  forx = true 
)
inline

Apply a scaling on the input values after exponentiation and shift (if applicable)

template<class ArrType, class SumType, class OperType, class RetType>
void ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::setYVals ( const ArrayND< ArrType > &  yvals)
inline

Apply a shift on the input values after exponentiation but before scaling (if applicable)

Member Data Documentation

template<class ArrType, class SumType, class OperType, class RetType>
od_uint64 ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::count_
private
template<class ArrType, class SumType, class OperType, class RetType>
SumType ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::cumsum_
private
template<class ArrType, class SumType, class OperType, class RetType>
bool ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::noudf_
private
template<class ArrType, class SumType, class OperType, class RetType>
const ArrayOperExecSetup& ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::setup_
private
template<class ArrType, class SumType, class OperType, class RetType>
od_uint64 ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::sz_
private
template<class ArrType, class SumType, class OperType, class RetType>
Threads::Lock ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::writelock_
private
template<class ArrType, class SumType, class OperType, class RetType>
const ArrayND<ArrType>& ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::xarr_
private
template<class ArrType, class SumType, class OperType, class RetType>
OperType ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::xfact_
private
template<class ArrType, class SumType, class OperType, class RetType>
SumType ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::xshift_
private
template<class ArrType, class SumType, class OperType, class RetType>
const ArrayND<ArrType>* ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::yarr_
private
template<class ArrType, class SumType, class OperType, class RetType>
OperType ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::yfact_
private
template<class ArrType, class SumType, class OperType, class RetType>
SumType ArrayMath::CumArrOperExec< ArrType, SumType, OperType, RetType >::yshift_
private

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