X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=anneal.c;h=fd725f1844d577488a2e9d154fc03c155f9bf913;hb=8ff2e481a33d24276b85600c4f3fd7bc9cbf5a18;hp=4ddddb8934901dce708ad7270094365eaae2f169;hpb=259977336c8b6a3fbd6543927d18b840b8511bfc;p=moebius2.git diff --git a/anneal.c b/anneal.c index 4ddddb8..fd725f1 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<