-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.h
55 lines (42 loc) · 1.54 KB
/
lib.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* The definition module
* lib.h
* for the library function common for all C programs.
*/
// Standard ANSI-C++ include files
#include <iostream>
#include <new>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
using namespace std;
#define NULL_PTR (void *) 0
#define ZERO 1.0E-10
#define UL unsigned long
/* a macro used in function pythag() */
static float sqrarg;
#define SQR(a) ((sqrarg = (a)) == 0.0 ? 0.0 : sqrarg * sqrarg)
/* Macro definitions for integer arguments only */
#define SIGN(a,b) ((b)<0 ? -fabs(a) : fabs(a))
// Function declarations
void **matrix(int, int, int);
void free_matrix(void **);
void rk4(double *, double *, int, double, double, double *,
void (*derivs)(double, double *, double *));
void ludcmp(double **, int, int *, double*);
void lubksb(double **, int, int *, double *);
void tqli(double *, double *, int, double **);
void tred2(double **, int, double *, double *);
double pythag(double, double);
void gauleg(double, double, double *, double *, int);
void jacobi(double** a, double* d, double** v, int n, int& nrot);
double rectangle_rule(double, double, int, double (*func)(double));
double trapezoidal_rule(double, double, int, double (*func)(double));
void spline(double *, double *, int, double, double, double *);
void splint(double *, double *, double *, int, double, double *);
void polint(double *, double *, int, double, double *, double *);
double ran0(long *);
double ran1(long *);
double ran2(long *);
double ran3(long *);