d02uwc 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. d02uwc is primarily a utility function to map a set of function values specified on a Chebyshev Gauss–Lobatto grid onto a uniform grid.
The function may be called by the names: d02uwc or nag_ode_bvp_ps_lin_grid_vals.
3Description
d02uwc 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).
d02uwc is primarily a utility function to map a set of function values specified on a Chebyshev Gauss–Lobatto grid computed by d02ucc onto an evenly-spaced grid with the same range as the original grid.
4References
Berrut J P and Trefethen L N (2004) Barycentric lagrange interpolation SIAM Rev.46(3) 501–517
5Arguments
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 d02uwc, will contain the value .
Constraint:
.
3: – const doubleInput
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 d02ucc.
4: – const doubleInput
On entry: the function values,
, for .
5: – doubleOutput
On exit: the evenly-spaced grid points,
, for .
6: – doubleOutput
On exit: the set of interpolated values
, for . Here .
7: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
7Accuracy
d02uwc 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.
d02uwc is not threaded in any implementation.
9Further Comments
None.
10Example
This example interpolates the function , as specified on a -point Gauss–Lobatto grid on , onto a coarse uniform grid.