15 #ifndef QMCPLUSPLUS_GRID_FUNCTOR_QUINTIC_SPLINE_H 16 #define QMCPLUSPLUS_GRID_FUNCTOR_QUINTIC_SPLINE_H 27 template<
class Td,
class Tg = Td,
class CTd = Vector<Td>,
class CTg = Vector<Tg>>
64 m_Y.resize(nv.size());
65 m_Y2.resize(nv.size());
90 m_Y2.resize(a.m_Y2.size());
101 E.resize(a.E.size());
103 F.resize(a.F.size());
110 return a + cL * (b + cL * (c + cL * (d + cL * (
e + cL *
f))));
115 du = b + cL * (2.0 * c + cL * (3.0 * d + cL * (4.0 *
e + cL *
f * 5.0)));
116 d2u = 2.0 * c + cL * (6.0 * d + cL * (12.0 *
e + cL *
f * 20.0));
117 return a + cL * (b + cL * (c + cL * (d + cL * (
e + cL *
f))));
122 du = b + cL * (2.0 * c + cL * (3.0 * d + cL * (4.0 *
e + cL *
f * 5.0)));
123 d2u = 2.0 * c + cL * (6.0 * d + cL * (12.0 *
e + cL *
f * 20.0));
124 d3u = 6.0 * d + cL * (24.0 *
e + cL *
f * 60.0);
125 return a + cL * (b + cL * (c + cL * (d + cL * (
e + cL *
f))));
140 int Loc =
m_grid->getIndexAndDistanceFromGridPoint(
r, cL);
156 int Loc =
m_grid->getIndexAndDistanceFromGridPoint(
r, cL);
171 int Loc =
m_grid->getIndexAndDistanceFromGridPoint(
r, cL);
181 int npts(this->
size());
193 D.data() + imin,
E.data() + imin,
F.data() + imin);
value_type f(point_type r)
Evaluate the function and its derivatives, store the derivatives.
CTd data_type
the type of the containers Y, dY and d2Y
helper functions for EinsplineSetBuilder
value_type * data()
return the grid data
Implement One-Dimensional function on a radial grid.
value_type splint(point_type r) const override
int NumNodes
the number of nodes
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
An abstract base class to implement a One-Dimensional grid.
Td value_type
the type of the value on a grid
OneDimQuinticSpline(std::unique_ptr< grid_type > gt, const VV &nv)
value_type Y
store the value of the function
void QuinticSplineSolve(int N, const Tg *X, T *Y, T *B, T *C, T *D, T *E, T *F)
template function: note that the range of data is [0,n) instead of [1,n] solve the linear system for ...
value_type d2Y
store the second derivative of the function
value_type splint(point_type r, value_type &du, value_type &d2u) const override
OneDimGridBase< Tg, CTg > grid_type
the grid type
int size() const
return the number of data points
Td quinticInterpolateThirdDeriv(Td cL, Td a, Td b, Td c, Td d, Td e, Td f, Td &du, Td &d2u, Td &d3u) const
value_type dY
store the derivative of the function
OneDimQuinticSpline< Td, Tg, CTd, CTg > * makeClone() const
Td quinticInterpolateSecondDeriv(Td cL, Td a, Td b, Td c, Td d, Td e, Td f, Td &du, Td &d2u) const
value_type splint(point_type r, value_type &du, value_type &d2u, value_type &d3u) const
Td quinticInterpolate(Td cL, Td a, Td b, Td c, Td d, Td e, Td f) const
Tg point_type
the type of the grid value
OneDimQuinticSpline(std::unique_ptr< grid_type > gt=std::unique_ptr< grid_type >())
void spline(int imin, value_type yp1, int imax, value_type ypn) override
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