|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
Base class for the linear and cubic interpolation spline classes. More...
#include <AbstractSpline.h>


Classes | |
| class | Accelerator |
| Accelerator caching last interval indices. More... | |
Public Member Functions | |
| AbstractSpline ()=default | |
| Default constructor. | |
| virtual | ~AbstractSpline ()=default |
| Polymorphic destructor. | |
| virtual void | init (const std::vector< double > &x, const std::vector< double > &y) |
| Initialize from tabulated data (natural spline). | |
| virtual double | eval (double x, Accelerator &accel) const =0 |
| Evaluate the spline at x using an accelerator. | |
| virtual double | evalIntegral (double xa, double xb, Accelerator &accel) const =0 |
Evaluate the integral of the spline at x. | |
Protected Member Functions | |
| size_t | findInterval (double x, size_t &intervalCache) const |
| Return the interval index for the given x-coordinate, using the supplied cached value if possible. | |
Protected Attributes | |
| std::vector< double > | x_ {} |
| std::vector< double > | y_ {} |
Base class for the linear and cubic interpolation spline classes.
Definition at line 25 of file AbstractSpline.h.
|
default |
Default constructor.
|
virtualdefault |
Polymorphic destructor.
|
pure virtual |
Evaluate the spline at x using an accelerator.
| x | Input: x-coordinate. |
| accel | Input/Output: cached interval index. |
Implemented in CubicSpline, and LinearSpline.
Referenced by gsl_spline_eval().
|
pure virtual |
Evaluate the integral of the spline at x.
| xa | Input: x-coordinate lower bound. |
| xb | Input: x-coordinate upper bound. |
| accel | Input/output: accelerator for interval caching. |
Implemented in CubicSpline, and LinearSpline.
Referenced by gsl_spline_eval_integ().
|
protected |
Return the interval index for the given x-coordinate, using the supplied cached value if possible.
| x | Input: x-coordinate. |
| intervalCache | Input/output: The cached interval index. |
Definition at line 39 of file AbstractSpline.cpp.
References x_.
Referenced by CubicSpline::eval(), LinearSpline::eval(), CubicSpline::evalIntegral(), and LinearSpline::evalIntegral().
|
virtual |
Initialize from tabulated data (natural spline).
| x | Input: strictly increasing x-coordinates. |
| y | Input: y-values corresponding to x. |
Reimplemented in CubicSpline, and LinearSpline.
Definition at line 22 of file AbstractSpline.cpp.
Referenced by gsl_spline_init(), CubicSpline::init(), and LinearSpline::init().
|
protected |
Definition at line 73 of file AbstractSpline.h.
Referenced by CubicSpline::computeCoefficients(), LinearSpline::computeCoefficients(), CubicSpline::computeIntegrals(), LinearSpline::computeIntegrals(), CubicSpline::eval(), LinearSpline::eval(), CubicSpline::evalIntegral(), LinearSpline::evalIntegral(), CubicSpline::extrapolateLeft(), CubicSpline::extrapolateRight(), findInterval(), init(), and LinearSpline::integral().
|
protected |
Definition at line 74 of file AbstractSpline.h.
Referenced by CubicSpline::computeCoefficients(), LinearSpline::computeCoefficients(), CubicSpline::eval(), CubicSpline::evalIntegral(), LinearSpline::evalIntegral(), CubicSpline::extrapolateLeft(), CubicSpline::extrapolateRight(), init(), and CubicSpline::integral().