1 #ifndef valseriesinterpol_h 2 #define valseriesinterpol_h 55 { if ( curidx < 0 ) curidx = 0; \ 56 else if ( curidx > maxidx_ ) curidx = maxidx_; } 63 if ( !extrapol_ && (pos < -snapdist_ || pos > maxidx_ + snapdist_) )
65 else if ( maxidx_ < 1 )
66 return vda.
value( 0 );
69 if ( !smooth_ ||
mIsEqual(pos,curidx,snapdist_) )
70 return vda.
value( curidx );
72 T v[4];
const int lopos = (int)pos;
85 rv = pos < 0.5 ? v[1] : v[2];
87 rv = pos*v[2] + (1-pos)*v[1];
98 if (
mIsUdf(v[0]) ) v[0] = v[1];
99 if (
mIsUdf(v[3]) ) v[3] = v[2];
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:287
virtual T value(int64_t) const =0
T period_
Definition: valseriesinterpol.h:48
bool linear_
Definition: valseriesinterpol.h:49
#define mChkVSIRg
Definition: valseriesinterpol.h:54
T polyReg1D(T vm1, T v0, T v1, T v2, float x)
Definition: interpol1d.h:130
T value(const ValueSeries< T > &, T pos) const
Definition: valseriesinterpol.h:60
#define mIsEqual(x, y, eps)
Definition: commondefs.h:54
bool isperiodic_
Definition: valseriesinterpol.h:46
int maxidx_
Definition: valseriesinterpol.h:41
#define mNINT32(x)
Definition: commondefs.h:45
T polyReg1DWithUdf(T vm1, T v0, T v1, T v2, float x)
Definition: interpol1d.h:189
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Interface to a series of values.
Definition: odmemory.h:17
Definition: valseriesinterpol.h:25
void interpolateYPeriodicReg(const T &idxabl, int sz, float pos, RT &ret, RT period, bool extrapolate=false)
Definition: periodicvalue.h:127
bool extrapol_
Definition: valseriesinterpol.h:45
T snapdist_
Definition: valseriesinterpol.h:42
ValueSeriesInterpolator(int mxidx=mUdf(int))
Definition: valseriesinterpol.h:28
#define mClass(module)
Definition: commondefs.h:164
bool smooth_
Definition: valseriesinterpol.h:44
bool hasudfs_
Definition: valseriesinterpol.h:47
T udfval_
Definition: valseriesinterpol.h:43