X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=moebius2.git;a=blobdiff_plain;f=mgraph.h;h=85f1a3c8d0ef621e8417a2715c1af014df187e91;hp=43494c7ebc9c38246b97222582f71dbe1476d3b7;hb=c01a4fe080a448234b39afb7ea7f7a3c9c229fb7;hpb=7968bc4aca3306473e7ab0a55d4bdc721a3eacd5 diff --git a/mgraph.h b/mgraph.h index 43494c7..85f1a3c 100644 --- a/mgraph.h +++ b/mgraph.h @@ -60,8 +60,8 @@ * / \ * 4/ 5\ * - * vertex number: 0000 | y | x - * YBITS XBITS + * vertex number: 0000 | y | x + * (YBITS) XBITS */ #ifndef MGRAPH_H @@ -69,18 +69,25 @@ #include "common.h" +#ifndef DEFSZ /* DEFSZ may be (Y/2-1)*10 + XBITS ie Y is 2*+1 */ #define XBITS 3 -#define X (1<= 0, - * returns eprime s.t. v1==EDGE_END2(v2,eprime) */ +/* given v1,e s.t. v2==EDGE_END2(v1,e) >= 0, + * returns eprime s.t. v1==EDGE_END2(v2,eprime) */ int edge_reverse(int v1, int e); -#define RIM_VERTEX_P(v) (((v) & YMASK) == 0 || ((v) & YMASK) == (Y-1)*Y1) +#define EDGE_OPPOSITE(e) (((e)+V3) % V6) + +#define RIM_VERTEX_P(v) (((v) & ~XMASK) == 0 || ((v) & ~XMASK) == (Y-1)*Y1) #define FOR_VEDGE_X(v1,e,v2,init,otherwise) \ FOR_VPEDGE((v1),(e)) \