15 template <
typename Real>
25 Real
const*
GetX()
const;
26 virtual Real
GetXMin()
const override;
27 virtual Real
GetXMax()
const override;
30 virtual void Lookup(Real
x,
int&
index, Real& dx)
const override;
35 template <
typename Real>
42 #if !defined(GTE_NO_LOGGER) 43 LogAssert(X !=
nullptr,
"Invalid input.");
44 for (
int j0 = 0, j1 = 1; j1 < quantity; ++j0, ++j1)
46 LogAssert(X[j1] > X[j0],
"Invalid input.");
51 std::vector<Real> slope(quantity + 3);
53 for (i = 0, ip1 = 1, ip2 = 2; i < quantity - 1; ++i, ++ip1, ++ip2)
55 Real dx = X[ip1] - X[i];
56 Real df = F[ip1] - F[i];
60 slope[1] = ((Real)2) * slope[2] - slope[3];
61 slope[0] = ((Real)2) * slope[1] - slope[2];
62 slope[quantity + 1] = ((Real)2) * slope[quantity] - slope[quantity - 1];
63 slope[quantity + 2] = ((Real)2) * slope[quantity + 1] - slope[quantity];
66 std::vector<Real> FDer(quantity);
67 for (i = 0; i < quantity; ++i)
73 for (i = 0, ip1 = 1; i < quantity - 1; ++i, ++ip1)
75 auto& poly = this->
mPoly[i];
80 Real FDer1 = FDer[ip1];
82 Real dx = X[ip1] - X[i];
88 poly[2] = (((Real)3) * df - dx * (FDer1 + ((Real)2) * FDer0)) / dx2;
89 poly[3] = (dx * (FDer0 + FDer1) - ((Real)2) * df) / dx3;
93 template <
typename Real>
99 template <
typename Real>
105 template <
typename Real>
111 template <
typename Real>
117 if (x <
mX[index + 1])
std::vector< Polynomial > mPoly
#define LogAssert(condition, message)
Real ComputeDerivative(Real *slope) const