forked from toby1998/MoRiBS-PIMC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mc_utils.h
executable file
·34 lines (21 loc) · 1023 Bytes
/
mc_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef _MC_UTILS_H
#define _MC_UTILS_H 1
//------------ memory allocation ----------------
double **doubleMatrix (long row, long col);
int **intMatrix (long row, long col);
long int **long_intMatrix (long row, long col);
void free_doubleMatrix (double **mat);
void free_intMatrix (int **mat);
void free_long_intMatrix (long int **mat);
//-----------------------------------------------
const char ERR_INDEX_EXCEED[] = "Index exceeds array size";
void nrerror(const char [],const char []); // error handler
//---- cubic spline from Numerical recipes ------
void spline(double *x, double *y, int n, double yp1, double ypn, double *y2);
void splint(double *xa, double *ya, double *y2a, int n, double x, double &y);
//------------------------------------------------
void init_spline(double *grid,double *data,double *sdata,int maxsize);
void mmsort(double *, int *,int); // sort dist and rearrange labels
double dmax(double,double);
double dmin(double,double);
#endif // mc_utils.h