LinearInterpolator (Apache Commons Math 3.6.1 API)

org.apache.commons.math3.analysis.interpolation

## Class LinearInterpolator

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

- All Implemented Interfaces:
    UnivariateInterpolator

      public class LinearInterpolator
      extends Object
      implements UnivariateInterpolator

  Implements a linear function for interpolation of real univariate functions.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinearInterpolator()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PolynomialSplineFunction` | `interpolate(double[] x, double[] y)` Computes a linear 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

    - #### LinearInterpolator

          public LinearInterpolator()

  - ### Method Detail

    - #### interpolate

          public PolynomialSplineFunction interpolate(double[] x,
                                             double[] y)
                                               throws DimensionMismatchException,
                                                      NumberIsTooSmallException,
                                                      NonMonotonicSequenceException

      Computes a linear interpolating function for the data set.
      Specified by:
        `interpolate` in interface `UnivariateInterpolator`
      Parameters:
        `x` - the arguments for the interpolation points
        `y` - the values for the interpolation points
      Returns:
        a function which interpolates the data set
      Throws:
        `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 2.

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