14 double const *axis,
size_t const *len,
int ndim) {
16 i1 =
locate(axis, *coor, *len);
23 }
else if (i1 == *len - 1) {
38 for (
int j = 1;
j < ndim; ++
j) s *= len[
j];
39 interpnf(&v1, coor + 1,
data + i1 * s, axis + *len, len + 1, ndim - 1);
40 interpnf(&v2, coor + 1,
data + i2 * s, axis + *len, len + 1, ndim - 1);
44 *val = ((*coor -
x1) * v2 + (
x2 - *coor) * v1) / (
x2 -
x1);
46 *val = (v1 + v2) / 2.;
void interpnf(double *val, double const *coor, double const *data, double const *axis, size_t const *len, int ndim)
int locate(double const *xx, double x, int n)