### 28.11 2D Interpolation Grids

The 2D interpolation routines access the function values z_{ij} with the following ordering:

    z_ij = za[j*xsize + i]

with i = 0,...,xsize-1 and j = 0,...,ysize-1. However, for ease of use, the following functions are provided to add and retrieve elements from the function grid without requiring knowledge of the internal ordering.

Function: int gsl_interp2d_set (const gsl_interp2d * interp, double za[], const size_t i, const size_t j, const double z)

  This function sets the value z_{ij} for grid point (i,j) of the array za to z.

Function: double gsl_interp2d_get (const gsl_interp2d * interp, const double za[], const size_t i, const size_t j)

  This function returns the value z_{ij} for grid point (i,j) stored in the array za.

Function: size_t gsl_interp2d_idx (const gsl_interp2d * interp, const size_t i, const size_t j)

  This function returns the index corresponding to the grid point (i,j). The index is given by j*xsize + i.