JDFTx  1.7.0
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

◆ deriv()

__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)

◆ getCoeff()

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.

◆ value()

__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)

◆ valueGrad()

__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