Rate This Document
Findability
Accuracy
Completeness
Readability

kml_?_interp2d_set

Set zarr to z at grid point (i, j).

Interface Definition

int kml_float_interp2d_set(const kml_float_interp2d *interp, float zarr[], const size_t i, const size_t j, const float z)

int kml_double_interp2d_set(const kml_double_interp2d *interp, double zarr[], const size_t i, const size_t j,

const double z);

Parameters

Parameter

Type

Description

Input/Output

interp

kml_float_interp2d*, kml_double_interp2d*

Pointer to an interpolation object.

Input

zarr

float, double

Array that stores the value of z.

Output

i

size_t

Index in the x direction.

Input

j

size_t

Index in the y direction.

Input

z

float

Value of z to be changed.

Input

Dependencies

#include "kipl.h"

Examples

const size_t xSize = 4;
const size_t ySize = 4;
float xArr[4] = {1,1.33,1.67,2};
float yArr[4] = {1,1.33,1.67,2};
float* zArr = (float*)malloc(xSize * ySize * sizeof(float));
size_t i = 1;
size_t j = 1;
float z = 0;
kml_float_interp2d *interp = kml_float_interp2d_alloc(kml_float_interp2d_bicubic, xSize, ySize);
kml_float_interp2d_init(interp, xArr, yArr, zArr, xSize, ySize);
kml_float_interp2d_set(interp, zArr, i, j, z);