XLPack 6.1
Julia API Reference Manual
Loading...
Searching...
No Matches

◆ pchfe()

function pchfe ( n::Integer  ,
x::Array{Float64}  ,
f::Array{Float64}  ,
d::Array{Float64}  ,
ne::Integer  ,
xe::Array{Float64}  ,
fe::Array{Float64}  ,
incfd::Integer  = 1,
skip::Bool(keyword argument)  = false 
)

Evaluation of function values for piecewise cubic Hermite (and cubic spline) interpolation

Purpose
pchfe evaluates a piecewise cubic Hermite function at an array of points. May be used by itself for Hermite interpolation, or as an evaluator for pchim, pchic, pchsp or pchse.
Returns
info (Int32)
= 0: Successful exit
= -1: The argument n had an illegal value (n < 2)
= -2: The argument x is invalid (e.g. not strictly increasing)
= -3: The argument f is invalid
= -4: The argument d is invalid
= -5: The argument incfd had an illegal value (incfd < 1)
= -6: The argument skip had an illegal value (skip != 0 and skip != 1)
= -7: The argument ne had an illegal value (ne < 1)
= -8: The argument xe is invalid
= -9: The argument fe is invalid
= i > 0: Extrapolation was performed at i points
Parameters
[in]nNumber of data points. (n >= 2)
[in]x1-dimensional array (Float64, n)
Independent variable values. The elements of x[] must be strictly increasing.
[in]f1-dimensional array (Float64, incfd*(n - 1) + 1)
Function values. f[i*incfd] is the value corresponding to x[i] (i = 0 to n - 1).
[in]d1-dimensional array (Float64, length incfd*(n - 1) + 1)
Derivative values. d[i*incfd] is the value corresponding to x[i] (i = 0 to n - 1).
[in]neNumber of evaluation points. (ne >= 1)
[in]xe1-dimensional array (Float64, ne)
Points at which the function is to be evaluated.
Notes:
  1. The evaluation will be most efficient if the elements of xe are increasing relative to x; that is, xe[j] >= x[i] implies xe[k] >= x[i], all k >= j.
  2. If any of the xe[] are outside the interval [ x[0], x[n-1] ], values are extrapolated from the nearest extreme cubic, and a warning error is returned.
[out]fe1-dimensional array (Float64, ne)
Values of the cubic Hermite function defined by n, x, f, d at the points xe.
[in]incfd(Optional)
Increment between successive values in f and d. (incfd >= 1) (default = 1)
[in]skip(Optional (keyword argument))
Logical variable which should be set to true if the user wishes to skip checks for validity of preceding parameters, or to false otherwise. This will save time in case these checks have already been performed (say, in pchim, pchic, pchsp or pchse). (default = false)
Reference
SLATEC (PCHIP)
Example Program
See example of pchse.