我要评分
获取效率
正确性
完整性
易理解

kml_?_spline_eval_integ

Return the integral 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_interp_eval_integ_e(const kml_float_spline *spline, float a, float b, kml_spline_accel *acc, float *result)

float kml_float_spline_eval_integ(const kml_float_spline *spline, float a, float b, kml_spline_accel *acc)

int kml_double_spline_eval_integ_e(const kml_double_spline *spline, double a, double b, kml_interp_accel *acc, double *result);

double kml_double_spline_eval_integ(const kml_double_spline *spline, double a, double b, kml_interp_accel *acc);

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_integ(spline, xArr, x, xacc);
kml_float_spline_free(spline);
kml_interp_accel_free(xacc);