org.apache.commons.math3.analysis.interpolation

## Class UnivariatePeriodicInterpolator

- java.lang.Object
- - org.apache.commons.math3.analysis.interpolation.UnivariatePeriodicInterpolator

- All Implemented Interfaces:
    UnivariateInterpolator

      public class UnivariatePeriodicInterpolator
      extends Object
      implements UnivariateInterpolator

  Adapter for classes implementing the `UnivariateInterpolator` interface. The data to be interpolated is assumed to be periodic. Thus values that are outside of the range can be passed to the interpolation function: They will be wrapped into the initial range before being passed to the class that actually computes the interpolation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_EXTEND` Default number of extension points of the samples array.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnivariatePeriodicInterpolator(UnivariateInterpolator interpolator, double period)` Builds an interpolator.
    `UnivariatePeriodicInterpolator(UnivariateInterpolator interpolator, double period, int extend)` Builds an interpolator.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `UnivariateFunction` | `interpolate(double[] xval, double[] yval)` Compute an interpolating function for the dataset.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_EXTEND

          public static final int DEFAULT_EXTEND

      Default number of extension points of the samples array.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### UnivariatePeriodicInterpolator

          public UnivariatePeriodicInterpolator(UnivariateInterpolator interpolator,
                                        double period,
                                        int extend)

      Builds an interpolator.
      Parameters:
        `interpolator` - Interpolator.
        `period` - Period.
        `extend` - Number of points to be appended at the beginning and end of the sample arrays in order to avoid interpolation failure at the (periodic) boundaries of the orginal interval. The value is the number of sample points which the original `interpolator` needs on each side of the interpolated point.

    - #### UnivariatePeriodicInterpolator

          public UnivariatePeriodicInterpolator(UnivariateInterpolator interpolator,
                                        double period)

      Builds an interpolator. Uses `DEFAULT_EXTEND` as the number of extension points on each side of the original abscissae range.
      Parameters:
        `interpolator` - Interpolator.
        `period` - Period.

  - ### Method Detail

    - #### interpolate

          public UnivariateFunction interpolate(double[] xval,
                                       double[] yval)
                                         throws NumberIsTooSmallException,
                                                NonMonotonicSequenceException

      Compute an interpolating function for the dataset.
      Specified by:
        `interpolate` in interface `UnivariateInterpolator`
      Parameters:
        `xval` - Arguments for the interpolation points.
        `yval` - Values for the interpolation points.
      Returns:
        a function which interpolates the dataset.
      Throws:
        `NumberIsTooSmallException` - if the number of extension points is larger than the size of `xval`.
        `NonMonotonicSequenceException`

Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.