13 #ifndef QMCPLUSPLUS_LINEAR_GRID_CUBIC_SPLINE_H 14 #define QMCPLUSPLUS_LINEAR_GRID_CUBIC_SPLINE_H 39 const size_t num_points = grid.size();
40 X_.resize(num_points);
41 for (
size_t i = 0; i < num_points; i++)
42 X_[i] = *(grid.data() + i);
46 m_Y_.resize(num_points);
47 m_Y2_.resize(num_points);
48 for (
size_t i = 0; i < num_points; i++)
50 m_Y_[i] = cublis_spliner.
m_Y[i];
80 return m_Y[0] + first_deriv * (r - r_min);
87 const size_t loc =
std::floor((r - r_min) * delta_inv);
88 const T dist = r - X[loc];
89 const T delta = X[loc + 1] - X[loc];
91 return eval.
cubicInterpolate(m_Y[loc], m_Y[loc + 1], m_Y2[loc], m_Y2[loc + 1]);
T first_deriv_
first derivative for handling r < r_min_
T1 cubicInterpolate(T1 y1, T1 y2, T1 d2y1, T1 d2y2) const
One-Dimensional linear-grid.
T get_const_value() const
helper functions for EinsplineSetBuilder
const auto & get_m_Y2() const
double get_delta_inv() const
T r_max_
use spline below r_min_. If above, use const value
double delta_inv_
1/grid space
Vector< T, OffloadAllocator< T > > m_Y_
data for the function on the grid
Perform One-Dimensional Cubic Spline Interpolation using M-relation.
T get_first_deriv() const
T const_value_
const value for handling r > r_max_
const auto & get_X() const
combined OneDimCubicSpline and LinearGrid OneDimCubicSpline contains OneDimGridBase pointer and calls...
OneDimCubicSplineLinearGrid(const OneDimCubicSpline< T > &cublis_spliner)
T splint(T r) const
compute the function value at r
Vector< T, OffloadAllocator< T > > X_
the location of grid points
T r_min_
use spline above r_min_. If below, use first deriv extrapolation
static T splint(T r_min, T r_max, const T *X, T delta_inv, const T *m_Y, const T *m_Y2, T first_deriv, T const_value, T r)
compute the function value at r.
const grid_type & grid() const
return the radial grid
Vector< T, OffloadAllocator< T > > m_Y2_
data for the function on the grid
const auto & get_m_Y() const
MakeReturn< UnaryNode< FnFloor, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t floor(const Vector< T1, C1 > &l)
data_type m_Y
data for the function on the grid