Class UnivariatePeriodicInterpolator
- java.lang.Object
-
- org.hipparchus.analysis.interpolation.UnivariatePeriodicInterpolator
-
- All Implemented Interfaces:
UnivariateInterpolator
public class UnivariatePeriodicInterpolator extends Object implements UnivariateInterpolator
Adapter for classes implementing theUnivariateInterpolator
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 Description static int
DEFAULT_EXTEND
Default number of extension points of the samples array.
-
Constructor Summary
Constructors Constructor Description UnivariatePeriodicInterpolator(UnivariateInterpolator interpolator, double period)
Builds an interpolator.UnivariatePeriodicInterpolator(UnivariateInterpolator interpolator, double period, int extend)
Builds an interpolator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnivariateFunction
interpolate(double[] xval, double[] yval)
Compute an interpolating function for the dataset.
-
-
-
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 originalinterpolator
needs on each side of the interpolated point.
-
UnivariatePeriodicInterpolator
public UnivariatePeriodicInterpolator(UnivariateInterpolator interpolator, double period)
Builds an interpolator. UsesDEFAULT_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 MathIllegalArgumentException
Compute an interpolating function for the dataset.- Specified by:
interpolate
in interfaceUnivariateInterpolator
- Parameters:
xval
- Arguments for the interpolation points.yval
- Values for the interpolation points.- Returns:
- a function which interpolates the dataset.
- Throws:
MathIllegalArgumentException
- if the number of extension points is larger than the size ofxval
.
-
-