17 #ifndef QMCPLUSPLUS_GRID_FUNCTOR_CUBIC_SPLINE_H 18 #define QMCPLUSPLUS_GRID_FUNCTOR_CUBIC_SPLINE_H 137 template<
typename T1>
140 return cR * y1 +
cL * y2 +
q1 * d2y1 +
q2 * d2y2;
143 template<
typename T1>
147 d2u =
cR * d2y1 +
cL * d2y2;
148 return cR * y1 +
cL * y2 +
q1 * d2y1 +
q2 * d2y2;
152 template<
class Td,
class Tg = Td,
class CTd = Vector<Td>,
class CTg = Vector<Tg>>
189 m_Y.resize(nv.size());
190 m_Y2.resize(nv.size());
191 copy(nv.begin(), nv.end(),
m_Y.data());
219 int Loc =
m_grid->getIndexAndDistanceFromGridPoint(
r, dist);
247 int Loc =
m_grid->getIndexAndDistanceFromGridPoint(
r, dist);
279 int Loc =
m_grid->getIndexAndDistanceFromGridPoint(
r, dist);
300 int npts(this->
size());
void CubicSplineSolve(T const *x, T const *y, int n, T yp0, T ypn, T *y2)
Solve for second derivatives for cubic splines.
T1 cubicInterpolate(T1 y1, T1 y2, T1 d2y1, T1 d2y2) const
CTd data_type
the type of the containers Y, dY and d2Y
typename base_type::value_type value_type
helper functions for EinsplineSetBuilder
Implement One-Dimensional function on a radial grid.
OneDimCubicSpline(const OneDimCubicSpline &a)
int NumNodes
the number of nodes
typename base_type::grid_type grid_type
value_type splint(point_type r, value_type &du, value_type &d2u, value_type &d3u) const
Interpolation to evaluate the function and itsderivatives.
typename base_type::point_type point_type
value_type splint(point_type r) const override
void spline(int imin, value_type yp1, int imax, value_type ypn) override
Evaluate the 2nd derivative on the grid points.
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
Perform One-Dimensional Cubic Spline Interpolation using M-relation.
Td value_type
the type of the value on a grid
T1 cubicInterpolateSecondDeriv(T1 y1, T1 y2, T1 d2y1, T1 d2y2, T1 &du, T1 &d2u) const
value_type Y
store the value of the function
value_type d2Y
store the second derivative of the function
OneDimGridBase< Tg, CTg > grid_type
the grid type
typename base_type::data_type data_type
int size() const
return the number of data points
value_type dY
store the derivative of the function
value_type splint(point_type r, value_type &du, value_type &d2u) const override
Interpolation to evaluate the function and itsderivatives.
CubicSplineEvaluator(T dist, T dL)
OneDimCubicSpline(std::unique_ptr< grid_type > gt, const VV &nv)
OneDimCubicSpline(std::unique_ptr< grid_type > gt=std::unique_ptr< grid_type >())
Tg point_type
the type of the grid value
point_type r(int i) const
return the grid point at index i
std::unique_ptr< grid_type > m_grid
pointer to the radial grid
data_type m_Y
data for the function on the grid
OneDimCubicSpline * makeClone() const