e01bf evaluates a piecewise cubic Hermite interpolant at a set of points.
Syntax
C# |
---|
public static void e01bf( int n, double[] x, double[] f, double[] d, int m, double[] px, double[] pf, out int ifail ) |
Visual Basic |
---|
Public Shared Sub e01bf ( _ n As Integer, _ x As Double(), _ f As Double(), _ d As Double(), _ m As Integer, _ px As Double(), _ pf As Double(), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void e01bf( int n, array<double>^ x, array<double>^ f, array<double>^ d, int m, array<double>^ px, array<double>^ pf, [OutAttribute] int% ifail ) |
F# |
---|
static member e01bf : n : int * x : float[] * f : float[] * d : float[] * m : int * px : float[] * pf : float[] * ifail : int byref -> unit |
Parameters
- n
- Type: System..::..Int32An array of size []
- x
- Type: array<System..::..Double>[]()[][]An array of size []
- f
- Type: array<System..::..Double>[]()[][]An array of size []
- d
- Type: array<System..::..Double>[]()[][]An array of size []
- m
- Type: System..::..Int32On entry: , the number of points at which the interpolant is to be evaluated.Constraint: .
- px
- Type: array<System..::..Double>[]()[][]An array of size [m]On entry: the values of at which the interpolant is to be evaluated.
- pf
- Type: array<System..::..Double>[]()[][]An array of size [m]On exit: contains the value of the interpolant evaluated at the point , for .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
e01bf evaluates a piecewise cubic Hermite interpolant, as computed by e01be, at the points , for . If any point lies outside the interval from to , a value is extrapolated from the nearest extreme cubic, and a warning is returned.
The method is derived from method PCHFE in Fritsch (1982).
References
Fritsch F N (1982) PCHIP final specifications Report UCID-30194 Lawrence Livermore National Laboratory
Error Indicators and Warnings
Errors or warnings detected by the method:
On entry, .
- The values of , for , are not in strictly increasing order.
On entry, .
- At least one of the points , for , lies outside the interval [], and extrapolation was performed at all such points. Values computed at such points may be very unreliable.
Accuracy
The computational errors in the array pf should be negligible in most practical situations.
Parallelism and Performance
None.
Further Comments
The time taken by e01bf is approximately proportional to the number of evaluation points, . The evaluation will be most efficient if the elements of px are in nondecreasing order (or,
more generally, if they are grouped in increasing order of the intervals ). A single call of
e01bf with is more efficient than several calls with .
Example
This example reads in values of n, x, f and d, and then calls
e01bf to evaluate the interpolant at equally spaced points.
Example program (C#): e01bfe.cs