Class UnivariatePeriodicInterpolator
java.lang.Object
org.hipparchus.analysis.interpolation.UnivariatePeriodicInterpolator
- All Implemented Interfaces:
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
Modifier and TypeFieldDescriptionstatic final int
Default number of extension points of the samples array. -
Constructor Summary
ConstructorDescriptionUnivariatePeriodicInterpolator
(UnivariateInterpolator interpolator, double period) Builds an interpolator.UnivariatePeriodicInterpolator
(UnivariateInterpolator interpolator, double period, int extend) Builds an interpolator. -
Method Summary
Modifier and TypeMethodDescriptioninterpolate
(double[] xval, double[] yval) Compute an interpolating function for the dataset.
-
Field Details
-
DEFAULT_EXTEND
public static final int DEFAULT_EXTENDDefault number of extension points of the samples array.- See Also:
-
-
Constructor Details
-
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
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 Details
-
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
.
-