 |
OpendTect
6.6
|
Go to the documentation of this file.
29 , relcube_( arr.info().getNDim() )
31 const int ndim = array_.info().getNDim();
32 for (
int idx=0; idx<ndim; idx++ )
33 relcube_.setSize( idx, 3 );
36 inline int nrExtremes()
const;
43 inline od_int64 nrIterations()
const;
46 inline int indexOf(
const int*)
const;
56 template <
class T>
inline
58 {
return array_.info().getTotalSz(); }
61 template <
class T>
inline
64 const int ndim = array_.info().getNDim();
65 return extremes_.size()/ndim;
69 template <
class T>
inline
72 const int ndim = array_.info().getNDim();
74 if ( !array_.info().getArrayPos( start, pos ) )
81 for (
int idx=
mCast(
int,start); idx<=stop && shouldContinue();
82 idx++, addToNrDone(1), iter.
next() )
90 int extremeidx =
indexOf( currentextreme );
97 if ( !lock_.convReadToWriteLock() )
99 extremeidx =
indexOf( currentextreme );
100 if ( extremeidx!=-1 )
107 for (
int idy=0; idy<ndim; idy++ )
108 extremes_ += currentextreme[idy];
117 template <
class T>
inline
120 const int nrextremes = nrExtremes();
121 const int ndim = array_.info().getNDim();
123 for (
int idx=0; idx<nrextremes; idx++ )
125 const int* curpos = extremes_.arr() + idx*ndim;
127 for (
int idy=0; idy<ndim; idy++ )
129 if ( curpos[idy]!=pos[idy] )
144 template <
class T>
inline
147 const int ndim = array_.info().getNDim();
149 T extremeval = array_.getND( extremepos );
156 bool anychange =
false;
164 bool invalid =
false;
166 for (
int idx=0; idx<ndim; idx++ )
168 if ( iter[idx] ) isnull =
false;
169 const int newpos = extremepos[idx]+iter[idx]-1;
170 if ( newpos<0 || newpos>=array_.info().getSize(idx) )
176 curpos[idx] = newpos;
179 if ( invalid || isnull )
182 const T val = array_.getND( curpos );
183 if ( (minima_ && val<extremeval) || (!minima_ && val>extremeval) )
189 }
while ( iter.
next() );
const int * getExtremes() const
Definition: sampledextremefindernd.h:38
Lock that permits multiple readers to lock the object at the same time, but it will not allow any rea...
Definition: thread.h:143
#define od_int64
Definition: plftypes.h:35
od_int64 nrIterations() const
Definition: sampledextremefindernd.h:57
ArrayNDInfoImpl relcube_
Definition: sampledextremefindernd.h:49
Finds all local maximas/minimas in an ArrayND.
Definition: sampledextremefindernd.h:24
Implementation of ArrayNDInfo.
Definition: arrayndinfo.h:288
float findExtreme(const FloatMathFunction &, bool minima, float x1, float x2, float tol=1e-5)
void setPos(const T &idxabl)
Definition: arraynd.h:285
bool doWork(od_int64, od_int64, int)
Definition: sampledextremefindernd.h:70
BufferStringSet::idx_type indexOf(const BufferStringSet &, const char *)
bool minima_
Definition: sampledextremefindernd.h:50
#define mClass(module)
Definition: commondefs.h:181
const int * getPos() const
Definition: arraynd.h:220
Iterates through all samples in an ArrayND.
Definition: arraynd.h:209
Threads::ReadWriteLock lock_
Definition: sampledextremefindernd.h:52
bool findExtreme(int *) const
Definition: sampledextremefindernd.h:145
int indexOf(const int *) const
Definition: sampledextremefindernd.h:118
const ArrayND< T > & array_
Definition: sampledextremefindernd.h:48
void sysMemCopy(void *, const void *, int64_t)
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mCast(tp, v)
Definition: commondefs.h:137
int nrExtremes() const
Definition: sampledextremefindernd.h:62
#define mAllocVarLenArr(type, varnm, __size)
Definition: varlenarray.h:53
An ArrayND is an array with a given number of dimensions and a size.
Definition: arraynd.h:33
SampledExtremeFinderND(const ArrayND< T > &arr, bool minima)
Definition: sampledextremefindernd.h:26
TypeSet< int > extremes_
Definition: sampledextremefindernd.h:51
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021