chiark / gitweb /
better rotations
[moebius2.git] / common.h
index 52f2e5b15781e6c6dba388968def3535c6ae5a89..ebc34d17a27eb3d578f7f60ca33bd2e9057ad6c4 100644 (file)
--- a/common.h
+++ b/common.h
@@ -17,6 +17,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <gsl/gsl_vector.h>
 #include <gsl/gsl_matrix.h>
@@ -46,8 +47,11 @@ void gsldie(int l, const char *what, int status);
 
 #define K FOR_COORD(k)
 
-#define STATIC_GSL_VECTOR(x) static gsl_vector x##_gsl= { D3,1,&x[0] };
-#define STATIC_GSL_MATRIX(x) static gsl_matrix x##_gsl= { D3,D3,D3,&x[0][0] };
+#define GSL_VECTOR(x) gsl_vector x##_gsl= { D3,1,&x[0] };
+#define GSL_MATRIX(x) gsl_matrix x##_gsl= { D3,D3,D3,&x[0][0] };
+
+#define MIN(a,b) ((a) <= (b) ? (a) : (b))
+#define MAX(a,b) ((a) >= (b) ? (a) : (b))
 
 #ifdef FP_FAST_FMA
 # define fma_fast fma