X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=moebius2.git;a=blobdiff_plain;f=anneal.c;h=32c06d99cef7faef2a5cd47a8d85a809d459b130;hp=ab521f4700da30b1b9fa0d5989ffa6d6d89665f5;hb=0cd9cfd406d72d3d40941f87937b60f0d10f1d4d;hpb=7904a232f94d57fb0884725481d0c616f02c2520 diff --git a/anneal.c b/anneal.c index ab521f4..32c06d9 100644 --- a/anneal.c +++ b/anneal.c @@ -1,70 +1,7 @@ /* * We try to find an optimal triangle grid - * - * Vertices in strip are numbered as follows: - * - * ___ 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 __ - * Y-3 Y-3 Y-3 2 2 2 2 - * - * . . . . . . . . . . . . . . . - * - * 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 < X x = distance along - * 0 <= y < Y y = distance across - * - * Vertices are in reading order from diagram above ie x varies fastest. - * - * 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 - * \ / - * ___ 0 __ - * 3 1 0 - * / \ - * 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 XBITS 4 -#define X (1<