Rate This Document
Findability
Accuracy
Completeness
Readability

kml_?_spline_eval_deriv

Return the derivative of the interpolation function at a given point (x). The interpolation object spline and accelerator xacc are used in the calculation. If x is outside the range of xarr, an error message is returned.

Interface Definition

int kml_float_spline_eval_deriv_e(const kml_float_spline *spline, float x,

kml_spline_accel *a, float *dydx)

float kml_float_spline_eval_deriv(const kml_float_spline *spline, float x,

kml_spline_accel *a)

int kml_double_spline_eval_deriv_e(const kml_double_spline *spline, double x, kml_interp_accel *a, double *dydx);

double kml_double_spline_eval_deriv(const kml_double_spline *spline, double x, kml_interp_accel *a);

Parameters

Parameter

Type

Description

Input/Output

spline

kml_float_spline*, kml_double_spline*

Pointer to an interpolation object.

Input

x

float, double

Value of the solution point x.

Input

y

float, double

Value of the solution point y.

Input

a

kml_spline_accel *

Pointer to an accelerator object.

Input

Dependencies

#include "kipl.h"

Examples

const size_t xMin = 4;
const size_t xMax = 2048;
const size_t xSize = 4;
const float xValLo = 1;
const float xValHi = 2;
float xArr[4] = {1,1.33,1.67,2};
float* yArr = (float*)malloc(xSize * sizeof(float));
float x = 1;
float y = 0;
kml_float_spline *spline = kml_float_spline_alloc(kml_float_interp_cspline, xSize);
kml_interp_accel *xacc = kml_interp_accel_alloc();
kml_float_spline_init(spline, xSize, xArr, yArr);
y = kml_float_spline_eval_deriv(spline, x, xacc);
kml_float_spline_free(spline);
kml_interp_accel_free(xacc);