d02uwf interpolates from a set of function values on a supplied grid onto a set of values for a uniform grid on the same range. The interpolation is performed using barycentric Lagrange interpolation. d02uwf is primarily a utility routine to map a set of function values specified on a Chebyshev Gauss–Lobatto grid onto a uniform grid.
The routine may be called by the names d02uwf or nagf_ode_bvp_ps_lin_grid_vals.
d02uwf interpolates from a set of function values, , on a supplied grid, , for , onto a set of values, , on a uniform grid, , for . The image has the same range as , so that , for . The interpolation is performed using barycentric Lagrange interpolation as described in Berrut and Trefethen (2004).
d02uwf is primarily a utility routine to map a set of function values specified on a Chebyshev Gauss–Lobatto grid computed by d02ucf onto an evenly-spaced grid with the same range as the original grid.
Berrut J P and Trefethen L N (2004) Barycentric lagrange interpolation SIAM Rev.46(3) 501–517
1: – IntegerInput
On entry: , where the number of grid points for the input data is .
On entry: the number, , of grid points in the uniform mesh onto which function values are interpolated. If then on successful exit from d02uwf, will contain the value .
3: – Real (Kind=nag_wp) arrayInput
On entry: the grid points,
, for , at which the function is specified.
Usually this should be the array of Chebyshev Gauss–Lobatto points returned in d02ucf.
4: – Real (Kind=nag_wp) arrayInput
On entry: the function values,
, for .
5: – Real (Kind=nag_wp) arrayOutput
On exit: the evenly-spaced grid points,
, for .
6: – Real (Kind=nag_wp) arrayOutput
On exit: the set of interpolated values
, for . Here .
7: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
d02uwf is intended, primarily, for use with Chebyshev Gauss–Lobatto input grids. For such input grids and for well-behaved functions (no discontinuities, peaks or cusps), the accuracy should be a small multiple of machine precision.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
d02uwf is not threaded in any implementation.
This example interpolates the function , as specified on a -point Gauss–Lobatto grid on , onto a coarse uniform grid.