1 #ifndef __RAT_LinearInterp__
2 #define __RAT_LinearInterp__
8 template <
class NumType>
12 LinearInterp(
int _npoints,
const NumType _x[],
const NumType _y[]) { Set(_npoints, _x, _y); };
13 LinearInterp(
const std::vector<NumType> &_x,
const std::vector<NumType> &_y) { Set(_x, _y); };
15 void Set(
int _npoints,
const NumType _x[],
const NumType _y[]);
16 void Set(
const std::vector<NumType> &_x,
const std::vector<NumType> &_y) {
22 NumType operator()(
const NumType xeval)
const;
24 NumType Min() {
return x.front(); };
25 NumType Max() {
return x.back(); };
26 int Points() {
return npoints; };
30 RangeError(
const NumType _xlow,
const NumType _xhigh,
const NumType _xeval)
31 : xlow(_xlow), xhigh(_xhigh), xeval(_xeval){};
32 bool operator==(
const RangeError &other)
const {
33 return xlow == other.xlow && xhigh == other.xhigh && xeval == other.xeval;
35 NumType xlow, xhigh, xeval;
39 int LowerElement(
const NumType xeval)
const;
42 std::vector<NumType> x, y;
45 #include "LinearInterp.icc"
Definition: LinearInterp.hh:28
Definition: LinearInterp.hh:9
Definition: CCCrossSecMessenger.hh:29