RadLib
Loading...
Searching...
No Matches
multilinear_interpolation.h File Reference

Multilinear interpolation (header only). More...

#include <vector>
Include dependency graph for multilinear_interpolation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int get_location_dim (const int nx, const double *x, const double xP)
 
double LI_1D (const int nx, const double *x, const double *f, const double xP)
 
double LI_2D (const int nx, const int ny, const double *x, const double *y, const double *f, const double xP, const double yP)
 
double LI_3D (const int nx, const int ny, const int nz, const double *x, const double *y, const double *z, const double *f, const double xP, const double yP, const double zP)
 
double LI_4D (const int nx, const int ny, const int nz, const int nw, const double *x, const double *y, const double *z, const double *w, const double *f, const double xP, const double yP, const double zP, const double wP)
 
double LI_5D (const int nx, const int ny, const int nz, const int nw, const int nv, const double *x, const double *y, const double *z, const double *w, const double *v, const double *f, const double xP, const double yP, const double zP, const double wP, const double vP)
 

Detailed Description

Multilinear interpolation (header only).

Up to five dimensions. These are hard coded. This is relatively easy to read, but not as general as, e.g., https://github.com/parsiad/mlinterp This version assumes simple arrays. Pass in the number of dimensions for each array, then the grid values for each dimension (arrays), then the array of function values at each point, then the locations of the desired points in each dimension. The grid of function values is mapped to 1-D in row-major form: For x,y,z indexed by i,j,k, we have f[i][j][k] ==> f[i*nz*ny + j*nz + k] See LI_2D for specific description of values passed. LI_3D and LI_4D are tested by comparison of the rcSLW code to the python version.

Definition in file multilinear_interpolation.h.

Function Documentation

◆ get_location_dim()

int get_location_dim ( const int  nx,
const double *  x,
const double  xP 
)

Definition at line 22 of file multilinear_interpolation.h.

Here is the caller graph for this function:

◆ LI_1D()

double LI_1D ( const int  nx,
const double *  x,
const double *  f,
const double  xP 
)

Definition at line 33 of file multilinear_interpolation.h.

Here is the call graph for this function:

◆ LI_2D()

double LI_2D ( const int  nx,
const int  ny,
const double *  x,
const double *  y,
const double *  f,
const double  xP,
const double  yP 
)

Definition at line 52 of file multilinear_interpolation.h.

Here is the call graph for this function:

◆ LI_3D()

double LI_3D ( const int  nx,
const int  ny,
const int  nz,
const double *  x,
const double *  y,
const double *  z,
const double *  f,
const double  xP,
const double  yP,
const double  zP 
)

Definition at line 80 of file multilinear_interpolation.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LI_4D()

double LI_4D ( const int  nx,
const int  ny,
const int  nz,
const int  nw,
const double *  x,
const double *  y,
const double *  z,
const double *  w,
const double *  f,
const double  xP,
const double  yP,
const double  zP,
const double  wP 
)

Definition at line 121 of file multilinear_interpolation.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LI_5D()

double LI_5D ( const int  nx,
const int  ny,
const int  nz,
const int  nw,
const int  nv,
const double *  x,
const double *  y,
const double *  z,
const double *  w,
const double *  v,
const double *  f,
const double  xP,
const double  yP,
const double  zP,
const double  wP,
const double  vP 
)

Definition at line 178 of file multilinear_interpolation.h.

Here is the call graph for this function: