30 template <
class X,
class Y>
33 template <
class X,
class Y>
37 IndexInfo(
const T*,
int sz,T val);
39 template <
class X,
class Y>
41 template <
class X,
class Y>
51 template <
class T>
inline 60 {
inundef_ = val != arr[0];
return; }
61 const bool isrev = arr[0] > arr[sz-1];
62 if ( (isrev && val >= arr[0]) || (!isrev && val<=arr[0]) )
64 if ( (!isrev && val >= arr[sz-1]) || (isrev && val<=arr[sz-1]) )
73 if ( (!isrev && val < arr[
nearest_]) || (isrev && val > arr[nearest_]) )
75 T halfway = (arr[
nearest_] + arr[nearest_-1]) * .5f;
87 template <
class X,
class Y>
inline 90 const bool isrev = intv.
step < 0;
91 const Y hstep = intv.
step * 0.5;
93 if ( (isrev && y>intv.
start+hstep) || (!isrev && y<intv.
start-hstep) )
95 else if ( (isrev && y< intv.
stop-hstep) || (!isrev && y>intv.
stop+hstep) )
106 template <
class X,
class Y>
inline #define mExpClass(module)
Definition: commondefs.h:160
IndexInfo(const SamplingData< X > &s, Y y, int len)
Definition: indexinfo.h:34
T step
Definition: samplingdata.h:50
Info on (floating-point) position in an array or StepInterval.
Definition: indexinfo.h:23
int nrSteps() const
Definition: ranges.h:771
T atIndex(int) const
Definition: ranges.h:687
IndexInfo(const StepInterval< X > &s, Y y)
Definition: indexinfo.h:31
int getIndex(const X &) const
Definition: ranges.h:692
T atIndex(IT) const
Definition: samplingdata.h:158
T step
Definition: ranges.h:199
int nearest_
Definition: indexinfo.h:45
T start
Definition: samplingdata.h:49
Interval with step.
Definition: commontypes.h:33
T stop
Definition: ranges.h:93
void set(const StepInterval< X > &, Y)
Definition: indexinfo.h:88
T start
Definition: ranges.h:92
Holds the fundamental sampling info: start and interval.
Definition: samplingdata.h:22
bool inundef_
Definition: indexinfo.h:47
bool roundedtolow_
Definition: indexinfo.h:46
IndexInfo(int i, bool r=true, bool u=false)
Definition: indexinfo.h:26