Top Description Fields Constructors Methods
org.apache.commons.math3.analysis.interpolation

public Class UnivariatePeriodicInterpolator

extends Object
implements UnivariateInterpolator
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.analysis.interpolation.UnivariateInterpolator
Imports
org.apache.commons.math3.analysis.UnivariateFunction, org.apache.commons.math3.util.MathUtils, .MathArrays, org.apache.commons.math3.exception.MathIllegalArgumentException, .NonMonotonicSequenceException, .NumberIsTooSmallException

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

Modifier and TypeField and Description
public static final int
DEFAULT_EXTEND

Default number of extension points of the samples array.

private final int
extend

Number of extension points.

private final UnivariateInterpolator
interpolator

Interpolator.

private final double
period

Period.

Constructor Summary

AccessConstructor and Description
public
UnivariatePeriodicInterpolator(UnivariateInterpolator
Interpolator.
interpolator
,
double
Period.
period
,
int
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.
extend
)

Builds an interpolator.

public
UnivariatePeriodicInterpolator(UnivariateInterpolator
Interpolator.
interpolator
,
double
Period.
period
)

Builds an interpolator.

Method Summary

Modifier and TypeMethod and Description
public UnivariateFunction
interpolate(double[]
Arguments for the interpolation points.
xval
,
double[]
Values for the interpolation points.
yval
)

Implements org.apache.commons.math3.analysis.interpolation.UnivariateInterpolator.interpolate.

Compute an interpolating function for the dataset.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_EXTENDback to summary
public static final int DEFAULT_EXTEND

Default number of extension points of the samples array.

extendback to summary
private final int extend

Number of extension points.

interpolatorback to summary
private final UnivariateInterpolator interpolator

Interpolator.

periodback to summary
private final double period

Period.

Constructor Detail

UnivariatePeriodicInterpolatorback to summary
public UnivariatePeriodicInterpolator(UnivariateInterpolator interpolator, double period, int extend)

Builds an interpolator.

Parameters
interpolator:UnivariateInterpolator

Interpolator.

period:double

Period.

extend:int

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.

UnivariatePeriodicInterpolatorback to summary
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:UnivariateInterpolator

Interpolator.

period:double

Period.

Method Detail

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

Implements org.apache.commons.math3.analysis.interpolation.UnivariateInterpolator.interpolate.

Doc from org.apache.commons.math3.analysis.interpolation.UnivariateInterpolator.interpolate.

Compute an interpolating function for the dataset.

Parameters
xval:double[]

Arguments for the interpolation points.

yval:double[]

Values for the interpolation points.

Returns:UnivariateFunction

a function which interpolates the dataset.

Exceptions
NumberIsTooSmallException:
if the number of extension points is larger than the size of xval.