15 #ifndef QMCPLUSPLUS_GRID_FUNCTOR_LINEAR_SPLINE_H 16 #define QMCPLUSPLUS_GRID_FUNCTOR_LINEAR_SPLINE_H 29 template<
class Td,
class Tg = Td,
class CTd = Vector<Td>,
class CTg = Vector<Tg>>
41 using base_type::GridManager;
75 assign(nv.begin(), nv.end());
83 m_Y.resize(d_last - d_first);
84 copy(d_first, d_last,
m_Y.data());
107 #if defined(USE_MEMORYSAVEMODE) 110 return m_Y[k] +
m_Y1[k] * (
r - (*m_grid)[k]);
165 std::cerr <<
" OneDimLinearSpline cannot be used for derivates." << std::endl;
178 int npts(imax - imin + 1);
184 for (
int i = imin; i < imax - 1; i++)
T rmin() const
return the first grid point
CTd data_type
the type of the containers Y, dY and d2Y
value_type f(int k, point_type rfrac)
evaluate the value at r=(k + rfrac)*delta
helper functions for EinsplineSetBuilder
void assign(IT d_first, IT d_last)
Implement One-Dimensional function on a radial grid.
OneDimLinearSpline(const grid_type *gt=0)
Perform One-Dimensional linear spline Interpolation.
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
An abstract base class to implement a One-Dimensional grid.
OneDimLinearSpline< Td, Tg, CTd, CTg > * makeClone() const
Td value_type
the type of the value on a grid
value_type Y
store the value of the function
value_type splint(point_type r) const override
evaluate the value at r
value_type d2Y
store the second derivative of the function
OneDimLinearSpline(grid_type *gt, const VV &nv, bool pbc=false)
OneDimGridBase< Tg, CTg > grid_type
the grid type
int size() const
return the number of data points
value_type dY
store the derivative of the function
OneDimLinearSpline(point_type ri, point_type rf)
T rmax() const
return the last grid point
void locate(point_type r, int &k, point_type &rfrac)
evaluate the value at r using a binary search on a grid
Tg point_type
the type of the grid value
point_type r(int i) const
return the grid point at index i
void spline(int imin, value_type yp1, int imax, value_type ypn)
evaluate the spline coefficients
std::unique_ptr< grid_type > m_grid
pointer to the radial grid
value_type splint(point_type r, value_type &du, value_type &d2u) const override
evaluate the value at r
data_type m_Y
data for the function on the grid