org.jrobin.data
public class CubicSplineInterpolator extends Plottable
WARNING: So far, this class cannot handle NaN datasource values (an exception will be thrown by the constructor). Future releases might change this.
Constructor Summary | |
---|---|
CubicSplineInterpolator(long[] timestamps, double[] values)
Creates cubic spline interpolator from arrays of timestamps and corresponding
datasource values.
| |
CubicSplineInterpolator(Date[] dates, double[] values)
Creates cubic spline interpolator from arrays of Date objects and corresponding
datasource values.
| |
CubicSplineInterpolator(Calendar[] dates, double[] values)
Creates cubic spline interpolator from arrays of GregorianCalendar objects and corresponding
datasource values.
| |
CubicSplineInterpolator(double[] x, double[] y)
Creates cubic spline interpolator for an array of 2D-points.
|
Method Summary | |
---|---|
double | getValue(double xval)
Calculates spline-interpolated y-value for the corresponding x-value. |
double | getValue(long timestamp)
Method overriden from the base class. |
Parameters: timestamps timestamps in seconds values corresponding datasource values
Throws: RrdException Thrown if supplied arrays do not contain at least 3 values, or if timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN.
Parameters: dates Array of Date objects values corresponding datasource values
Throws: RrdException Thrown if supplied arrays do not contain at least 3 values, or if timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN.
Parameters: dates Array of GregorianCalendar objects values corresponding datasource values
Throws: RrdException Thrown if supplied arrays do not contain at least 3 values, or if timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN.
Parameters: x x-axis point coordinates y y-axis point coordinates
Throws: RrdException Thrown if supplied arrays do not contain at least 3 values, or if timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN.
Parameters: xval x-value
Returns: inteprolated y-value
Parameters: timestamp timestamp in seconds
Returns: inteprolated datasource value