CubicSplineWithGeometricProgressionGrid Class Reference

A 1-dimensional ($\mathbf{R}^{1} \rightarrow \mathbf{R}^{1}$) cubic spline interpolation with a grid that is assumed to be spaced according to a geometric relationship for faster evaluation. More...

#include <CubicSplineWithGeometricProgressionGrid.h>

Inheritance diagram for CubicSplineWithGeometricProgressionGrid:

CubicSpline FunctionR1toR1

List of all members.

Public Member Functions

 CubicSplineWithGeometricProgressionGrid ()
 Constructs an uninitialized spline.
void setGridParameters (double x0, double beta)
 Sets the value for and $x_{0}$ used in generating this grid.
void evaluate (double x)
 Evaluates the function at $x$.
void operator= (const CubicSplineWithGeometricProgressionGrid &rhs)
 Sets two CubicSplineWithGeometricProgressionGrid 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.
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 $x$ when the index of the box of the domain containing $x$ is known.

Private Attributes

double x0
double inverselnbeta
 {1}{ln()}

Friends

ostream & operator<< (ostream &strm, CubicSpline &rhs)
 Writes the state of this object to an XML stream.


Detailed Description

A 1-dimensional ($\mathbf{R}^{1} \rightarrow \mathbf{R}^{1}$) cubic spline interpolation with a grid that is assumed to be spaced according to a geometric relationship for faster evaluation.

\[ x_{i+1} = \beta x_{i} \]

$x_{0}$ is set equal to the first datum used to initialize the spline.

Definition at line 29 of file CubicSplineWithGeometricProgressionGrid.h.


Constructor & Destructor Documentation

CubicSplineWithGeometricProgressionGrid::CubicSplineWithGeometricProgressionGrid (  ) 

Constructs an uninitialized spline.

Definition at line 16 of file CubicSplineWithGeometricProgressionGrid.cpp.

References inverselnbeta, and x0.


Member Function Documentation

void CubicSplineWithGeometricProgressionGrid::setGridParameters ( double  x0,
double  beta 
)

Sets the value for and $x_{0}$ used in generating this grid.

\[ x_{i+1} = e x_{i} \]

Parameters:
x0 the first point in the grid $x_{i+1} = \beta x_{i}$.

Definition at line 22 of file CubicSplineWithGeometricProgressionGrid.cpp.

References inverselnbeta.

Referenced by QMCBasisFunction::initializeInterpolation().

void CubicSplineWithGeometricProgressionGrid::evaluate ( double  x  )  [virtual]

Evaluates the function at $x$.

Parameters:
x point to evaluate the function.

Reimplemented from CubicSpline.

Definition at line 29 of file CubicSplineWithGeometricProgressionGrid.cpp.

References CubicSpline::evaluate(), inverselnbeta, and x0.

void CubicSplineWithGeometricProgressionGrid::operator= ( const CubicSplineWithGeometricProgressionGrid rhs  ) 

Sets two CubicSplineWithGeometricProgressionGrid objects equal.

Parameters:
rhs object to set this object equal to

Definition at line 38 of file CubicSplineWithGeometricProgressionGrid.cpp.

References inverselnbeta, CubicSpline::operator=(), and x0.

void CubicSpline::initializeWithFunctionValues ( const Array1D< double > &  xInput,
const Array1D< double > &  yInput,
double  yPrimeFirst,
double  yPrimeLast 
) [inherited]

Initializes the spline with the function values at given points plus the derivative values at the end points.

Parameters:
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 CubicSpline::a0_list, CubicSpline::a1_list, CubicSpline::a2_list, CubicSpline::a3_list, Array1D< T >::allocate(), CubicSpline::col_rhs, Array1D< T >::dim1(), CubicSpline::n, CubicSpline::row_left, CubicSpline::row_middle, CubicSpline::row_right, CubicSpline::solve_tridiagonal_system(), CubicSpline::x_list, CubicSpline::y_list, CubicSpline::yp0, CubicSpline::yp_list, and CubicSpline::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 
) [inherited]

Initializes the spline with the derivative values at given points plus the function value at the first point.

Parameters:
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 CubicSpline::a0_list, CubicSpline::a1_list, CubicSpline::a2_list, CubicSpline::a3_list, Array1D< T >::allocate(), CubicSpline::col_rhs, Array1D< T >::dim1(), CubicSpline::n, CubicSpline::row_left, CubicSpline::row_middle, CubicSpline::row_right, CubicSpline::solve_tridiagonal_system2(), CubicSpline::x_list, CubicSpline::y0, CubicSpline::y_list, and CubicSpline::yp_list.

void CubicSpline::evaluate ( double  x,
int  index 
) [protected, inherited]

Evaluate the function at $x$ when the index of the box of the domain containing $x$ is known.

Parameters:
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, CubicSpline::a0_list, CubicSpline::a1_list, CubicSpline::a2_list, CubicSpline::a3_list, CubicSpline::ddfddx, CubicSpline::dfdx, CubicSpline::f, CubicSpline::n, and CubicSpline::x_list.

double CubicSpline::getFunctionValue (  )  [virtual, inherited]

Gets the function value at the last evaluated point.

Returns:
function value.

Implements FunctionR1toR1.

Definition at line 454 of file CubicSpline.cpp.

References CubicSpline::f.

Referenced by QMCNuclearForces::initialize().

double CubicSpline::getFirstDerivativeValue (  )  [virtual, inherited]

Gets the function's first deriviate at the last evaluated point.

Returns:
function's deriviative value.

Implements FunctionR1toR1.

Definition at line 459 of file CubicSpline.cpp.

References CubicSpline::dfdx.

double CubicSpline::getSecondDerivativeValue (  )  [virtual, inherited]

Gets the function's second deriviative at the last evaluated point.

Returns:
function's second derivative value.

Implements FunctionR1toR1.

Definition at line 464 of file CubicSpline.cpp.

References CubicSpline::ddfddx.

double CubicSpline::integrate ( int  indexStart,
int  indexStop 
) [inherited]

This function will integrate the spline between two indices.

Parameters:
indexStart 
indexStop 

Definition at line 392 of file CubicSpline.cpp.

References a0, CubicSpline::a0_list, CubicSpline::a1_list, CubicSpline::a2_list, CubicSpline::a3_list, CubicSpline::n, and CubicSpline::x_list.

Referenced by QMCNuclearForces::calcCoefficients(), and QMCNuclearForces::initialize().

void CubicSpline::toXML ( ostream &  strm  )  [inherited]

Writes the state of this object to an XML stream.

Parameters:
strm XML stream

Definition at line 469 of file CubicSpline.cpp.

References CubicSpline::a0_list, CubicSpline::a1_list, CubicSpline::a2_list, CubicSpline::a3_list, CubicSpline::ddfddx, CubicSpline::dfdx, Array1D< T >::dim1(), CubicSpline::f, CubicSpline::x_list, CubicSpline::y_list, and CubicSpline::yp_list.

Referenced by operator<<().

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]

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().


Friends And Related Function Documentation

ostream& operator<< ( ostream &  strm,
CubicSpline rhs 
) [friend, inherited]

Writes the state of this object to an XML stream.

Definition at line 527 of file CubicSpline.cpp.


Member Data Documentation


The documentation for this class was generated from the following files:

Generated on Sat Jul 5 16:14:01 2008 for QMcBeaver by  doxygen 1.5.6