17 #ifndef QMCPLUSPLUS_CUBIC_B_SPLINE_H 18 #define QMCPLUSPLUS_CUBIC_B_SPLINE_H 22 template<
class T,
unsigned GRIDTYPE,
unsigned BC>
92 this->spline(start, end, datain,
P, closed);
97 this->spline(start, end, yp1, ypn, datain,
P);
102 if (this->getGridPoint(x,
i0))
110 if (this->getGridPoint(x,
i0))
118 if (this->getGridPoint(x,
i0))
126 if (this->getGridPoint(x,
i0))
127 return GridDeltaInv * GridDeltaInv * GridDeltaInv *
137 if (this->getGridPoint(x,
i0))
145 if (this->getGridPoint(x,
i0))
177 (tp[1] * (-0.5 * p0 + 1.5 * p1 - 1.5 * p2 + 0.5 * p3) + tp[2] * (p0 - 2.0 * p1 + p2) +
178 tp[3] * (-0.5 * p0 + 0.5 * p2));
179 d2y = GridDeltaInv2 * (tp[2] * (-p0 + 3.0 * p1 - 3.0 * p2 + p3) + tp[3] * (p0 - 2.0 * p1 + p2));
182 (tp[0] * (-p0 + 3.0 * p1 - 3.0 * p2 + p3) + tp[1] * (3.0 * p0 - 6.0 * p1 + 3.0 * p2) +
183 tp[2] * (-3.0 * p0 + 3.0 * p2) + tp[3] * (p0 + 4.0 * p1 + p2));
190 (tp[0] * (-p0 + 3.0 * p1 - 3.0 * p2 + p3) + tp[1] * (3.0 * p0 - 6.0 * p1 + 3.0 * p2) +
191 tp[2] * (-3.0 * p0 + 3.0 * p2) + tp[3] * (p0 + 4.0 * p1 + p2));
196 return GridDeltaInv *
197 (tp[1] * (-0.5 * p0 + 1.5 * p1 - 1.5 * p2 + 0.5 * p3) + tp[2] * (p0 - 2.0 * p1 + p2) +
198 tp[3] * (-0.5 * p0 + 0.5 * p2));
203 return GridDeltaInv2 * (tp[2] * (-p0 + 3.0 * p1 - 3.0 * p2 + p3) + tp[3] * (p0 - 2.0 * p1 + p2));
void Init(point_type start, point_type end, const container_type &datain, bool closed)
value_type getValue(point_type x)
value_type OffSet
constant shift
value_type getDeriv(point_type x)
value_type interpolate0(value_type p0, value_type p1, value_type p2, value_type p3)
container_type P
The control points.
int i0
index of current grid point
typename CubicBsplineGrid< T, GRIDTYPE, BC >::value_type value_type
value_type splint(point_type x, value_type &dy, value_type &d2y)
value_type interpolate2(value_type p0, value_type p1, value_type p2, value_type p3)
point_type A[16]
coefficients
value_type interpolate1(value_type p0, value_type p1, value_type p2, value_type p3)
typename CubicBsplineGrid< T, GRIDTYPE, BC >::point_type point_type
CubicBspline()
default constructor
value_type interpolate(value_type p0, value_type p1, value_type p2, value_type p3, value_type &dy, value_type &d2y)
value_type getDeriv3(point_type x)
typename CubicBsplineGrid< T, GRIDTYPE, BC >::container_type container_type
value_type operator()(T x)
value_type getDeriv2(point_type x)
void Init(point_type start, point_type end, const container_type &datain, bool closed, T yp1, T ypn)