1 /* Tests for multidimensional Hilbert curves */
10 static uns test1_order;
11 #define HILBERT_PREFIX(x) test1_##x
12 #define HILBERT_DIM test1_dim
13 #define HILBERT_ORDER test1_order
14 #define HILBERT_WANT_DECODE
15 #define HILBERT_WANT_ENCODE
16 #include "images/hilbert.h"
21 uns a[32], b[32], c[32];
22 for (test1_dim = 2; test1_dim <= 8; test1_dim++)
23 for (test1_order = 8; test1_order <= 32; test1_order++)
24 for (uns i = 0; i < 1000; i++)
26 for (uns j = 0; j < test1_dim; j++)
27 a[j] = (uns)rand() >> (32 - test1_order);
30 for (uns j = 0; j < test1_dim; j++)
32 die("Error... dim=%d order=%d testnum=%d index=%d val1=0x%08x val2=0x%08x", test1_dim, test1_order, i, j, a[j], c[j]);
37 #include "images/hilbert-origin.h"
43 pt.hcode[0] = 0x12345678;
44 pt.hcode[1] = 0x654321;
45 pt.hcode[2] = 0x11122233;
48 DBG("origin: [%08x, %08x, %08x] --> [%08x, %08x %08x] --> [%08x, %08x %08x]",
49 pt.hcode[0], pt.hcode[1], pt.hcode[2], code.hcode[0], code.hcode[1], code.hcode[2], pt2.hcode[0], pt2.hcode[1], pt2.hcode[2]);
54 main(int argc UNUSED, char **argv UNUSED)