chiark
/
gitweb
/
~ian
/
moebius2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tidyings, more points.
[moebius2.git]
/
common.h
diff --git
a/common.h
b/common.h
index d6d1e58c8fc768f32550fae2a82d664e208213e5..cb45e8107b2af322854f67b1065ea70a2ea692b8 100644
(file)
--- a/
common.h
+++ b/
common.h
@@
-16,6
+16,13
@@
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <gsl/gsl_vector.h>
+#include <gsl/gsl_matrix.h>
+#include <gsl/gsl_blas.h>
+#include <gsl/gsl_linalg.h>
#define D3 3
#define D3 3
@@
-29,11
+36,20
@@
void xprod(double r[D3], const double a[D3], const double b[D3]);
void flushoutput(void);
void diee(const char *what);
void flushoutput(void);
void diee(const char *what);
+void libdie(const char *lib, int l, const char *str);
+#define XA(w) ((w) ? (void)0 : libdie("X", __LINE__, #w))
+
+void gsldie(int l, const char *what, int status);
+#define GA(w) ({int _ga_r= (w); if (w) gsldie(__LINE__,#w,_ga_r);})
+
#define FOR_COORD(k) \
for ((k)=0; (k)<D3; (k)++)
#define K FOR_COORD(k)
#define FOR_COORD(k) \
for ((k)=0; (k)<D3; (k)++)
#define K FOR_COORD(k)
+#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] };
+
#ifdef FP_FAST_FMA
# define fma_fast fma
#else
#ifdef FP_FAST_FMA
# define fma_fast fma
#else