X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=common.h;h=7e0e86d7622da0698d992bdf94af0dfef3e4676e;hb=6b956af9d8c12d73684580eb33dac3ed0c803f6a;hp=1b79fe8107f518b86b679cb06c6ac73968112cc6;hpb=2e8e765ae894f9921fa97db2f21915662f162224;p=moebius2.git diff --git a/common.h b/common.h index 1b79fe8..7e0e86d 100644 --- a/common.h +++ b/common.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -31,15 +32,28 @@ double hypotD2plus(const double p[D3], const double q[D3], double add); double magnD(const double pq[D3]); void xprod(double r[D3], const double a[D3], const double b[D3]); +double dotprod(const double a[D3], const double b[D3]); 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)= (b) ? (a) : (b)) + #ifdef FP_FAST_FMA # define fma_fast fma #else