public abstract class Spline extends Object implements Serializable, Cloneable
A univariate piecewise polynomial (function) p(x) is specified by giving
its breakpoint sequence
,
the order k (degree k-1) of its polynomial pieces,
and the
matrix
c of its local polynomial coefficients.
In terms of this information,
the piecewise polynomial (ppoly) function is given by
![]()
| Modifier and Type | Field and Description |
|---|---|
protected double[] |
breakPoint
The breakpoint array of length n, where
n is the number of piecewise polynomials.
|
protected double[][] |
coef
Coefficients of the piecewise polynomials.
|
protected static double |
EPSILON_LARGE
The largest relative spacing for double.
|
| Constructor and Description |
|---|
Spline() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
copyAndSortData(double[] xData,
double[] yData)
Copy and sort xData into breakPoint and yData into the first
column of coef.
|
protected void |
copyAndSortData(double[] xData,
double[] yData,
double[] weight)
Copy and sort xData into breakPoint and yData into the first
column of coef.
|
double |
derivative(double x)
Returns the value of the first derivative of the spline
at a point.
|
double[] |
derivative(double[] x,
int ideriv)
Returns the value of the derivative of the spline
at each point of an array.
|
double |
derivative(double x,
int ideriv)
Returns the value of the derivative of the spline
at a point.
|
double[] |
getBreakpoints()
Returns a copy of the breakpoints.
|
double |
integral(double a,
double b)
Returns the value of an integral of the spline.
|
double |
value(double x)
Returns the value of the spline at a point.
|
double[] |
value(double[] x)
Returns the value of the spline at each point of an array.
|
protected double[] breakPoint
protected double[][] coef
coef[i] contains the coefficients for the
piecewise polynomial valid in the interval
[x[k],x[k+1]).
protected static final double EPSILON_LARGE
protected void copyAndSortData(double[] xData,
double[] yData)
protected void copyAndSortData(double[] xData,
double[] yData,
double[] weight)
public double derivative(double x)
x - a double, the point at which the derivative is to be evaluateddouble containing the value of the first derivative of the
spline at the point xpublic double[] derivative(double[] x,
int ideriv)
x - a double array of points at which the derivative is to be evaluatedideriv - an int specifying the derivative to be computed.
If zero, the function value is returned.
If one, the first derivative is returned, etc.double array containing the value of the derivative of the
spline at each point of the array xpublic double derivative(double x,
int ideriv)
x - a double, the point at which the derivative is to be evaluatedideriv - an int specifying the derivative to be computed.
If zero, the function value is returned.
If one, the first derivative is returned, etc.double containing the value of the derivative of the
spline at the point xpublic double[] getBreakpoints()
double array containing a copy of the breakpointspublic double integral(double a,
double b)
a - a double specifying the lower limit of integrationb - a double specifying the upper limit of integrationdouble, the integral of the spline from a to bpublic double value(double x)
x - a double, the point at which the spline is to be evaluateddouble giving the value of the spline at the point xpublic double[] value(double[] x)
x - a double array of points at which the spline is to be evaluateddouble array containing the value of the spline at each
point of the array xCopyright © 1970-2015 Rogue Wave Software
Built March 24 2015.