chiark / gitweb /
comments etc. fixed up for new topology
authorIan Jackson <ian@davenant.relativity.greenend.org.uk>
Tue, 1 Jan 2008 20:30:26 +0000 (20:30 +0000)
committerIan Jackson <ian@davenant.relativity.greenend.org.uk>
Tue, 1 Jan 2008 20:30:26 +0000 (20:30 +0000)
Makefile
mgraph.h
primer.c

index bec227e7bc409c626b7e59e67c0e0543e81da43b..c40fb3285be394a1b0c70a874699bbdb4d4d2254 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ initial:      generator primer sgtatham/z.typescript
                ./$^ -o$@
 
 clean:
                ./$^ -o$@
 
 clean:
-               rm -f *.o $(TARGETS) *.new *.tmp
+               rm -f *.o $(TARGETS) *.new *.tmp *.rej *.orig
                rm -f initial
                rm -f *.d
 
                rm -f initial
                rm -f *.d
 
index de26852f9974aef3960c09e4e2acff63ffb17537..22f5d92a37e979b52b4779feb16b8837a704eddc 100644 (file)
--- a/mgraph.h
+++ b/mgraph.h
  *  -3 ___ X-2 ___ X-1 ___| 0  ___  1  ___  2  ___  3  ___  4 ___
  *  0      0       0      |Y-1     Y-1     Y-1     Y-1     Y-1
  *                       |
  *  -3 ___ X-2 ___ X-1 ___| 0  ___  1  ___  2  ___  3  ___  4 ___
  *  0      0       0      |Y-1     Y-1     Y-1     Y-1     Y-1
  *                       |
+ *                        ^ join, where there is
+ *                           a discontinuity in numbering
+ *
  * Node x,y for
  * Node x,y for
- *   0 <= x < X     x = distance along
- *   0 <= y < Y     y = distance across
+ *   0 <= x < X = 2^XBITS     x = distance along
+ *   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.
  *
- * 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).
- *
  * Note that though presentation above is equilateral triangles, this
  * is not the case.  It's actually a square lattice with half of the
  * diagonals added.  We can't straighten it out because at the join
  * the diagonals point the other way!
  *
  * Note that though presentation above is equilateral triangles, this
  * is not the case.  It's actually a square lattice with half of the
  * diagonals added.  We can't straighten it out because at the join
  * the diagonals point the other way!
  *
- * We label edges as follows:        Or in the square view:
- *
- *                 \2   /1                 2  1
- *                  \  /                   | /
- *               ___ 0   __                |/
- *               3    1   0             3--*--0
- *                  /  \                  /|
- *                4/   5\                / |
- *                                      4  5
+ * We label edges as follows:
  *
  *
- *                                   (This makes the numbering
- *                                   discontinuity, at the join,
- *                                   vertical and thus tractable.)
+ *                 \2   /1
+ *                  \  /
+ *               ___ 0   __
+ *               3    1   0
+ *                  /  \
+ *                4/   5\
  */
 
 #ifndef MGRAPH_H
  */
 
 #ifndef MGRAPH_H
index 3d9244a60f0b497a7cbe775b28ed2eebe1ed2de0..f023b10365881f25c3de3f4e7b9a23e3bc2c4586 100644 (file)
--- a/primer.c
+++ b/primer.c
@@ -21,7 +21,9 @@ int main(int argc, const char **argv) {
     double u= y * 1.0 / (Y-1); /* SGT's u runs 0..1 across the strip */
 
     /* SGT's v runs 0..pi along the strip, where the join is at 0==pi.
     double u= y * 1.0 / (Y-1); /* SGT's u runs 0..1 across the strip */
 
     /* SGT's v runs 0..pi along the strip, where the join is at 0==pi.
-     * So that corresponds to 0..X (since 0==X in our scheme). */
+     * So that corresponds to 0..X (since 0==X in our scheme).
+     * Vertices with odd y coordinate are halfway to the next x coordinate.
+     */
     double v= (x*2 + (y&1)) * M_PI / (X*2);
 
     K printf("print %c%c( %-*.*g, %-*.*g);  # %03x %2d %2d\n",
     double v= (x*2 + (y&1)) * M_PI / (X*2);
 
     K printf("print %c%c( %-*.*g, %-*.*g);  # %03x %2d %2d\n",