Canoe
Comprehensive Atmosphere N' Ocean Engine
interpolation.h File Reference
#include <stddef.h>

Go to the source code of this file.

Functions

int locate (double const *xx, double x, int n)
 
void interpn (double *val, double const *coor, double const *data, double const *axis, size_t const *len, int ndim, int nval)
 
double interp1 (double x, double const *data, double const *axis, size_t len)
 
void spline (int n, struct float_triplet *table, double y1_bot, double y1_top)
 
int find_place_in_table (int n, struct float_triplet *table, double x, double *dx, int il)
 
double splint (double xx, struct float_triplet *table, double dx)
 
void interpnf (double *val, double const *coor, double const *data, double const *axis, size_t const *len, int ndim)
 

Function Documentation

◆ locate()

int locate ( double const *  xx,
double  x,
int  n 
)

Given an array xx[0..n-1] , and given a value x , returns a value j such that x is between xx[j] and xx[j+1]. xx must be monotonic, either increasing or decreasing. j=0 or j=n is returned to indicate that x is out of range. adapted from Numerical Recipes in C, 2nd Ed., p. 117.

Definition at line 7 of file locate.c.

◆ interpn()

void interpn ( double *  val,
double const *  coor,
double const *  data,
double const *  axis,
size_t const *  len,
int  ndim,
int  nval 
)

Multidimensional linear interpolation val[0..nval-1] : output values coor[0..ndim-1] : coordinate of the interpolation point data[...] : points to the start position of a multidimensional data table. len[0..ndim-1] : length of each dimension axis[...] : coordinates of each dimesnion is placed sequentially in axis

Definition at line 12 of file interpn.c.

◆ interp1()

double interp1 ( double  x,
double const *  data,
double const *  axis,
size_t  len 
)

A handy function for one dimensional interpolation x : interpolation point data[0..len-1] : data array axis[0..len-1] : coordinates

Definition at line 61 of file interpn.c.

◆ spline()

void spline ( int  n,
struct float_triplet table,
double  y1_bot,
double  y1_top 
)

Definition at line 21 of file spline.c.

◆ find_place_in_table()

int find_place_in_table ( int  n,
struct float_triplet table,
double  x,
double *  dx,
int  il 
)

Definition at line 11 of file find_place_in_table.c.

◆ splint()

double splint ( double  xx,
struct float_triplet table,
double  dx 
)

Definition at line 152 of file spline.c.

◆ interpnf()

void interpnf ( double *  val,
double const *  coor,
double const *  data,
double const *  axis,
size_t const *  len,
int  ndim 
)

Multidimensional linear interpolation val[0..nval-1] : output values coor[0..ndim-1] : coordinate of the interpolation point data[...] : points to the start position of a multidimensional data table. len[0..ndim-1] : length of each dimension axis[...] : coordinates of each dimesnion is placed sequentially in axis

Definition at line 13 of file interpnf.c.