X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=anneal.c;h=ab521f4700da30b1b9fa0d5989ffa6d6d89665f5;hb=7904a232f94d57fb0884725481d0c616f02c2520;hp=e13c0b0cb8faaa4d03515148a5f32cf035c1ecd0;hpb=e38ba6e5733db1faab4c146fbd9b3114e10b29f1;p=moebius2.git diff --git a/anneal.c b/anneal.c index e13c0b0..ab521f4 100644 --- a/anneal.c +++ b/anneal.c @@ -3,34 +3,36 @@ * * Vertices in strip are numbered as follows: * - * ___ L-2 ___ L-1 ___ 0 ___ 1 ___ 2 ___ 3 ___ 4 __ - * W-1 W-1 0 0 0 0 0 + * ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 ___ 3 ___ 4 __ + * Y-1 Y-1 0 0 0 0 0 * / \ / \ / \ / \ / \ / \ / \ * / \ / \ / \ / \ / \ / \ / \ - * L-3 ___ L-2 ___ L-1 ___ 0 ___ 1 ___ 2 ___ 3 ___ 4 - * W-2 W-2 W-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 * \ / \ / \ / \ / \ / \ / \ / * \ / \ / \ / \ / \ / \ / \ / - * ___ L-3 ___ L-2 ___ L-1 ___ 0 ___ 1 ___ 2 ___ 3 __ - * W-3 W-3 W-3 2 2 2 2 - * / \ / \ / \ / \ / \ / \ / \ - * / \ / \ / \ / \ / \ / \ / \ - * . . . . . . . . . . . . . . . . + * ___ X-3 ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 ___ 3 __ + * Y-3 Y-3 Y-3 2 2 2 2 + * + * . . . . . . . . . . . . . . . * - * _ L-4 ___ L-3 ___ L-2 ___ L-1 ___ 0 ___ 1 ___ 2 ___ 3 - * 1 1 1 1 W-2 W-2 W-2 W-2 - * / \ / \ / \ / \ / \ / \ / \ / - * / \ / \ / \ / \ / \ / \ / \ / - * L-5 ___ L-4 ___ L-3 ___ L-2 ___ L-1 ___ 0 ___ 1 ___ 2 __ - * 0 0 0 0 0 W-1 W-1 W-1 + * X-4 ___ X-3 ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 ___ 3 + * 1 1 1 1 Y-2 Y-2 Y-2 Y-2 + * \ / \ / \ / \ / \ / \ / \ / + * \ / \ / \ / \ / \ / \ / \ / + * ___ X-4 ___ X-3 ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 __ + * 0 0 0 0 Y-1 Y-1 Y-1 * * Node x,y for - * 0 <= x < L x = distance along L = length - * 0 <= y < W y = distance across W = width + * 0 <= x < X x = distance along + * 0 <= y < Y y = distance across * * Vertices are in reading order from diagram above ie x varies fastest. * - * Where necessary, edges are counted anticlockwise from to-the-right: + * Y must be even. The actual location opposite (0,0) is (X-(Y-1)/2,0), + * and likewise opposite (0,Y-1) is ((Y-1)/2,0). + * + * To label edges, we counte anticlockwise[*] from to-the-right: * * \2 /1 * \ / @@ -39,75 +41,189 @@ * / \ * 4/ 5\ * + * [*] That is, in the direction represented as anticlockwise for + * the vertices (0,*)..(4,*) in the diagram above; and of course + * that is clockwise for the vertices (X-5,*)..(X-1,*). The + * numbering has an actual discontinuity between (X-1,*) and (0,*). + * * When we iterate over edges, we iterate first over vertices and then * over edges 0 to 2, disregarding edges 3 to 5. */ -#define L 10 -#define W 10 -#define N (L*W) +#define XBITS 4 +#define X (1<