 |
OpendTect
6.6
|
Go to the documentation of this file.
20 #if defined(__msvc__) && (defined(ALGO_EXPORTS) || defined(Algo_EXPORTS))
21 # define mAlgoClass class dll_export
23 # define mAlgoClass class
39 inline void setX(
const Array2D<T>&,
bool hasudfs);
41 inline void setY(
const Array2D<T>&,
bool hasudfs);
56 bool shouldFFT()
const;
82 if ( xhasudfs_ || yhasudfs_ || x_->info()!=y_->info() ||
83 x_->info()!=z_->info() )
95 : z_->info().getTotalSz();
99 template <
class T>
inline
104 template <
class T>
inline
109 , normalize_( false )
110 , correlate_( false )
130 template <
class T>
inline
139 template <
class T>
inline
150 #define mConvolver2DSetIndex( dim ) \
151 const char y##dim##inc = correlate_ ? 1 : -1; \
152 const int idy##dim = firsty##dim+idx##dim*y##dim##inc; \
157 idx##dim += (-idy##dim)-1; \
164 if ( idy##dim>=ysz##dim ) \
169 const int diff = idy##dim-(ysz##dim-1); \
170 idx##dim += diff-1; \
175 template <
class T>
inline
180 : z_->info().getTotalSz();
188 template <
class T>
inline
191 return doNonFFTWork( start, stop, thread );
195 template <
class T>
inline
198 const int xsz0 = x_->info().getSize( 0 );
199 const int xsz1 = x_->info().getSize( 1 );
200 const int ysz0 = y_->info().getSize( 0 );
201 const int ysz1 = y_->info().getSize( 1 );
205 if ( !z_->info().getArrayPos( start, startpos ) )
209 iterator.
setPos( startpos );
212 const T* xptr_ = x_->getData();
215 const T* yptr_ = y_->getData();
217 for (
od_int64 idx=start; idx<=stop; idx++ )
219 const int* zvar = iterator.
getPos();
220 const int firsty0 = correlate_ ? -zvar[0] : zvar[0];
221 const int firsty1 = correlate_ ? -zvar[1] : zvar[1];
226 for (
int idx0=0; idx0<xsz0 && shouldContinue(); idx0++ )
230 const od_int64 yoffset = ystor_ || yptr_ ?
231 y_->info().getOffset( idy0, 0 ) : 0;
233 const od_int64 xoffset = xstor_ || xptr_ ?
234 x_->info().getOffset( idx0, 0 ) : 0;
236 for (
int idx1=0; idx1<xsz1; idx1++ )
241 ? yptr_[yoffset+idy1]
243 ? ystor_->
value( yoffset+idy1 )
244 : y_->get( idy0, idy1 );
250 ? xptr_[xoffset+idx1]
252 ? xstor_->
value( xoffset+idx1 )
253 : x_->get( idx0, idx1 );
264 if ( !nrsamples ) z_->setND( zvar, 0 );
265 else if ( normalize_ && !
mIsZero(ysum,1e-8) )
266 z_->setND( zvar, sum/ysum );
267 else z_->setND( zvar, sum );
271 if ( !iterator.
next() && idx!=stop )
Interface to a series of values.
Definition: odmemory.h:16
bool correlate_
Definition: convolve2d.h:62
const Array2D< T > * getY() const
Definition: convolve2d.h:42
std::complex< float > float_complex
Definition: odcomplex.h:17
Does Fourier Transforms of any size.
Definition: fourier.h:30
void setZ(Array2D< T > &z)
Definition: convolve2d.h:43
virtual T value(int64_t) const =0
float_complex * yf_
Definition: convolve2d.h:67
Array2D< T > * z_
Definition: convolve2d.h:60
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:289
#define od_int64
Definition: plftypes.h:35
float_complex * zf_
Definition: convolve2d.h:68
Convolver2D()
Definition: convolve2d.h:105
bool updatexf_
Definition: convolve2d.h:70
bool xhasudfs_
Definition: convolve2d.h:63
bool yhasudfs_
Definition: convolve2d.h:64
#define mConvolver2DSetIndex(dim)
Definition: convolve2d.h:150
bool doNonFFTWork(od_int64, od_int64, int)
Definition: convolve2d.h:196
bool shouldFFT() const
Definition: convolve2d.h:100
const Array2D< T > * getX() const
Definition: convolve2d.h:40
bool doWork(od_int64, od_int64, int)
Definition: convolve2d.h:189
void setNormalize(bool n)
Definition: convolve2d.h:44
Definition: convolve2d.h:26
void setPos(const T &idxabl)
Definition: arraynd.h:285
Convolves (or correlates) two 2D signals.
Definition: convolve2d.h:34
#define mIsZero(x, eps)
Definition: commondefs.h:66
const Array2D< T > * x_
Definition: convolve2d.h:58
const int * getPos() const
Definition: arraynd.h:220
Iterates through all samples in an ArrayND.
Definition: arraynd.h:209
float_complex * xf_
Definition: convolve2d.h:66
void setX(const Array2D< T > &, bool hasudfs)
Definition: convolve2d.h:131
void setY(const Array2D< T > &, bool hasudfs)
Definition: convolve2d.h:140
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
bool normalize_
Definition: convolve2d.h:61
Fourier::CC * fft_
Definition: convolve2d.h:73
void setCorrelate(bool yn)
Definition: convolve2d.h:47
const Array2D< T > * y_
Definition: convolve2d.h:59
#define mAlgoClass
Definition: convolve2d.h:23
bool updateyf_
Definition: convolve2d.h:71
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:140
od_int64 nrIterations() const
Definition: convolve2d.h:176
~Convolver2D()
Definition: convolve2d.h:127
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021