) cubic spline interpolation.
More...
#include <CubicSpline.h>

Public Member Functions | |
| CubicSpline () | |
| Creates an instance of this class. | |
| void | operator= (const CubicSpline &rhs) |
| Sets two CubicSpline objects equal. | |
| void | initializeWithFunctionValues (const Array1D< double > &xInput, const Array1D< double > &yInput, double yPrimeFirst, double yPrimeLast) |
| Initializes the spline with the function values at given points plus the derivative values at the end points. | |
| void | initializeWithDerivativeValues (const Array1D< double > &xInput, const Array1D< double > &yPrimeInput, double yFirst) |
| Initializes the spline with the derivative values at given points plus the function value at the first point. | |
| void | evaluate (double x) |
Evaluates the function at . | |
| double | getFunctionValue () |
| Gets the function value at the last evaluated point. | |
| double | getFirstDerivativeValue () |
| Gets the function's first deriviate at the last evaluated point. | |
| double | getSecondDerivativeValue () |
| Gets the function's second deriviative at the last evaluated point. | |
| double | integrate (int indexStart, int indexStop) |
| This function will integrate the spline between two indices. | |
| void | toXML (ostream &strm) |
| Writes the state of this object to an XML stream. | |
| double | Brent_fmin (double ax, double bx, double tol) |
| double | function (double x) |
| double | minimum (double left, double right) |
Protected Member Functions | |
| void | evaluate (double x, int index) |
Evaluate the function at when the index of the box of the domain containing is known. | |
Private Member Functions | |
| void | solve_tridiagonal_system () |
| void | solve_tridiagonal_system2 () |
Private Attributes | |
| Array1D< double > | x_list |
| Array1D< double > | y_list |
| Array1D< double > | yp_list |
| Array1D< double > | a0_list |
| Array1D< double > | a1_list |
| Array1D< double > | a2_list |
| Array1D< double > | a3_list |
| Array1D< double > | row_right |
| Array1D< double > | row_middle |
| Array1D< double > | row_left |
| Array1D< double > | col_rhs |
| double | y0 |
| double | yp0 |
| double | ypend |
| int | n |
| double | f |
| double | dfdx |
| double | ddfddx |
Friends | |
| ostream & | operator<< (ostream &strm, CubicSpline &rhs) |
| Writes the state of this object to an XML stream. | |
) cubic spline interpolation.
Definition at line 30 of file CubicSpline.h.
| CubicSpline::CubicSpline | ( | ) |
| void CubicSpline::operator= | ( | const CubicSpline & | rhs | ) |
Sets two CubicSpline objects equal.
| rhs | object to set this object equal to |
Definition at line 18 of file CubicSpline.cpp.
References a0_list, a1_list, a2_list, a3_list, ddfddx, dfdx, f, n, x_list, y_list, yp0, yp_list, and ypend.
Referenced by CubicSplineWithGeometricProgressionGrid::operator=().
| void CubicSpline::initializeWithFunctionValues | ( | const Array1D< double > & | xInput, | |
| const Array1D< double > & | yInput, | |||
| double | yPrimeFirst, | |||
| double | yPrimeLast | |||
| ) |
Initializes the spline with the function values at given points plus the derivative values at the end points.
| xInput | x values of the given points. | |
| yInput | y values of the given points. | |
| yPrimeFirst | derivative value at the first point. | |
| yPrimeLast | derivative value at the last point. |
Definition at line 37 of file CubicSpline.cpp.
References a0_list, a1_list, a2_list, a3_list, Array1D< T >::allocate(), col_rhs, Array1D< T >::dim1(), n, row_left, row_middle, row_right, solve_tridiagonal_system(), x_list, y_list, yp0, yp_list, and ypend.
Referenced by QMCNuclearForces::calcCoefficients(), QMCEigenSearch::get_a_diag(), QMCNuclearForces::initialize(), and QMCBasisFunction::initializeInterpolation().
| void CubicSpline::initializeWithDerivativeValues | ( | const Array1D< double > & | xInput, | |
| const Array1D< double > & | yPrimeInput, | |||
| double | yFirst | |||
| ) |
Initializes the spline with the derivative values at given points plus the function value at the first point.
| xInput | x values of the given points. | |
| yPrimeInput | derivative values of the given points. | |
| yFirst | function value at the first point. |
Definition at line 159 of file CubicSpline.cpp.
References a0_list, a1_list, a2_list, a3_list, Array1D< T >::allocate(), col_rhs, Array1D< T >::dim1(), n, row_left, row_middle, row_right, solve_tridiagonal_system2(), x_list, y0, y_list, and yp_list.
| void CubicSpline::evaluate | ( | double | x | ) | [virtual] |
Evaluates the function at
.
| x | point to evaluate the function. |
Implements FunctionR1toR1.
Reimplemented in CubicSplineWithGeometricProgressionGrid.
Definition at line 363 of file CubicSpline.cpp.
Referenced by CubicSplineWithGeometricProgressionGrid::evaluate(), and QMCNuclearForces::initialize().
| double CubicSpline::getFunctionValue | ( | ) | [virtual] |
Gets the function value at the last evaluated point.
Implements FunctionR1toR1.
Definition at line 454 of file CubicSpline.cpp.
References f.
Referenced by QMCNuclearForces::initialize().
| double CubicSpline::getFirstDerivativeValue | ( | ) | [virtual] |
Gets the function's first deriviate at the last evaluated point.
Implements FunctionR1toR1.
Definition at line 459 of file CubicSpline.cpp.
References dfdx.
| double CubicSpline::getSecondDerivativeValue | ( | ) | [virtual] |
Gets the function's second deriviative at the last evaluated point.
Implements FunctionR1toR1.
Definition at line 464 of file CubicSpline.cpp.
References ddfddx.
| double CubicSpline::integrate | ( | int | indexStart, | |
| int | indexStop | |||
| ) |
This function will integrate the spline between two indices.
| indexStart | ||
| indexStop |
Definition at line 392 of file CubicSpline.cpp.
References a0, a0_list, a1_list, a2_list, a3_list, n, and x_list.
Referenced by QMCNuclearForces::calcCoefficients(), and QMCNuclearForces::initialize().
| void CubicSpline::toXML | ( | ostream & | strm | ) |
Writes the state of this object to an XML stream.
| strm | XML stream |
Definition at line 469 of file CubicSpline.cpp.
References a0_list, a1_list, a2_list, a3_list, ddfddx, dfdx, Array1D< T >::dim1(), f, x_list, y_list, and yp_list.
Referenced by operator<<().
| void CubicSpline::evaluate | ( | double | x, | |
| int | index | |||
| ) | [protected] |
Evaluate the function at
when the index of the box of the domain containing
is known.
| x | point to evaluate the function. | |
| index | index of the box of the domain containing x. |
Definition at line 424 of file CubicSpline.cpp.
References a0, a0_list, a1_list, a2_list, a3_list, ddfddx, dfdx, f, n, and x_list.
| void CubicSpline::solve_tridiagonal_system | ( | ) | [private] |
Definition at line 278 of file CubicSpline.cpp.
References col_rhs, n, row_left, row_middle, and row_right.
Referenced by initializeWithFunctionValues().
| void CubicSpline::solve_tridiagonal_system2 | ( | ) | [private] |
Definition at line 316 of file CubicSpline.cpp.
References col_rhs, f, n, row_left, row_middle, and row_right.
Referenced by initializeWithDerivativeValues().
| double FunctionR1toR1::Brent_fmin | ( | double | ax, | |
| double | bx, | |||
| double | tol | |||
| ) | [inherited] |
Definition at line 81 of file FunctionR1toR1.cpp.
References FunctionR1toR1::function().
Referenced by FunctionR1toR1::minimum().
| double FunctionR1toR1::function | ( | double | x | ) | [inherited] |
Definition at line 209 of file FunctionR1toR1.cpp.
References FunctionR1toR1::evaluate(), and FunctionR1toR1::getFunctionValue().
Referenced by FunctionR1toR1::Brent_fmin(), and QMCEigenSearch::get_a_diag().
| double FunctionR1toR1::minimum | ( | double | left, | |
| double | right | |||
| ) | [inherited] |
Definition at line 215 of file FunctionR1toR1.cpp.
References FunctionR1toR1::Brent_fmin().
Referenced by QMCEigenSearch::get_a_diag().
| ostream& operator<< | ( | ostream & | strm, | |
| CubicSpline & | rhs | |||
| ) | [friend] |
Array1D<double> CubicSpline::x_list [private] |
Definition at line 117 of file CubicSpline.h.
Referenced by evaluate(), initializeWithDerivativeValues(), initializeWithFunctionValues(), integrate(), operator=(), and toXML().
Array1D<double> CubicSpline::y_list [private] |
Definition at line 118 of file CubicSpline.h.
Referenced by initializeWithDerivativeValues(), initializeWithFunctionValues(), operator=(), and toXML().
Array1D<double> CubicSpline::yp_list [private] |
Definition at line 119 of file CubicSpline.h.
Referenced by initializeWithDerivativeValues(), initializeWithFunctionValues(), operator=(), and toXML().
Array1D<double> CubicSpline::a0_list [private] |
Definition at line 120 of file CubicSpline.h.
Referenced by evaluate(), initializeWithDerivativeValues(), initializeWithFunctionValues(), integrate(), operator=(), and toXML().
Array1D<double> CubicSpline::a1_list [private] |
Definition at line 121 of file CubicSpline.h.
Referenced by evaluate(), initializeWithDerivativeValues(), initializeWithFunctionValues(), integrate(), operator=(), and toXML().
Array1D<double> CubicSpline::a2_list [private] |
Definition at line 122 of file CubicSpline.h.
Referenced by evaluate(), initializeWithDerivativeValues(), initializeWithFunctionValues(), integrate(), operator=(), and toXML().
Array1D<double> CubicSpline::a3_list [private] |
Definition at line 123 of file CubicSpline.h.
Referenced by evaluate(), initializeWithDerivativeValues(), initializeWithFunctionValues(), integrate(), operator=(), and toXML().
Array1D<double> CubicSpline::row_right [private] |
Definition at line 125 of file CubicSpline.h.
Referenced by initializeWithDerivativeValues(), initializeWithFunctionValues(), solve_tridiagonal_system(), and solve_tridiagonal_system2().
Array1D<double> CubicSpline::row_middle [private] |
Definition at line 126 of file CubicSpline.h.
Referenced by initializeWithDerivativeValues(), initializeWithFunctionValues(), solve_tridiagonal_system(), and solve_tridiagonal_system2().
Array1D<double> CubicSpline::row_left [private] |
Definition at line 127 of file CubicSpline.h.
Referenced by initializeWithDerivativeValues(), initializeWithFunctionValues(), solve_tridiagonal_system(), and solve_tridiagonal_system2().
Array1D<double> CubicSpline::col_rhs [private] |
Definition at line 128 of file CubicSpline.h.
Referenced by initializeWithDerivativeValues(), initializeWithFunctionValues(), solve_tridiagonal_system(), and solve_tridiagonal_system2().
double CubicSpline::y0 [private] |
double CubicSpline::yp0 [private] |
Definition at line 131 of file CubicSpline.h.
Referenced by initializeWithFunctionValues(), and operator=().
double CubicSpline::ypend [private] |
Definition at line 132 of file CubicSpline.h.
Referenced by initializeWithFunctionValues(), and operator=().
int CubicSpline::n [private] |
Definition at line 133 of file CubicSpline.h.
Referenced by evaluate(), initializeWithDerivativeValues(), initializeWithFunctionValues(), integrate(), operator=(), solve_tridiagonal_system(), and solve_tridiagonal_system2().
double CubicSpline::f [private] |
Definition at line 135 of file CubicSpline.h.
Referenced by evaluate(), getFunctionValue(), operator=(), solve_tridiagonal_system2(), and toXML().
double CubicSpline::dfdx [private] |
Definition at line 136 of file CubicSpline.h.
Referenced by evaluate(), getFirstDerivativeValue(), operator=(), and toXML().
double CubicSpline::ddfddx [private] |
Definition at line 137 of file CubicSpline.h.
Referenced by evaluate(), getSecondDerivativeValue(), operator=(), and toXML().
1.5.6