aboutsummaryrefslogtreecommitdiff
path: root/src/TP_utilities.h
diff options
context:
space:
mode:
authorschnetter <schnetter@b2a53a04-0f4f-0410-87ed-f9f25ced00cf>2004-05-18 15:30:57 +0000
committerschnetter <schnetter@b2a53a04-0f4f-0410-87ed-f9f25ced00cf>2004-05-18 15:30:57 +0000
commit73a24baa63d3294d972cace0e7d66e7b4a25ddf5 (patch)
tree2bde81e600b682a1bdb614481207ddc029c572e3 /src/TP_utilities.h
parent79342f353bbf602b9b656da9497ebfcfa2f9b07a (diff)
Import initial version of Marcus Ansorg's code, converted into a
Cactus thorn. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/TwoPunctures/trunk@2 b2a53a04-0f4f-0410-87ed-f9f25ced00cf
Diffstat (limited to 'src/TP_utilities.h')
-rw-r--r--src/TP_utilities.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/src/TP_utilities.h b/src/TP_utilities.h
new file mode 100644
index 0000000..37db3f0
--- /dev/null
+++ b/src/TP_utilities.h
@@ -0,0 +1,91 @@
+// TwoPunctures: File "utilities.h"
+
+#define Pi 3.14159265358979323846264338328
+#define Pih 1.57079632679489661923132169164 // Pi/2
+#define Piq 0.78539816339744830961566084582 // Pi/4
+
+#define TINY 1.0e-20
+#define SWAP(a,b) {temp=(a);(a)=(b);(b)=temp;}
+#define NR_END 1
+#define FREE_ARG char*
+
+typedef struct DCOMPLEX
+{
+ double r, i;
+} dcomplex;
+
+#define nrerror TP_nrerror
+#define ivector TP_ivector
+#define dvector TP_dvector
+#define imatrix TP_imatrix
+#define dmatrix TP_dmatrix
+#define d3tensor TP_d3tensor
+#define free_ivector TP_free_ivector
+#define free_dvector TP_free_dvector
+#define free_imatrix TP_free_imatrix
+#define free_dmatrix TP_free_dmatrix
+#define free_d3tensor TP_free_d3tensor
+
+void nrerror (char error_text[]);
+int *ivector (long nl, long nh);
+double *dvector (long nl, long nh);
+int **imatrix (long nrl, long nrh, long ncl, long nch);
+double **dmatrix (long nrl, long nrh, long ncl, long nch);
+double ***d3tensor (long nrl, long nrh, long ncl, long nch, long ndl,
+ long ndh);
+void free_ivector (int *v, long nl, long nh);
+void free_dvector (double *v, long nl, long nh);
+void free_imatrix (int **m, long nrl, long nrh, long ncl, long nch);
+void free_dmatrix (double **m, long nrl, long nrh, long ncl, long nch);
+void free_d3tensor (double ***t, long nrl, long nrh, long ncl, long nch,
+ long ndl, long ndh);
+
+int minimum2 (int i, int j);
+int minimum3 (int i, int j, int k);
+int maximum2 (int i, int j);
+int maximum3 (int i, int j, int k);
+int pow_int (int mantisse, int exponent);
+double atanh (double x);
+double asinh (double x);
+double acosh (double x);
+
+dcomplex Cadd (dcomplex a, dcomplex b);
+dcomplex Csub (dcomplex a, dcomplex b);
+dcomplex Cmul (dcomplex a, dcomplex b);
+dcomplex RCmul (double x, dcomplex a);
+dcomplex Cdiv (dcomplex a, dcomplex b);
+dcomplex Complex (double re, double im);
+dcomplex Conjg (dcomplex z);
+double Cabs (dcomplex z);
+
+dcomplex Csqrt (dcomplex z);
+dcomplex Cexp (dcomplex z);
+dcomplex Clog (dcomplex z);
+dcomplex Csin (dcomplex z);
+dcomplex Ccos (dcomplex z);
+dcomplex Ctan (dcomplex z);
+dcomplex Ccot (dcomplex z);
+dcomplex Csinh (dcomplex z);
+dcomplex Ccosh (dcomplex z);
+dcomplex Ctanh (dcomplex z);
+dcomplex Ccoth (dcomplex z);
+
+void chebft_Zeros (double u[], int n, int inv);
+void chebft_Extremes (double u[], int n, int inv);
+void chder (double *c, double *cder, int n);
+double chebev (double a, double b, double c[], int m, double x);
+void fourft (double *u, int N, int inv);
+void fourder (double u[], double du[], int N);
+void fourder2 (double u[], double d2u[], int N);
+double fourev (double *u, int N, double x);
+
+
+void ludcmp (double **a, int n, int *indx, double *d);
+void lubksb (double **a, int n, int *indx, double b[]);
+void tridag (double a[], double b[], double c[], double r[], double u[],
+ int n);
+double norm1 (double *v, int n);
+double norm2 (double *v, int n);
+double scalarproduct (double *v, double *w, int n);
+
+double plgndr (int l, int m, double x);