e01be computes a monotonicity-preserving piecewise cubic Hermite interpolant to a set of data points.

Syntax

C#
public static void e01be(
	int n,
	double[] x,
	double[] f,
	double[] d,
	out int ifail
)
Visual Basic
Public Shared Sub e01be ( _
	n As Integer, _
	x As Double(), _
	f As Double(), _
	d As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void e01be(
	int n, 
	array<double>^ x, 
	array<double>^ f, 
	array<double>^ d, 
	[OutAttribute] int% ifail
)
F#
static member e01be : 
        n : int * 
        x : float[] * 
        f : float[] * 
        d : float[] * 
        ifail : int byref -> unit 

Parameters

n
Type: System..::..Int32
On entry: n, the number of data points.
Constraint: n2.
x
Type: array<System..::..Double>[]()[][]
An array of size [n]
On entry: x[r-1] must be set to xr, the rth value of the independent variable (abscissa), for r=1,2,,n.
Constraint: x[r-1]<x[r].
f
Type: array<System..::..Double>[]()[][]
An array of size [n]
On entry: f[r-1] must be set to fr, the rth value of the dependent variable (ordinate), for r=1,2,,n.
d
Type: array<System..::..Double>[]()[][]
An array of size [n]
On exit: estimates of derivatives at the data points. d[r-1] contains the derivative at x[r-1].
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

e01be estimates first derivatives at the set of data points xr,fr, for r=1,2,,n, which determine a piecewise cubic Hermite interpolant to the data, that preserves monotonicity over ranges where the data points are monotonic. If the data points are only piecewise monotonic, the interpolant will have an extremum at each point where monotonicity switches direction. The estimates of the derivatives are computed by a formula due to Brodlie, which is described in Fritsch and Butland (1984), with suitable changes at the boundary points.
The method is derived from method PCHIM in Fritsch (1982).
Values of the computed interpolant, and of its first derivative and definite integral, can subsequently be computed by calling e01bf (E01BGF not in this release) (E01BHF not in this release), as described in [Further Comments].

References

Fritsch F N (1982) PCHIP final specifications Report UCID-30194 Lawrence Livermore National Laboratory
Fritsch F N and Butland J (1984) A method for constructing local monotone piecewise cubic interpolants SIAM J. Sci. Statist. Comput. 5 300–304

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry,n<2.
ifail=2
The values of x[r-1], for r=1,2,,n, are not in strictly increasing order.
ifail=-9000
An error occured, see message report.
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

The computational errors in the array d should be negligible in most practical situations.

Parallelism and Performance

None.

Further Comments

The time taken by e01be is approximately proportional to n.
The values of the computed interpolant at the points px[i-1], for i=1,2,,m, may be obtained in the real array pf, of length at least m, by the call: where nx and f are the input parameters to e01be and d is the output parameter from e01be.
The values of the computed interpolant at the points px[i-1], for i=1,2,,m, together with its first derivatives, may be obtained in the real arrays pf and pd, both of length at least m, by the call: where nxf and d are as described above.
The value of the definite integral of the interpolant over the interval a to b can be obtained in the real variable pint by the call: where nxf and d are as described above.

Example

See Also