OpendTect  6.6
Functions
IdxAble Namespace Reference

Position-sorted indexable objects. More...

Functions

template<class T >
void calibrateArray (const T *input, int sz, const T *controlpts, const int *controlsamples, int nrcontrols, bool usefactor, T *output, float *calibrationcurve=0)
 
template<class T1 , class T2 , class T3 >
T3 derefIndexOf (const T1 &arr, T3 sz, const T2 &val, T3 notfoundval)
 
template<class T1 , class T2 , class T3 >
bool findFPPos (const T1 &posarr, T3 sz, T2 pos, T3 beforefirst, T3 &idx, T2 eps=mDefEps)
 
template<class T1 , class T2 , class T3 >
bool findPos (const T1 &posarr, T3 sz, T2 pos, T3 beforefirst, T3 &idx)
 
template<class T >
int getInterpolateIdxs (const T &idxabl, int sz, float pos, bool extrap, float snapdist, od_int64 p[4])
 
template<class T >
int getInterpolateIdxsWithOff (const T &idxabl, od_int64 sz, od_int64 offset, float pos, bool extrap, float snapdist, od_int64 p[4])
 
template<class X >
int getLowIdx (const X &x, int sz, double pos)
 
template<class X >
int getUpperIdx (const X &x, int sz, double pos)
 
template<class T1 , class T2 , class T3 >
T3 indexOf (const T1 &arr, T3 sz, const T2 &val, T3 notfoundval)
 
template<class X , class Y , class RT >
void interpolatePositioned (const X &x, const Y &y, int sz, float desiredx, RT &ret, bool extrapolate=false)
 
template<class X , class Y >
float interpolatePositioned (const X &x, const Y &y, int sz, float pos, bool extrapolate=false)
 
template<class T >
float interpolateReg (const T &idxabl, int sz, float pos, bool extrapolate=false, float snapdist=mDefEps)
 
template<class T , class RT >
bool interpolateReg (const T &idxabl, int sz, float pos, RT &ret, bool extrapolate=false, float snapdist=mDefEps)
 
template<class T >
float interpolateRegWithUdf (const T &idxabl, int sz, float pos, bool extrapolate=false, float snapdist=mDefEps)
 
template<class T , class RT >
bool interpolateRegWithUdf (const T &idxabl, int sz, float pos, RT &ret, bool extrapolate=false, float snapdist=mDefEps)
 
template<class T , class RT >
bool interpolateRegWithUdfWithOff (const T &idxabl, od_int64 sz, od_int64 offset, float pos, RT &ret, bool extrapolate=false, float snapdist=mDefEps)
 
template<class T , class RT >
void interpolateXPeriodicReg (const T &idxabl, int sz, float pos, RT &ret)
 
template<class T >
float interpolateYPeriodicReg (const T &idxabl, int sz, float pos, float period, bool extrapolate=false)
 
template<class T , class RT >
void interpolateYPeriodicReg (const T &idxabl, int sz, float pos, RT &ret, RT period, bool extrapolate=false)
 

Detailed Description

Position-sorted indexable objects.

These are objects that return a value of type T when the [] operator is applied. Can range from simple arrays and TypeSets to whatever supports the [] operator. The goal is to interpolate between the values. Therefore, the position of the values must be known from either the fact that the values are regular samples or by specifying another indexable object that provides the positions (in float or double).

Function Documentation

◆ calibrateArray()

template<class T >
void IdxAble::calibrateArray ( const T *  input,
int  sz,
const T *  controlpts,
const int *  controlsamples,
int  nrcontrols,
bool  usefactor,
T *  output,
float *  calibrationcurve = 0 
)
inline

◆ derefIndexOf()

template<class T1 , class T2 , class T3 >
T3 IdxAble::derefIndexOf ( const T1 &  arr,
T3  sz,
const T2 &  val,
T3  notfoundval 
)
inline

Find value in indexable filled with pointers.

◆ findFPPos()

template<class T1 , class T2 , class T3 >
bool IdxAble::findFPPos ( const T1 &  posarr,
T3  sz,
T2  pos,
T3  beforefirst,
T3 &  idx,
T2  eps = mDefEps 
)

Find value in sorted array of floating point positions. Equality is tested by mIsZero. The 'arr' indexable object must return the positions. The return par 'idx' may be beforefirst, which means that 'pos' is before the first position. Return value tells whether there is an exact match. If false, index of array member below pos is returned.

◆ findPos()

template<class T1 , class T2 , class T3 >
bool IdxAble::findPos ( const T1 &  posarr,
T3  sz,
T2  pos,
T3  beforefirst,
T3 &  idx 
)

Find value in sorted array of positions. Equality is tested by == operator -> not for float/double! The 'arr' indexable object must return the positions. The return par 'idx' may be -1, which means that 'pos' is before the first position. Return value tells whether there is an exact match. If false, index of array member below pos is returned.

◆ getInterpolateIdxs()

template<class T >
int IdxAble::getInterpolateIdxs ( const T &  idxabl,
int  sz,
float  pos,
bool  extrap,
float  snapdist,
od_int64  p[4] 
)
inline

◆ getInterpolateIdxsWithOff()

template<class T >
int IdxAble::getInterpolateIdxsWithOff ( const T &  idxabl,
od_int64  sz,
od_int64  offset,
float  pos,
bool  extrap,
float  snapdist,
od_int64  p[4] 
)
inline

If pos is large, it will loose it's precision. Therefore the target position in the array is pos+offset.

◆ getLowIdx()

template<class X >
int IdxAble::getLowIdx ( const X &  x,
int  sz,
double  pos 
)
inline

Find index of nearest point below a given position. The 'x' must return the positions. The return value may be -1, which means that 'pos' is before the first position.

◆ getUpperIdx()

template<class X >
int IdxAble::getUpperIdx ( const X &  x,
int  sz,
double  pos 
)
inline

Find index of nearest point above a given position. The 'x' must return the positions. The return value will be 1 if 'pos' is before the second The return value will be equal to sz if 'pos' if after the last position.

◆ indexOf()

template<class T1 , class T2 , class T3 >
T3 IdxAble::indexOf ( const T1 &  arr,
T3  sz,
const T2 &  val,
T3  notfoundval 
)
inline

Find value in indexable

◆ interpolatePositioned() [1/2]

template<class X , class Y , class RT >
void IdxAble::interpolatePositioned ( const X &  x,
const Y &  y,
int  sz,
float  desiredx,
RT &  ret,
bool  extrapolate = false 
)
inline

Irregular interpolation. The 'x' must return the X-positions of the 'y' values.

◆ interpolatePositioned() [2/2]

template<class X , class Y >
float IdxAble::interpolatePositioned ( const X &  x,
const Y &  y,
int  sz,
float  pos,
bool  extrapolate = false 
)
inline

◆ interpolateReg() [1/2]

template<class T >
float IdxAble::interpolateReg ( const T &  idxabl,
int  sz,
float  pos,
bool  extrapolate = false,
float  snapdist = mDefEps 
)
inline

◆ interpolateReg() [2/2]

template<class T , class RT >
bool IdxAble::interpolateReg ( const T &  idxabl,
int  sz,
float  pos,
RT &  ret,
bool  extrapolate = false,
float  snapdist = mDefEps 
)
inline

◆ interpolateRegWithUdf() [1/2]

template<class T >
float IdxAble::interpolateRegWithUdf ( const T &  idxabl,
int  sz,
float  pos,
bool  extrapolate = false,
float  snapdist = mDefEps 
)
inline

◆ interpolateRegWithUdf() [2/2]

template<class T , class RT >
bool IdxAble::interpolateRegWithUdf ( const T &  idxabl,
int  sz,
float  pos,
RT &  ret,
bool  extrapolate = false,
float  snapdist = mDefEps 
)
inline

◆ interpolateRegWithUdfWithOff()

template<class T , class RT >
bool IdxAble::interpolateRegWithUdfWithOff ( const T &  idxabl,
od_int64  sz,
od_int64  offset,
float  pos,
RT &  ret,
bool  extrapolate = false,
float  snapdist = mDefEps 
)
inline

If pos is large, it will loose it's precision. Therefore the target position in the array is pos+offset.

◆ interpolateXPeriodicReg()

template<class T , class RT >
void IdxAble::interpolateXPeriodicReg ( const T &  idxabl,
int  sz,
float  pos,
RT &  ret 
)
inline

interpolateXPeriodicReg interpolates in an periodic indexable ( where the position is periodic ), defined by y(x) = x(x+n*P). The period is equal to the size of the given idxabl.

◆ interpolateYPeriodicReg() [1/2]

template<class T >
float IdxAble::interpolateYPeriodicReg ( const T &  idxabl,
int  sz,
float  pos,
float  period,
bool  extrapolate = false 
)
inline

◆ interpolateYPeriodicReg() [2/2]

template<class T , class RT >
void IdxAble::interpolateYPeriodicReg ( const T &  idxabl,
int  sz,
float  pos,
RT &  ret,
RT  period,
bool  extrapolate = false 
)
inline

interpolateYPeriodicReg interpolates in an indexable storage with periodic entities ( defined by y(x) = y(x) + N*P )


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