MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
interp.h
Go to the documentation of this file.
1 #ifndef INTERP_H
2 #define INTERP_H
3 
4 #include <stddef.h>
5 
6 typedef struct {
7  int Ndim;
8  int * dims;
9  ptrdiff_t * strides;
10  double * Min;
11  double * Step;
12  double * Max;
13 
14  void * data; /* internal buffer for all pointer data */
15  int fsize;
16 } Interp;
17 
18 void interp_init(Interp * obj, int Ndim, int64_t * dims);
19 
20 /* set the upper and lower limit of dimension d */
21 void interp_init_dim(Interp * obj, int d, double Min, double Max);
22 
23 /* interpolate the table at point x;
24  * status: array of length dimension,
25  * will be -1 if below lower bound
26  * +1 if above upper bound */
27 double interp_eval(Interp * obj, double * x, double * ydata, int * status);
28 double interp_eval_periodic(Interp * obj, double * x, double * ydata);
29 
30 void interp_destroy(Interp * obj);
31 #endif
double interp_eval(Interp *obj, double *x, double *ydata, int *status)
Definition: interp.c:72
void interp_init(Interp *obj, int Ndim, int64_t *dims)
Definition: interp.c:9
void interp_destroy(Interp *obj)
Definition: interp.c:172
void interp_init_dim(Interp *obj, int d, double Min, double Max)
Definition: interp.c:50
double interp_eval_periodic(Interp *obj, double *x, double *ydata)
Definition: interp.c:134
Definition: interp.h:6
int Ndim
Definition: interp.h:7
ptrdiff_t * strides
Definition: interp.h:9
void * data
Definition: interp.h:14
double * Max
Definition: interp.h:12
double * Step
Definition: interp.h:11
int * dims
Definition: interp.h:8
int fsize
Definition: interp.h:15
double * Min
Definition: interp.h:10