diff options
Diffstat (limited to 'test/102_coord_invcoord_h48')
| -rw-r--r-- | test/102_coord_invcoord_h48/coord_invcoord_h48_tests.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/test/102_coord_invcoord_h48/coord_invcoord_h48_tests.c b/test/102_coord_invcoord_h48/coord_invcoord_h48_tests.c index 5022608..b0668df 100644 --- a/test/102_coord_invcoord_h48/coord_invcoord_h48_tests.c +++ b/test/102_coord_invcoord_h48/coord_invcoord_h48_tests.c | |||
| @@ -2,10 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | #define COCSEP_CLASSES 3393 | 3 | #define COCSEP_CLASSES 3393 |
| 4 | 4 | ||
| 5 | size_t gendata_cocsep(void *, uint64_t *, cube_fast_t *); | 5 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); |
| 6 | int64_t coord_h48(cube_fast_t, const uint32_t *, uint8_t); | 6 | int64_t coord_h48(cube_t, const uint32_t *, uint8_t); |
| 7 | cube_fast_t invcoord_h48(int64_t, const cube_fast_t *, uint8_t); | 7 | cube_t invcoord_h48(int64_t, const cube_t *, uint8_t); |
| 8 | cube_fast_t transform(cube_fast_t, uint8_t); | 8 | cube_t transform(cube_t, uint8_t); |
| 9 | 9 | ||
| 10 | int main(void) { | 10 | int main(void) { |
| 11 | char str[STRLENMAX]; | 11 | char str[STRLENMAX]; |
| @@ -15,8 +15,7 @@ int main(void) { | |||
| 15 | uint32_t cocsepdata[300000]; | 15 | uint32_t cocsepdata[300000]; |
| 16 | uint64_t selfsim[COCSEP_CLASSES]; | 16 | uint64_t selfsim[COCSEP_CLASSES]; |
| 17 | int64_t c, cc; | 17 | int64_t c, cc; |
| 18 | cube_t cube; | 18 | cube_t cube, invc, rep[COCSEP_CLASSES]; |
| 19 | cube_fast_t fast, invc, rep[COCSEP_CLASSES]; | ||
| 20 | 19 | ||
| 21 | gendata_cocsep(cocsepdata, selfsim, rep); | 20 | gendata_cocsep(cocsepdata, selfsim, rep); |
| 22 | 21 | ||
| @@ -24,12 +23,11 @@ int main(void) { | |||
| 24 | h = 11; | 23 | h = 11; |
| 25 | while (fgets(str, STRLENMAX, stdin) != NULL) { | 24 | while (fgets(str, STRLENMAX, stdin) != NULL) { |
| 26 | cube = readcube("H48", str); | 25 | cube = readcube("H48", str); |
| 27 | fast = cubetofast(cube); | 26 | c = coord_h48(cube, cocsepdata, h); |
| 28 | c = coord_h48(fast, cocsepdata, h); | ||
| 29 | invc = invcoord_h48(c, rep, h); | 27 | invc = invcoord_h48(c, rep, h); |
| 30 | for (t = 0, found = false; t < 48; t++) { | 28 | for (t = 0, found = false; t < 48; t++) { |
| 31 | fast = transform(invc, t); | 29 | cube = transform(invc, t); |
| 32 | cc = coord_h48(fast, cocsepdata, h); | 30 | cc = coord_h48(cube, cocsepdata, h); |
| 33 | found = found || cc == c; | 31 | found = found || cc == c; |
| 34 | } | 32 | } |
| 35 | printf("%d %s\n", i, found ? "ok" : "ERROR"); | 33 | printf("%d %s\n", i, found ? "ok" : "ERROR"); |
