Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.math.analysis
Class SplineInterpolator

    java.lang.Object
      org.apache.commons.math.analysis.SplineInterpolator

All Implemented Interfaces:
  UnivariateRealInterpolator

public class SplineInterpolator
extends Object
implements UnivariateRealInterpolator

Computes a natural (a.k.a. "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:

1. The value of the PolynomialSplineFunction at each of the input x values equals the corresponding y value.
2. Adjacent polynomials are equal through two derivatives at the knot points (i.e., adjacent polynomials "match up" at the knot points, as do their first and second derivatives).

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.

Version:
  $Revision: 1.19 $ $Date: 2004/06/23 16:26:14 $

Constructor Summary
`SplineInterpolator()`

Method Summary
`UnivariateRealFunction` | `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

### SplineInterpolator

    public SplineInterpolator()

Method Detail

### interpolate

    public UnivariateRealFunction interpolate(double[] x,
                                              double[] y)

  Computes an interpolating function for the data set.

  Specified by:
    `interpolate` in interface `UnivariateRealInterpolator`
  Parameters:
    `x` - the arguments for the interpolation points
    `y` - the values for the interpolation points
  Returns:
    a function which interpolates the data set

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.