JDFTx  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QuinticSpline Namespace Reference

C4-continuous interpolation using quintic splines. More...

Functions

std::vector< double > getCoeff (const std::vector< double > &samples, bool oddExtension=false)
 Generate quintic spline coefficients for a set of uniformly-spaced samples. More...
 
__hostanddev__ double value (const double *coeff, double x)
 Compute value of quintic spline. Warning: x is not range-checked. More...
 
__hostanddev__ double deriv (const double *coeff, double x)
 Compute derivative (w.r.t x) of quintic spline. Warning: x is not range-checked. More...
 
__hostanddev__ void valueGrad (double E_value, double *E_coeff, double x)
 Gradient propagation corresponding to value() More...
 

Detailed Description

C4-continuous interpolation using quintic splines.

Function Documentation

__hostanddev__ double QuinticSpline::deriv ( const double *  coeff,
double  x 
)

Compute derivative (w.r.t x) of quintic spline. Warning: x is not range-checked.

Parameters
coeffpointer to coefficient array generated by getCoeff
xlocation to evaluate spline in the continuous range [0, nCoeff-1)
std::vector<double> QuinticSpline::getCoeff ( const std::vector< double > &  samples,
bool  oddExtension = false 
)

Generate quintic spline coefficients for a set of uniformly-spaced samples.

Parameters
samplesAn array of uniformly-spaced samples
oddExtensionThe boundary condition at the first sample is odd/even for oddExtension=true/false respectively. Natural boundary conditions (third and fourth derivatives zero) are imposed on the last sample.
__hostanddev__ double QuinticSpline::value ( const double *  coeff,
double  x 
)

Compute value of quintic spline. Warning: x is not range-checked.

Parameters
coeffpointer to coefficient array generated by getCoeff
xlocation to evaluate spline in the continuous range [0, nCoeff-1)
__hostanddev__ void QuinticSpline::valueGrad ( double  E_value,
double *  E_coeff,
double  x 
)

Gradient propagation corresponding to value()

Parameters
E_valueInput derivative with respect to value
E_coeff