![]() |
QMCPACK
|
The CubSpline class is a third-order spline representation of a function. More...
Public Member Functions | |
int | size () |
Returns the interpolated value. More... | |
double | operator() (double x) |
double | Deriv (double x) |
Returns the interpolated first derivative. More... | |
double | Deriv2 (double x) |
Returns the interpolated second derivative. More... | |
double | Deriv3 (double x) |
Returns the interpolated third derivative. More... | |
void | Update () |
Recompute the second derivatives from the function values. More... | |
std::vector< double > & | Data () |
void | Init (SimpleGrid &newGrid, std::vector< double > yvals, double startderiv, double endderiv) |
Initialize the cubic spline. More... | |
void | Init (SimpleGrid &newGrid, std::vector< double > &yvals) |
Simplified form which assumes that the second derivative at both boundaries are zero. More... | |
CubSpline (SimpleGrid &newGrid, std::vector< double > &yvals) | |
Simplified constructor. More... | |
CubSpline (SimpleGrid &newGrid, std::vector< double > &yvals, double startderiv, double endderiv) | |
Full constructor. More... | |
double | operator() (int i) const |
Returns the value of the function at the ith grid point. More... | |
double & | operator() (int i) |
Returns a reference to the value at the ith grid point. More... | |
CubSpline () | |
Trivial constructor. More... | |
Public Attributes | |
SimpleGrid | grid |
bool | Initialized |
Private Attributes | |
bool | UpToDate |
This flag records whether or not the stored second derivatives are in sync with the function values. More... | |
std::vector< double > | y |
The function values on the grid points. More... | |
std::vector< double > | d2y |
The second derivatives of the function. More... | |
double | StartDeriv |
The values of the derivative of the represented function on the boundary. More... | |
double | EndDeriv |
The CubSpline class is a third-order spline representation of a function.
It stores a pointer to a grid and the values of the function and its second derivative at the points defined by the grid.
Definition at line 26 of file CubicSpline.h.
|
inline |
Simplified constructor.
Definition at line 91 of file CubicSpline.h.
References EndDeriv, Init(), StartDeriv, and Update().
|
inline |
Full constructor.
Definition at line 99 of file CubicSpline.h.
References Init(), and Update().
|
inline |
Trivial constructor.
Definition at line 115 of file CubicSpline.h.
References Initialized, and UpToDate.
|
inline |
Definition at line 59 of file CubicSpline.h.
References y.
|
inline |
Returns the interpolated first derivative.
Definition at line 163 of file CubicSpline.h.
References d2y, grid, SimpleGrid::NumPoints(), SimpleGrid::ReverseMap(), Update(), UpToDate, and y.
|
inline |
Returns the interpolated second derivative.
Definition at line 191 of file CubicSpline.h.
References d2y, grid, SimpleGrid::NumPoints(), SimpleGrid::ReverseMap(), Update(), and UpToDate.
|
inline |
Returns the interpolated third derivative.
Definition at line 218 of file CubicSpline.h.
References d2y, grid, SimpleGrid::NumPoints(), SimpleGrid::ReverseMap(), Update(), and UpToDate.
|
inline |
Initialize the cubic spline.
See notes about start and end deriv above.
Definition at line 63 of file CubicSpline.h.
References d2y, EndDeriv, grid, Initialized, SimpleGrid::NumPoints(), StartDeriv, Update(), and y.
Referenced by CubSpline(), and Init().
|
inline |
Simplified form which assumes that the second derivative at both boundaries are zero.
Definition at line 84 of file CubicSpline.h.
References Init(), and Update().
|
inline |
Definition at line 122 of file CubicSpline.h.
References d2y, SimpleGrid::End(), grid, SimpleGrid::NumPoints(), SimpleGrid::ReverseMap(), Update(), UpToDate, and y.
|
inline |
Returns the value of the function at the ith grid point.
Definition at line 106 of file CubicSpline.h.
References y.
|
inline |
Returns a reference to the value at the ith grid point.
Definition at line 108 of file CubicSpline.h.
|
inline |
Returns the interpolated value.
Definition at line 49 of file CubicSpline.h.
References grid, and SimpleGrid::NumPoints().
void Update | ( | ) |
Recompute the second derivatives from the function values.
Referenced by CubSpline(), Deriv(), Deriv2(), Deriv3(), Init(), and operator()().
|
private |
The second derivatives of the function.
Definition at line 36 of file CubicSpline.h.
Referenced by Deriv(), Deriv2(), Deriv3(), Init(), and operator()().
|
private |
Definition at line 42 of file CubicSpline.h.
Referenced by CubSpline(), and Init().
SimpleGrid grid |
Definition at line 45 of file CubicSpline.h.
Referenced by Deriv(), Deriv2(), Deriv3(), Init(), operator()(), and size().
bool Initialized |
Definition at line 46 of file CubicSpline.h.
Referenced by CubSpline(), and Init().
|
private |
The values of the derivative of the represented function on the boundary.
If each value is greater that 1e30, we compute boundary conditions assuming that the second derivative is zero at that boundary.
Definition at line 42 of file CubicSpline.h.
Referenced by CubSpline(), and Init().
|
private |
This flag records whether or not the stored second derivatives are in sync with the function values.
It is used to determine whether the second derivatives need recomputation.
Definition at line 32 of file CubicSpline.h.
Referenced by CubSpline(), Deriv(), Deriv2(), Deriv3(), and operator()().
|
private |
The function values on the grid points.
Definition at line 34 of file CubicSpline.h.
Referenced by Data(), Deriv(), Init(), and operator()().