Mir 1.0
Mir application programming interface

Data Structures

struct  mirml_nr_itpl_t_
 Interpolation structure. More...
 

Typedefs

typedef struct mirml_nr_itpl_t_ mirml_nr_itpl_t
 Interpolation structure.
 

Functions

mirkl_error_tmirml_nr_itpl_init_cspline (mirml_nr_itpl_t *itpl, double *x, double *y, double *y2, int n, double yp1, double ypn)
 Initialization of cubic spline interpolation. More...
 
void mirml_nr_itpl_free_cspline (mirml_nr_itpl_t *itpl)
 Free resources, which were possibly allocated for cubic spline interpolation. More...
 
mirkl_error_tmirml_nr_itpl_cspline (mirml_nr_itpl_t *itpl, double x, double *y)
 Interpolation using cubic spline. More...
 

Detailed Description

Function Documentation

◆ mirml_nr_itpl_cspline()

mirkl_error_t * mirml_nr_itpl_cspline ( mirml_nr_itpl_t itpl,
double  x,
double *  y 
)

Interpolation using cubic spline.

Parameters
[in]itplPointer to interpolation structure.
[in]xValue of argument, in which interpolation should be calculated.
[out]yCalculated interpolated value on output.
Note
Before calling this function the itpl structure should be initialized using mirml_nr_itpl_init_cspline().

◆ mirml_nr_itpl_free_cspline()

void mirml_nr_itpl_free_cspline ( mirml_nr_itpl_t itpl)

Free resources, which were possibly allocated for cubic spline interpolation.

Note
mirml_nr_itpl_init_cspline can allocated memory internally if its y2 argument was NULL.

◆ mirml_nr_itpl_init_cspline()

mirkl_error_t * mirml_nr_itpl_init_cspline ( mirml_nr_itpl_t itpl,
double *  x,
double *  y,
double *  y2,
int  n,
double  yp1,
double  ypn 
)

Initialization of cubic spline interpolation.

Parameters
[in]itplPointer to interpolation structure.
[in]xArray of argument values.
[in]yArray of function values.
[in]y2Preallocated array for second derivatives. The function can automatically allocate the required memory for these values if this argument is NULL.
[in]nNumber of values in x, y and y2 (if y2 is not NULL).
[in]yp1,ypnFirst derivatives of the tabulated function in the first and last points, respectively. If yp1 and/or ypn are equal to 1.0e99 or larger, the routine is signaled to set the corresponding boundary condition for a natural spline, with zero second derivative on that boundary.