|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.math3.analysis.interpolation.SplineInterpolator
public class SplineInterpolator
Computes a natural (also known as "free", "unclamped") cubic spline interpolation for the data set.
The interpolate(double[], double[])
method returns a PolynomialSplineFunction
consisting of n cubic polynomials, defined over the subintervals determined by the x values,
x[0] < x[i] ... < x[n]. The x values are referred to as "knot points."
The value of the PolynomialSplineFunction at a point x that is greater than or equal to the smallest
knot point and strictly less than the largest knot point is computed by finding the subinterval to which
x belongs and computing the value of the corresponding polynomial at x - x[i]
where
i
is the index of the subinterval. See PolynomialSplineFunction
for more details.
The interpolating polynomials satisfy:
The cubic spline interpolation algorithm implemented is as described in R.L. Burden, J.D. Faires, Numerical Analysis, 4th Ed., 1989, PWS-Kent, ISBN 0-53491-585-X, pp 126-131.
Constructor Summary | |
---|---|
SplineInterpolator()
|
Method Summary | |
---|---|
PolynomialSplineFunction |
interpolate(double[] x,
double[] y)
Computes an interpolating function for the data set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SplineInterpolator()
Method Detail |
---|
public PolynomialSplineFunction interpolate(double[] x, double[] y) throws DimensionMismatchException, NumberIsTooSmallException, NonMonotonicSequenceException
interpolate
in interface UnivariateInterpolator
x
- the arguments for the interpolation pointsy
- the values for the interpolation points
DimensionMismatchException
- if x
and y
have different sizes.
NonMonotonicSequenceException
- if x
is not sorted in
strict increasing order.
NumberIsTooSmallException
- if the size of x
is smaller
than 3.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |