|
|
◆ fitlag()
| double fitlag |
( |
double |
x, |
|
|
int |
n, |
|
|
double |
a[], |
|
|
double |
f[], |
|
|
int |
m, |
|
|
double |
eps, |
|
|
int * |
info |
|
) |
| |
Iterated Lagrange interpolation
- Purpose
- This routine routine computes the interpolated value using the data table by iterative Lagrange interpolation.
Lagrange interpolation is computed using nearest sample points to the target point. Starting from two points, interpolation is automatically iterated by increasing number of points used for computation until the required tolerance is satisfied.
- Returns
- The interpolated value at x.
- Parameters
-
| [in] | x | Abscissa at which the interpolated value is to be computed. |
| [in] | n | Number of data given in the table. (n > 0) |
| [in] | a[] | Array a[la] (la >= n)
Sampling points. Elements of a[] must be in ascending order. |
| [in] | f[] | Array f[lf] (lf >= n)
Data at sampling points a[]. |
| [in] | m | Number of sampling points to be used in both sides of x for interpolation. (1 <= m <= 5) |
| [in] | eps | Absolute error tolerance. (eps > 0)
If eps <= 0 then eps = DBL_EPSILON is assumed. |
| [out] | info | = 0: Successful exit.
= -2: The argument n had an illegal value (n <= 0).
= -5: The argument m had an illegal value (m < 1 or m > 5).
= 1: x is outside the range of sample points (computation to be continued).
= 2: Not converged (given error tolerance not satisfied). |
- Reference
- (Japanese book) Masatake Mori "FORTRAN77 Numerical Calculation Programming (augmented edition)" Iwanami Shoten (1987)
|