diff options
Diffstat (limited to 'cube.h')
| -rw-r--r-- | cube.h | 33 |
1 files changed, 33 insertions, 0 deletions
| @@ -0,0 +1,33 @@ | |||
| 1 | #ifdef CUBE_AVX2 | ||
| 2 | #include <immintrin.h> | ||
| 3 | typedef __m256i cube_t; | ||
| 4 | #else | ||
| 5 | typedef struct { | ||
| 6 | uint8_t c[16]; /* Only the first 8 are used, the rest is padding */ | ||
| 7 | uint8_t e[16]; /* Only the first 12 are used, the rest is padding */ | ||
| 8 | } cube_t; | ||
| 9 | #endif | ||
| 10 | |||
| 11 | typedef uint8_t move_t; | ||
| 12 | typedef uint8_t trans_t; | ||
| 13 | |||
| 14 | int readmoves(char *, move_t *); | ||
| 15 | void writemoves(move_t *, int, char *); | ||
| 16 | trans_t readtrans(char *); | ||
| 17 | void writetrans(trans_t, char *); | ||
| 18 | |||
| 19 | typedef enum {AVX, H48, SRC} format_t; | ||
| 20 | cube_t readcube(format_t, char *); /* Supports: H48 */ | ||
| 21 | void writecube(format_t, cube_t, char *); /* Supports: AVX, H48, SRC */ | ||
| 22 | |||
| 23 | cube_t solvedcube(void); | ||
| 24 | cube_t zerocube(void); | ||
| 25 | bool issolvable(cube_t); | ||
| 26 | bool equal(cube_t, cube_t); | ||
| 27 | bool issolved(cube_t); | ||
| 28 | bool iserror(cube_t); | ||
| 29 | |||
| 30 | cube_t move(cube_t, move_t); | ||
| 31 | cube_t inverse(cube_t); | ||
| 32 | cube_t compose(cube_t, cube_t); | ||
| 33 | cube_t transform(cube_t, trans_t); | ||
