This header covers the routines for interpolation.
The routine LALSPolynomialInterpolation() computes the interpolated \(y\) value output at the \(x\) value target by fitting a polynomial of order params.n-1 to the data. The result output is of type SInterpolateOut, which contains the value output.y as well as an estimate of the error output.dy. The routine LALDPolynomialInterpolation() is the same but for double precision.
The following program fits a fourth-order polynomial to the five data points \(\{(0,0),(1,1),(2,3),(3,4),(4,3)\}\), and interpolates the value at \(x=2.4\).
This is an implementation of the Neville algroithm, see polint in Numerical Recipes [22] .
Prototypes | |
| void | LALSPolynomialInterpolation (LALStatus *status, SInterpolateOut *output, REAL4 target, SInterpolatePar *params) |
| void | LALDPolynomialInterpolation (LALStatus *status, DInterpolateOut *output, REAL8 target, DInterpolatePar *params) |
| REAL8 | XLALREAL8PolynomialInterpolation (REAL8 *yout, REAL8 xtarget, REAL8 *y, REAL8 *x, UINT4 n) |
| int | XLALREAL8Interpolation (REAL8Sequence *x_in, REAL8Sequence *y_in, REAL8Sequence *x_out, REAL8Sequence *y_out, UINT4 n_data_points, const gsl_interp_type *itrp_type) |
| int | XLALREAL8TimeSeriesInterpolation (REAL8TimeSeries *ts_in, REAL8Sequence *y_in, REAL8Sequence *t_in, REAL8Sequence *t_out, UINT4 n_data_points, const gsl_interp_type *itrp_type) |
Data Structures | |
| struct | SInterpolateOut |
| These structures contain the output of the interpolation. More... | |
| struct | DInterpolateOut |
| These structures contain the output of the interpolation. More... | |
| struct | SInterpolatePar |
These structures contain the interpolation parameters; These are the arrays of n domain values \(x[0] \ldots x[n-1]\) and their corresponding values \(y[0] \ldots y[n-1]\). More... | |
| struct | DInterpolatePar |
These structures contain the interpolation parameters; These are the arrays of n domain values \(x[0]\ldots x[n-1]\) and their corresponding values \(y[0]\ldots y[n-1]\). More... | |
Files | |
| file | InterpolateTest.c |
| Tests the routines in Interpolate.h. | |
Error Codes | |
| #define | INTERPOLATEH_ENULL 1 |
| Null pointer. More... | |
| #define | INTERPOLATEH_ESIZE 2 |
| Invalid size. More... | |
| #define | INTERPOLATEH_EZERO 4 |
| Zero divide. More... | |
| void LALSPolynomialInterpolation | ( | LALStatus * | status, |
| SInterpolateOut * | output, | ||
| REAL4 | target, | ||
| SInterpolatePar * | params | ||
| ) |
Definition at line 29 of file Interpolate.c.
| void LALDPolynomialInterpolation | ( | LALStatus * | status, |
| DInterpolateOut * | output, | ||
| REAL8 | target, | ||
| DInterpolatePar * | params | ||
| ) |
Definition at line 115 of file Interpolate.c.
| REAL8 XLALREAL8PolynomialInterpolation | ( | REAL8 * | yout, |
| REAL8 | xtarget, | ||
| REAL8 * | y, | ||
| REAL8 * | x, | ||
| UINT4 | n | ||
| ) |
Definition at line 140 of file Interpolate.c.
| int XLALREAL8Interpolation | ( | REAL8Sequence * | x_in, |
| REAL8Sequence * | y_in, | ||
| REAL8Sequence * | x_out, | ||
| REAL8Sequence * | y_out, | ||
| UINT4 | n_data_points, | ||
| const gsl_interp_type * | itrp_type | ||
| ) |
Definition at line 228 of file Interpolate.c.
| int XLALREAL8TimeSeriesInterpolation | ( | REAL8TimeSeries * | ts_in, |
| REAL8Sequence * | y_in, | ||
| REAL8Sequence * | t_in, | ||
| REAL8Sequence * | t_out, | ||
| UINT4 | n_data_points, | ||
| const gsl_interp_type * | itrp_type | ||
| ) |
Definition at line 282 of file Interpolate.c.
| #define INTERPOLATEH_ENULL 1 |
Null pointer.
Definition at line 91 of file Interpolate.h.
| #define INTERPOLATEH_ESIZE 2 |
Invalid size.
Definition at line 92 of file Interpolate.h.
| #define INTERPOLATEH_EZERO 4 |
Zero divide.
Definition at line 93 of file Interpolate.h.