chiark
/
gitweb
/
~ian
/
moebius2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
interpolate and various sizes build
[moebius2.git]
/
mgraph.h
diff --git
a/mgraph.h
b/mgraph.h
index 714ff7ffb72319e2d9a874e615ad7cf8b0814fa1..e98fa850a53658bacf17ff452d03d2341c89afa9 100644
(file)
--- a/
mgraph.h
+++ b/
mgraph.h
@@
-9,7
+9,7
@@
* | :
* ___ X-2 ___ X-1 ___| 0 ___ 1 ___ 2 ___ 3 ___ 4 __
* Y-1 Y-1 |0: 0 0 0 0
* | :
* ___ X-2 ___ X-1 ___| 0 ___ 1 ___ 2 ___ 3 ___ 4 __
* Y-1 Y-1 |0: 0 0 0 0
- * / \ / \ / :\ / \ / \ / \ /
!!
\
+ * / \ / \ / :\ / \ / \ / \ / \
* / \ / \ /| : \ / \ / \ / \ / \
* X-3 ___ X-2 ___ X-1|___ 0 ___ 1 ___ 2 ___ 3 ___ 4
* Y-2 Y-2 Y-2| : 1 1 1 1 1
* / \ / \ /| : \ / \ / \ / \ / \
* X-3 ___ X-2 ___ X-1|___ 0 ___ 1 ___ 2 ___ 3 ___ 4
* Y-2 Y-2 Y-2| : 1 1 1 1 1
@@
-42,7
+42,7
@@
*
* Node x,y for
* 0 <= x < X = 2^XBITS x = distance along
*
* Node x,y for
* 0 <= x < X = 2^XBITS x = distance along
- * 0 <= y < Y = 2^YBITS-1
y = distance across
+ * 0 <= y < Y = 2^YBITS-1 y = distance across
*
* Vertices are in reading order from diagram above ie x varies fastest.
*
*
* Vertices are in reading order from diagram above ie x varies fastest.
*
@@
-69,9
+69,15
@@
#include "common.h"
#include "common.h"
+#ifndef DEFBITS
#define XBITS 3
#define XBITS 3
-#define X (1<<XBITS)
#define YBITS 3
#define YBITS 3
+#else
+#define XBITS (DEFBITS / 10)
+#define YBITS (DEFBITS % 10)
+#endif
+
+#define X (1<<XBITS)
#define Y ((1<<YBITS) - 1)
#define N (X*Y)
#define Y ((1<<YBITS) - 1)
#define N (X*Y)
@@
-88,9
+94,13
@@
#define FOR_VPEDGE(v,e) \
for ((e)=0; (e)<V6; (e)++)
#define FOR_VPEDGE(v,e) \
for ((e)=0; (e)<V6; (e)++)
-
extern
int edge_end2(unsigned v1, int e);
+int edge_end2(unsigned v1, int e);
#define EDGE_END2 edge_end2
#define EDGE_END2 edge_end2
+/* 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 FOR_VEDGE_X(v1,e,v2,init,otherwise) \
#define RIM_VERTEX_P(v) (((v) & YMASK) == 0 || ((v) & YMASK) == (Y-1)*Y1)
#define FOR_VEDGE_X(v1,e,v2,init,otherwise) \