OpendTect  6.6
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
MultiDimStorage< T > Class Template Reference
Inheritance diagram for MultiDimStorage< T >:
[legend]

Public Member Functions

 MultiDimStorage (const MultiDimStorage< T > &)
 
 MultiDimStorage (int ndims, int nvals)
 
virtual ~MultiDimStorage ()
 
template<class V , class POS >
bool add (const V &vals, const POS &pos)
 
template<class V , class POS , class IDX >
bool add (const V &vals, const POS &pos, IDX *index=0)
 
bool allowDuplicates (bool)
 
bool allowsDuplicates () const
 
bool append (const MultiDimStorage< T > &)
 
bool divide (ObjectSet< int > &) const
 
template<class POS , class IDX >
bool findFirst (const POS &, IDX &) const
 
template<class IDX >
bool getIndex (int global_pos, IDX &) const
 
template<class POS >
void getIndicesInRange (const POS &start, const POS &stop, TypeSet< int > &res) const
 
template<class IDX , class POS >
bool getPos (const IDX &, POS &) const
 
int getPos (int idx) const
 
bool getRange (int dim, Interval< int > &) const
 
template<class IDX >
T & getRef (const IDX &index, int val)
 
template<class IDX >
const T & getRef (const IDX &index, int val) const
 
int indexOf (int pos) const
 
bool isEmpty () const
 
bool isOK () const
 
template<class IDX >
bool isValidPos (const IDX &) const
 
template<class IDX >
bool next (IDX &, bool skipdups=false) const
 
int nrDims () const
 
int nrVals () const
 
MultiDimStorage< T > & operator= (const MultiDimStorage< T > &)
 
MultiDimStorage< T > * operator[] (int)
 
const MultiDimStorage< T > * operator[] (int) const
 
template<class IDX >
bool prev (IDX &, bool skipdups=false) const
 
template<class IDX >
void remove (const IDX &index)
 
void removeDuplicates ()
 
void removeValue (int)
 
void setEmpty ()
 
void setNrVals (int, bool keepdata)
 
int size () const
 
template<class IDX >
bool sort (TypeSet< IDX > &indices) const
 
template<class IDXS >
bool sort (TypeSet< IDXS > &indices) const
 
int totalSize () const
 

Protected Member Functions

int findFirstPos (int pos) const
 
template<class POS >
void getIndicesInRangeI (const POS &start, const POS &stop, TypeSet< int > &curpos, TypeSet< int > &res) const
 
void getRangeI (int dim, Interval< int > &) const
 
template<class IDX >
void setToLastPos (IDX &) const
 

Protected Attributes

bool allowduplicates_
 
ObjectSet< MultiDimStorage< T > > lowerdimstorage_
 
TypeSet< T > onedimstorage_
 
TypeSet< int > positions_
 

Private Attributes

int nrdims_
 
int nrvals_
 

Detailed Description

template<class T>
class MultiDimStorage< T >

Stores one or more values of type T that are associated with a discrete position in a N dimenstional space.

<>

Constructor & Destructor Documentation

◆ MultiDimStorage() [1/2]

template<class T >
MultiDimStorage< T >::MultiDimStorage ( int  ndims,
int  nvals 
)
inline

◆ MultiDimStorage() [2/2]

template<class T >
MultiDimStorage< T >::MultiDimStorage ( const MultiDimStorage< T > &  templ)
inline

◆ ~MultiDimStorage()

template<class T >
MultiDimStorage< T >::~MultiDimStorage
inlinevirtual

Member Function Documentation

◆ add() [1/2]

template<class T >
template<class V , class POS >
bool MultiDimStorage< T >::add ( const V &  vals,
const POS &  pos 
)
inline

Adds values to stucture.

◆ add() [2/2]

template<class T >
template<class V , class POS , class IDX >
bool MultiDimStorage< T >::add ( const V &  vals,
const POS &  pos,
IDX *  index = 0 
)
inline

Adds values to stucture.

◆ allowDuplicates()

template<class T >
bool MultiDimStorage< T >::allowDuplicates ( bool  nv)
inline
Returns
oldstatus.

◆ allowsDuplicates()

template<class T >
bool MultiDimStorage< T >::allowsDuplicates
inline

Set allowance for allowing multiple instances at the same position.

◆ append()

template<class T >
bool MultiDimStorage< T >::append ( const MultiDimStorage< T > &  b)
inline

◆ divide()

template<class T >
bool MultiDimStorage< T >::divide ( ObjectSet< int > &  res) const
inline

divides all items into chunks of (about equal size).

◆ findFirst()

template<class T >
template<class POS , class IDX >
bool MultiDimStorage< T >::findFirst ( const POS &  posarr,
IDX &  indexarr 
) const
inline

◆ findFirstPos()

template<class T >
int MultiDimStorage< T >::findFirstPos ( int  pos) const
inlineprotected

◆ getIndex()

template<class T >
template<class IDX >
bool MultiDimStorage< T >::getIndex ( int  global_pos,
IDX &  indexarr 
) const
inline

◆ getIndicesInRange()

template<class T >
template<class POS >
void MultiDimStorage< T >::getIndicesInRange ( const POS &  start,
const POS &  stop,
TypeSet< int > &  res 
) const
inline
Returns
all indices within a given range.

Gives all indices within a position range.

Parameters
startarray with the interval starts for each dimension
stoparray with the interval stops for each dimension
resthe output. The indexes are multiplexed in, so the first ndims samples are the indices for first position, the second ndim samples are the indices for the second postion and so forth.

◆ getIndicesInRangeI()

template<class T >
template<class POS >
void MultiDimStorage< T >::getIndicesInRangeI ( const POS &  start,
const POS &  stop,
TypeSet< int > &  curpos,
TypeSet< int > &  res 
) const
inlineprotected

◆ getPos() [1/2]

template<class T >
template<class IDX , class POS >
bool MultiDimStorage< T >::getPos ( const IDX &  indexarr,
POS &  pos 
) const
inline

◆ getPos() [2/2]

template<class T >
int MultiDimStorage< T >::getPos ( int  idx) const
inline
Returns
position in highest dimension

◆ getRange()

template<class T >
bool MultiDimStorage< T >::getRange ( int  dim,
Interval< int > &  rg 
) const
inline

◆ getRangeI()

template<class T >
void MultiDimStorage< T >::getRangeI ( int  dim,
Interval< int > &  rg 
) const
inlineprotected

◆ getRef() [1/2]

template<class T >
template<class IDX >
T & MultiDimStorage< T >::getRef ( const IDX &  index,
int  val 
)
inline
Returns
a reference to the value poited out by index and val.

◆ getRef() [2/2]

template<class T >
template<class IDX >
const T & MultiDimStorage< T >::getRef ( const IDX &  index,
int  val 
) const
inline
Returns
a reference to the value poited out by index and val.

◆ indexOf()

template<class T >
int MultiDimStorage< T >::indexOf ( int  pos) const
inline
Returns
index in highest dimension

◆ isEmpty()

template<class T >
bool MultiDimStorage< T >::isEmpty
inline

◆ isOK()

template<class T >
bool MultiDimStorage< T >::isOK
inline

◆ isValidPos()

template<class T >
template<class IDX >
bool MultiDimStorage< T >::isValidPos ( const IDX &  indexarr) const
inline

◆ next()

template<class T >
template<class IDX >
bool MultiDimStorage< T >::next ( IDX &  indexarr,
bool  skipdups = false 
) const
inline

◆ nrDims()

template<class T >
int MultiDimStorage< T >::nrDims
inline

◆ nrVals()

template<class T >
int MultiDimStorage< T >::nrVals
inline

◆ operator=()

template<class T >
MultiDimStorage< T > & MultiDimStorage< T >::operator= ( const MultiDimStorage< T > &  templ)
inline

◆ operator[]() [1/2]

template<class T >
MultiDimStorage< T > * MultiDimStorage< T >::operator[] ( int  idx)
inline
Returns
zero if nrdims==1

◆ operator[]() [2/2]

template<class T >
const MultiDimStorage< T > * MultiDimStorage< T >::operator[] ( int  idx) const
inline
Returns
zero if nrdims==1

◆ prev()

template<class T >
template<class IDX >
bool MultiDimStorage< T >::prev ( IDX &  indexarr,
bool  skipdups = false 
) const
inline

◆ remove()

template<class T >
template<class IDX >
void MultiDimStorage< T >::remove ( const IDX &  index)
inline

◆ removeDuplicates()

template<class T >
void MultiDimStorage< T >::removeDuplicates
inline

◆ removeValue()

template<class T >
void MultiDimStorage< T >::removeValue ( int  )

◆ setEmpty()

template<class T >
void MultiDimStorage< T >::setEmpty
inline

removes everything.

◆ setNrVals()

template<class T >
void MultiDimStorage< T >::setNrVals ( int  nn,
bool  keepdata 
)
inline

◆ setToLastPos()

template<class T >
template<class IDX >
void MultiDimStorage< T >::setToLastPos ( IDX &  indexarr) const
inlineprotected

◆ size()

template<class T >
int MultiDimStorage< T >::size
inline
Returns
the size in highest dimension.

◆ sort() [1/2]

template<class T >
template<class IDX >
bool MultiDimStorage< T >::sort ( TypeSet< IDX > &  indices) const

Sorts the array in order of globalpos.

◆ sort() [2/2]

template<class T >
template<class IDXS >
bool MultiDimStorage< T >::sort ( TypeSet< IDXS > &  indices) const
inline

◆ totalSize()

template<class T >
int MultiDimStorage< T >::totalSize
inline
Returns
the total number of instances.

Member Data Documentation

◆ allowduplicates_

template<class T >
bool MultiDimStorage< T >::allowduplicates_
protected

◆ lowerdimstorage_

template<class T >
ObjectSet<MultiDimStorage<T> > MultiDimStorage< T >::lowerdimstorage_
protected

◆ nrdims_

template<class T >
int MultiDimStorage< T >::nrdims_
private

◆ nrvals_

template<class T >
int MultiDimStorage< T >::nrvals_
private

◆ onedimstorage_

template<class T >
TypeSet<T> MultiDimStorage< T >::onedimstorage_
protected

◆ positions_

template<class T >
TypeSet<int> MultiDimStorage< T >::positions_
protected

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