|
Go to the documentation of this file. 1 #ifndef NPSTAT_INTERPOLATE_HH_
2 #define NPSTAT_INTERPOLATE_HH_
28 const typename ProperDblFromCmpl<T>::type dx = 1.0 - x;
29 return f0*dx + f1* static_cast<typename ProperDblFromCmpl<T>::type >(x);
38 const T& f1, const T& f2)
40 static const typename ProperDblFromCmpl<T>::type two = 2.0;
41 const typename ProperDblFromCmpl<T>::type dx = x - 1.0;
42 return f1 + ((f2 - f0)/two + ((f2 - f1) + (f0 - f1))*(dx/two))*dx;
51 const T& f2, const T& f3)
71 const T& f0, const T& f1);
74 const T& f0, const T& f1, const T& f2);
77 const T& f0, const T& f1,
78 const T& f2, const T& f3);
81 inline std::vector<double> interpolation_coefficients_2(
82 const double f0, const double f1)
84 const unsigned nCoeffs = 2;
85 std::vector<double> buf(nCoeffs);
87 &buf[0], nCoeffs, f0, f1);
92 inline std::vector<double> interpolation_coefficients_2(
93 const double f0, const double f1, const double f2)
95 const unsigned nCoeffs = 3;
96 std::vector<double> buf(nCoeffs);
98 &buf[0], nCoeffs, f0, f1, f2);
103 inline std::vector<double> interpolation_coefficients_2(
104 const double f0, const double f1,
105 const double f2, const double f3)
107 const unsigned nCoeffs = 4;
108 std::vector<double> buf(nCoeffs);
110 &buf[0], nCoeffs, f0, f1, f2, f3);
111 assert(n == nCoeffs);
117 #include "npstat/nm/interpolate.icc"
Compile-time deduction of the underlying floating point type from the given complex type.
Definition: AbsArrayProjector.hh:14
T interpolate_quadratic(const double x, const T &f0, const T &f1, const T &f2) Definition: interpolate.hh:37
T interpolate_linear(const double x, const T &f0, const T &f1) Definition: interpolate.hh:26
T interpolate_cubic(const double x, const T &f0, const T &f1, const T &f2, const T &f3) Definition: interpolate.hh:50
unsigned interpolation_coefficients(T *buffer, unsigned bufLen, const T &f0, const T &f1)
|