PLUTO
4.4-patch2
|
Miscellaneous functions for handling interpolation. More...
#include "pluto.h"
Functions | |
void | MonotoneSplineCoeffs (double *x, double *y, double *dydx, int n, double *a, double *b, double *c, double *d) |
void | SplineCoeffs (double *x, double *f, double dfL, double dfR, int n, double *a, double *b, double *c, double *d) |
void MonotoneSplineCoeffs | ( | double * | x, |
double * | y, | ||
double * | dydx, | ||
int | n, | ||
double * | a, | ||
double * | b, | ||
double * | c, | ||
double * | d | ||
) |
Compute the cubic spline coefficients for interpolating a monotonic dataset known at node values f[k] = f(x[k]) and derivative dfdx(x[k]). The resulting spline will be the smoothest curve that passes through the control points while preserving monotonocity of the dataset but not necessarily continuity of the second derivative. Coefficients will be computed in each interval x[k] < x < x[k+1].
The x[k] may not be equally spaced.
[in] | x | 1D array of abscissas |
[in] | f | 1D array of function values |
[in] | dfdx | 1D array of function derivative |
[in] | n | the number of function values. |
[out] | a | the x^3 cubic coefficient |
[out] | b | the x^2 cubic coefficient |
[out] | c | the x cubic coefficient |
[out] | d | the (1) cubic coefficient |
Reference:
void SplineCoeffs | ( | double * | x, |
double * | f, | ||
double | dfL, | ||
double | dfR, | ||
int | n, | ||
double * | a, | ||
double * | b, | ||
double * | c, | ||
double * | d | ||
) |
Compute the cubic spline coefficients for interpolating a dataset (not necessarily monotonic) known at node values f[k] = f(x[k]). The resulting spline will be continuous up to the second derivative. Coefficients will be computed in each interval x[k] < x < x[k+1].
The x[k] may not be equally spaced.
[in] | x | 1D array of abscissas |
[in] | f | 1D array of function values |
[in] | dfL | derivative at the leftmost node |
[in] | dfR | derivative at the rightmost node |
[in] | n | the number of function values. |
[out] | a | the x^3 cubic coefficient |
[out] | b | the x^2 cubic coefficient |
[out] | c | the x cubic coefficient |
[out] | d | the (1) cubic coefficient |
Reference: