| OpendTect 8.0

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
DataDistribution< VT > Class Template Reference
Algo

Sharable data distribution. Sampling defaults to 0 step 1. More...

`#include <datadistribution.h>`

Inheritance diagram for DataDistribution< VT >:
[legend]

## Public Member Functions
| DataDistribution ()
| DataDistribution (const TypeSet< VT > &)
| DataDistribution (const TypeSet< VT > &, SamplingData< VT >)
| DataDistribution (int)
| DataDistribution (SamplingData< VT >, int n=256)
void | add (const VT *)
| fast, no checks
VT | binPos (int) const
Interval< VT > | dataRange () const
VT | get (int, bool cumulative=false) const
VT * | getArr (bool cum) const
| for fast non-shared usage
void | getAvgStd (VT &avg, VT &std) const
int | getBinNr (VT) const
TypeSet< VT > | getSet (bool cum) const
bool | isEmpty () const
bool | isNormalised () const
bool | isNormalized () const
VT | maxValue () const
| mDeclMonitorableAssignment (DataDistribution)
VT | medianPosition () const
| mImplSimpleMonitoredGetSet (inline, sampling, setSampling, SamplingData< VT >, sampling_, cSamplingChange())
VT | operator[] (int) const
VT | positionForCumulative (VT) const
void | set (const VT *)
| fast, no checks
void | set (int, VT)
| slow, O(N)
void | setEmpty ()
void | setSize (int)
int | size () const
VT | sumOfValues () const
VT | valueAt (VT, bool cumulative) const
Public Member Functions inherited from NamedMonitoredObject
| NamedMonitoredObject (const char *nm=0)
| NamedMonitoredObject (const NamedMonitoredObject &)
| NamedMonitoredObject (const NamedObject &)
virtual | ~NamedMonitoredObject ()
NamedMonitoredObject * | clone () const override
ChangeType | compareWith (const MonitoredObject &) const override
NamedMonitoredObject * | getClone () const override
BufferString | getName () const override
bool | operator!= (const NamedMonitoredObject &oth) const
NamedMonitoredObject & | operator= (const NamedMonitoredObject &)
bool | operator== (const NamedMonitoredObject &) const
void | setName (const char *) override
Public Member Functions inherited from MonitoredObject
| MonitoredObject (const MonitoredObject &)
virtual | ~MonitoredObject ()
virtual DirtyCountType | dirtyCount () const
virtual ChangeDataNotifier & | objectChanged () const
virtual Notifier< MonitoredObject > & | objectToBeDeleted () const
MonitoredObject & | operator= (const MonitoredObject &)
bool | operator== (const MonitoredObject &) const
void | sendChangeNotification (const ChangeData &) const
void | sendEntireObjectChangeNotification () const
virtual void | touch () const
void | transferNotifsTo (const MonitoredObject &, const CallBacker *onlyfor=0) 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 | detachAllNotifiers () const
| Call from the destructor of your inherited object.
void | detachCB (const NotifierAccess &, const CallBack &) const
void | detachCB (const NotifierAccess *notif, const CallBack &cb) const
virtual bool | isCapsule () const
bool | isNotifierAttached (const NotifierAccess *) const
| Only for debugging purposes, don't use.
CallBacker & | operator= (const CallBacker &)=delete
void | stopReceivingNotifications () const
virtual CallBacker * | trueCaller ()
Public Member Functions inherited from NamedObject
| NamedObject (const char *nm=nullptr)
| NamedObject (const NamedObject &oth)
virtual | ~NamedObject ()
bool | getNameFromPar (const IOPar &)
const name_type & | name () const override
NamedObject & | operator= (const NamedObject &)
bool | operator== (const NamedObject &oth) const
Public Member Functions inherited from ObjectWithName
virtual | ~ObjectWithName ()
bool | hasName (const char *nm) const
bool | hasName (const name_type &nm) const
void | putNameInPar (IOPar &) const
Public Member Functions inherited from RefCount::Referenced
void | addObserver (WeakPtrBase *obs)
| Not for normal use. May become private.
int | nrRefs () const
| Only for expert use.
void | ref () const
bool | refIfReffed () const
| Don't use in production, for debugging.
void | removeObserver (WeakPtrBase *obs)
| Not for normal use. May become private.
bool | tryRef () const
| Not for normal use. May become private.
void | unRef () const
void | unRefNoDelete () const

## Static Public Member Functions
static ChangeType | cDataChange ()
static ChangeType | cSamplingChange ()
static int | getBinNrFor (VT, const SamplingData< VT > &, int nrbins)
static const DataDistribution< VT > & | getEmptyDistrib ()
Static Public Member Functions inherited from NamedMonitoredObject
static ChangeType | cNameChange ()
static Notifier< NamedMonitoredObject > & | instanceCreated ()
Static Public Member Functions inherited from MonitoredObject
static ChangeType | cEntireObjectChange ()
static IDType | cEntireObjectChgID ()
static ChangeType | changeNotificationTypeOf (CallBacker *)
static ChangeType | cNoChange ()
static IDType | cUnspecChgID ()
static Notifier< MonitoredObject > & | instanceCreated ()
| defines static instanceCreated()
Static Public Member Functions inherited from CallBacker
static void | createReceiverForCurrentThread ()
static void | removeReceiverForCurrentThread ()
Static Public Member Functions inherited from RefCount::Referenced
static bool | isSane (const Referenced *)

## Protected Member Functions
| ~DataDistribution ()
VT | gtMax (int *idxat=0) const
void | setCumData (int)
Protected Member Functions inherited from NamedMonitoredObject
void | copyAll (const NamedMonitoredObject &)
Protected Member Functions inherited from MonitoredObject
| MonitoredObject ()
void | copyAll (const MonitoredObject &)
template<class T >
T | getMemberSimple (const T &) const
| the get function used by mImplSimpleMonitoredGet
void | resumeChangeNotifications () const
void | sendChgNotif (AccessLocker &, ChangeType, IDType) const
| calls objectChanged with released lock
void | sendChgNotif (AccessLocker &, const ChangeData &) const
| calls objectChanged with released lock
void | sendDelNotif () const
template<class TMember , class TSetTo >
void | setMemberSimple (TMember &, TSetTo, ChangeType, IDType)
| the set function used by mImplSimpleMonitoredSet
void | stopChangeNotifications () const
Protected Member Functions inherited from RefCount::Referenced
| Referenced ()
| Referenced (const Referenced &)
virtual | ~Referenced ()
Referenced & | operator= (const Referenced &)

## Protected Attributes
TypeSet< VT > | cumdata_
TypeSet< VT > | data_
SamplingData< VT > | sampling_
Protected Attributes inherited from MonitoredObject
Threads::Lock | accesslock_
Protected Attributes inherited from NamedObject
BufferString | name_

## Friends
class | DataDistributionChanger< VT >
class | DataDistributionInfoExtracter< VT >
class | DataDistributionIter< VT >

## Additional Inherited Members
Public Types inherited from MonitoredObject
typedef CNotifier< MonitoredObject, ChangeData > | ChangeDataNotifier
typedef int | ChangeType
typedef od_int64 | IDType
typedef Threads::Locker | Locker
Public Types inherited from ObjectWithName
typedef OD::String | name_type

## Detailed Description

template<class VT>
class DataDistribution< VT >

Sharable data distribution. Sampling defaults to 0 step 1.

The data in this object can be either true 'frequencies' or 'histogram' values. More generally, if you want to obtain a 'true' distribution in the mathematical sense of the word, then you should use 'normalize', which assures that the sum of the values is 1.

The SamplingData describes the positions of the bin centers. Thus, if you have a hard start and stop, calculate the step like (stop-start)/nrbins, then put sampling.start at start + 0.5*step.

Note that it is a bad idea to have negative data (P<0). We're not checking.

The position in a distribution is a data value.

<>

## Constructor & Destructor Documentation

## ◆ DataDistribution() [1/5]

template<class VT >

DataDistribution< VT >::DataDistribution | ( |  | ) |
| inline

## ◆ DataDistribution() [2/5]

template<class VT >

DataDistribution< VT >::DataDistribution | ( | int |  | ) |
| inline

## ◆ DataDistribution() [3/5]

template<class VT >

DataDistribution< VT >::DataDistribution | ( | SamplingData< VT > | ,
|  | int | n = 256 )
| inline

## ◆ DataDistribution() [4/5]

template<class VT >

DataDistribution< VT >::DataDistribution | ( | const TypeSet< VT > & |  | ) |
| inline

## ◆ DataDistribution() [5/5]

template<class VT >

DataDistribution< VT >::DataDistribution | ( | const TypeSet< VT > & | ,
|  | SamplingData< VT > | )
| inline

## ◆ ~DataDistribution()

template<class VT >

DataDistribution< VT >::~DataDistribution | ( |  | ) |
| inline protected

## Member Function Documentation

## ◆ add()

template<class VT >

void DataDistribution< VT >::add | ( | const VT * |  | ) |
| inline

fast, no checks

## ◆ binPos()

template<class VT >

VT DataDistribution< VT >::binPos | ( | int |  | ) | const
| inline

## ◆ cDataChange()

template<class VT >

static ChangeType DataDistribution< VT >::cDataChange | ( |  | ) |
| inline static

## ◆ cSamplingChange()

template<class VT >

static ChangeType DataDistribution< VT >::cSamplingChange | ( |  | ) |
| inline static

## ◆ dataRange()

template<class VT >

Interval< VT > DataDistribution< VT >::dataRange | ( |  | ) | const
| inline

## ◆ get()

template<class VT >

VT DataDistribution< VT >::get | ( | int | ,
|  | bool | cumulative = false ) const
| inline

## ◆ getArr()

template<class VT >

VT * DataDistribution< VT >::getArr | ( | bool | cum | ) | const
| inline

for fast non-shared usage

## ◆ getAvgStd()

template<class VT >

void DataDistribution< VT >::getAvgStd | ( | VT & | avg,
|  | VT & | std ) const
| inline

## ◆ getBinNr()

template<class VT >

int DataDistribution< VT >::getBinNr | ( | VT |  | ) | const
| inline

## ◆ getBinNrFor()

template<class VT >

static int DataDistribution< VT >::getBinNrFor | ( | VT | ,
|  | const SamplingData< VT > & | ,
|  | int | nrbins )
| inline static

## ◆ getEmptyDistrib()

template<class VT >

static const DataDistribution< VT > & DataDistribution< VT >::getEmptyDistrib | ( |  | ) |
| static

## ◆ getSet()

template<class VT >

TypeSet< VT > DataDistribution< VT >::getSet | ( | bool | cum | ) | const
| inline

## ◆ gtMax()

template<class VT >

VT DataDistribution< VT >::gtMax | ( | int * | idxat = 0 | ) | const
| inline protected

## ◆ isEmpty()

template<class VT >

bool DataDistribution< VT >::isEmpty | ( |  | ) | const
| inline

## ◆ isNormalised()

template<class VT >

bool DataDistribution< VT >::isNormalised | ( |  | ) | const
| inline

## ◆ isNormalized()

template<class VT >

bool DataDistribution< VT >::isNormalized | ( |  | ) | const
| inline

## ◆ maxValue()

template<class VT >

VT DataDistribution< VT >::maxValue | ( |  | ) | const
| inline

## ◆ mDeclMonitorableAssignment()

template<class VT >

DataDistribution< VT >::mDeclMonitorableAssignment | ( | DataDistribution< VT > |  | ) |

## ◆ medianPosition()

template<class VT >

VT DataDistribution< VT >::medianPosition | ( |  | ) | const
| inline

## ◆ mImplSimpleMonitoredGetSet()

template<class VT >

DataDistribution< VT >::mImplSimpleMonitoredGetSet | ( | inline | ,
|  | sampling | ,
|  | setSampling | ,
|  | SamplingData< VT > | ,
|  | sampling_ | ,
|  | cSamplingChange() | )

## ◆ operator[]()

template<class VT >

VT DataDistribution< VT >::operator[] | ( | int |  | ) | const
| inline

## ◆ positionForCumulative()

template<class VT >

VT DataDistribution< VT >::positionForCumulative | ( | VT |  | ) | const
| inline

## ◆ set() [1/2]

template<class VT >

void DataDistribution< VT >::set | ( | const VT * |  | ) |
| inline

fast, no checks

## ◆ set() [2/2]

template<class VT >

void DataDistribution< VT >::set | ( | int | ,
|  | VT | )
| inline

slow, O(N)

## ◆ setCumData()

template<class VT >

void DataDistribution< VT >::setCumData | ( | int |  | ) |
| protected

## ◆ setEmpty()

template<class VT >

void DataDistribution< VT >::setEmpty | ( |  | ) |
| inline

## ◆ setSize()

template<class VT >

void DataDistribution< VT >::setSize | ( | int |  | ) |

## ◆ size()

template<class VT >

int DataDistribution< VT >::size | ( |  | ) | const
| inline

## ◆ sumOfValues()

template<class VT >

VT DataDistribution< VT >::sumOfValues | ( |  | ) | const
| inline

## ◆ valueAt()

template<class VT >

VT DataDistribution< VT >::valueAt | ( | VT | ,
|  | bool | cumulative ) const
| inline

## Friends And Related Symbol Documentation

## ◆ DataDistributionChanger< VT >

template<class VT >

friend class DataDistributionChanger< VT >
| friend

## ◆ DataDistributionInfoExtracter< VT >

template<class VT >

friend class DataDistributionInfoExtracter< VT >
| friend

## ◆ DataDistributionIter< VT >

template<class VT >

friend class DataDistributionIter< VT >
| friend

## Member Data Documentation

## ◆ cumdata_

template<class VT >

TypeSet<VT> DataDistribution< VT >::cumdata_
| protected

## ◆ data_

template<class VT >

TypeSet<VT> DataDistribution< VT >::data_
| protected

## ◆ sampling_

template<class VT >

SamplingData<VT> DataDistribution< VT >::sampling_
| protected

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