org.apache.commons.math.analysis.interpolation
Class UnivariateRealPeriodicInterpolator

java.lang.Object
  extended by org.apache.commons.math.analysis.interpolation.UnivariateRealPeriodicInterpolator
All Implemented Interfaces:
UnivariateRealInterpolator

public class UnivariateRealPeriodicInterpolator
extends java.lang.Object
implements UnivariateRealInterpolator

Adapter for classes implementing the UnivariateRealInterpolator 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.

Version:
$Id$

Field Summary
static int DEFAULT_EXTEND
          Default number of extension points of the samples array.
 
Constructor Summary
UnivariateRealPeriodicInterpolator(UnivariateRealInterpolator interpolator, double period)
          Builds an interpolator.
UnivariateRealPeriodicInterpolator(UnivariateRealInterpolator interpolator, double period, int extend)
          Builds an interpolator.
 
Method Summary
 UnivariateRealFunction 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

UnivariateRealPeriodicInterpolator

public UnivariateRealPeriodicInterpolator(UnivariateRealInterpolator 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.

UnivariateRealPeriodicInterpolator

public UnivariateRealPeriodicInterpolator(UnivariateRealInterpolator 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 UnivariateRealFunction interpolate(double[] xval,
                                          double[] yval)
Compute an interpolating function for the dataset.

Specified by:
interpolate in interface UnivariateRealInterpolator
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 iss larger then the size of xval.


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.