Package xal.extension.fit.spline
Class CubicSpline
java.lang.Object
xal.extension.fit.spline.CubicSpline
-
Constructor Summary
ConstructorsConstructorDescriptionCubicSpline
(double[] xx, double[] y) constructor which takes only the data points fp0 - the slope at the starting point assumed = 0. fpn - the slope at the end point assumed = 0.CubicSpline
(double[] xx, double[] y, double fp0, double fpn) constructor which also takes initial and final slope constraintsconstructor of a new spline from another one -
Method Summary
Modifier and TypeMethodDescriptionvoid
Differentiates a spline in place.double
evaluateAt
(double xx) method to return an interpolated result at a given x valuevoid
Integrates a spline in place.
-
Constructor Details
-
CubicSpline
constructor of a new spline from another one -
CubicSpline
public CubicSpline(double[] xx, double[] y, double fp0, double fpn) constructor which also takes initial and final slope constraints- Parameters:
xx
- - the data X valuesy
- - the data Y valuesfp0
- - the slope at the starting pointfpn
- - the slope at the end point
-
CubicSpline
public CubicSpline(double[] xx, double[] y) constructor which takes only the data points fp0 - the slope at the starting point assumed = 0. fpn - the slope at the end point assumed = 0.- Parameters:
xx
- - the data X valuesy
- - the data Y values
-
-
Method Details
-
evaluateAt
public double evaluateAt(double xx) method to return an interpolated result at a given x value- Parameters:
xx
- - the x value to evaluate the interpolation at If x is outside the parameter rage - set return value = end point
-
differentiate
public void differentiate()Differentiates a spline in place. After calling this routine, a calls to evaluateAt() return the derivative. -
integrate
public void integrate()Integrates a spline in place. After calling this routine, a calls to evaluateAt() return the integral. The constant of integration is chosen such that i(0) = 0.0;
-