diff options
Diffstat (limited to '')
| -rw-r--r-- | src/cubetypes.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/cubetypes.h b/src/cubetypes.h index 3ad960b..d1d36b2 100644 --- a/src/cubetypes.h +++ b/src/cubetypes.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #define NMOVES 55 /* Actually 54, but one is NULLMOVE */ | 8 | #define NMOVES 55 /* Actually 54, but one is NULLMOVE */ |
| 9 | #define NTRANS 48 | 9 | #define NTRANS 48 |
| 10 | #define NROTATIONS 24 | 10 | #define NROTATIONS 24 |
| 11 | #define entry_group_t uint8_t /* For pruning tables */ | ||
| 11 | 12 | ||
| 12 | /* Enums *********************************************************************/ | 13 | /* Enums *********************************************************************/ |
| 13 | 14 | ||
| @@ -83,6 +84,7 @@ typedef struct cube Cube; | |||
| 83 | typedef struct cubearray CubeArray; | 84 | typedef struct cubearray CubeArray; |
| 84 | typedef struct dfsarg DfsArg; | 85 | typedef struct dfsarg DfsArg; |
| 85 | typedef struct estimatedata EstimateData; | 86 | typedef struct estimatedata EstimateData; |
| 87 | typedef struct moveset Moveset; | ||
| 86 | typedef struct piecefilter PieceFilter; | 88 | typedef struct piecefilter PieceFilter; |
| 87 | typedef struct prunedata PruneData; | 89 | typedef struct prunedata PruneData; |
| 88 | typedef struct solveoptions SolveOptions; | 90 | typedef struct solveoptions SolveOptions; |
| @@ -97,7 +99,6 @@ typedef int (*Estimator) (DfsArg *); | |||
| 97 | typedef bool (*Validator) (Alg *); | 99 | typedef bool (*Validator) (Alg *); |
| 98 | typedef void (*Exec) (CommandArgs *); | 100 | typedef void (*Exec) (CommandArgs *); |
| 99 | typedef uint64_t (*Indexer) (Cube); | 101 | typedef uint64_t (*Indexer) (Cube); |
| 100 | typedef bool (*Moveset) (Move); | ||
| 101 | typedef CommandArgs * (*ArgParser) (int, char **); | 102 | typedef CommandArgs * (*ArgParser) (int, char **); |
| 102 | typedef Trans (*TransDetector) (Cube); | 103 | typedef Trans (*TransDetector) (Cube); |
| 103 | typedef int (*TransFinder) (uint64_t, Trans *); | 104 | typedef int (*TransFinder) (uint64_t, Trans *); |
| @@ -215,8 +216,6 @@ dfsarg | |||
| 215 | AlgList * sols; | 216 | AlgList * sols; |
| 216 | pthread_mutex_t * sols_mutex; | 217 | pthread_mutex_t * sols_mutex; |
| 217 | Alg * current_alg; | 218 | Alg * current_alg; |
| 218 | Move * sorted_moves; | ||
| 219 | int * move_position; | ||
| 220 | }; | 219 | }; |
| 221 | 220 | ||
| 222 | struct | 221 | struct |
| @@ -233,6 +232,15 @@ estimatedata | |||
| 233 | }; | 232 | }; |
| 234 | 233 | ||
| 235 | struct | 234 | struct |
| 235 | moveset | ||
| 236 | { | ||
| 237 | bool (*allowed)(Move); | ||
| 238 | bool (*allowed_next)(Move, Move, Move); | ||
| 239 | Move sorted_moves[NMOVES+1]; | ||
| 240 | uint64_t mask[NMOVES][NMOVES]; | ||
| 241 | }; | ||
| 242 | |||
| 243 | struct | ||
| 236 | piecefilter | 244 | piecefilter |
| 237 | { | 245 | { |
| 238 | bool epose; | 246 | bool epose; |
| @@ -252,11 +260,11 @@ struct | |||
| 252 | prunedata | 260 | prunedata |
| 253 | { | 261 | { |
| 254 | char * filename; | 262 | char * filename; |
| 255 | uint8_t * ptable; | 263 | entry_group_t * ptable; |
| 256 | bool generated; | 264 | bool generated; |
| 257 | uint64_t n; | 265 | uint64_t n; |
| 258 | Coordinate * coord; | 266 | Coordinate * coord; |
| 259 | Moveset moveset; | 267 | Moveset * moveset; |
| 260 | }; | 268 | }; |
| 261 | 269 | ||
| 262 | struct | 270 | struct |
| @@ -284,7 +292,7 @@ step | |||
| 284 | Checker ready; | 292 | Checker ready; |
| 285 | char * ready_msg; | 293 | char * ready_msg; |
| 286 | Validator is_valid; | 294 | Validator is_valid; |
| 287 | Moveset moveset; | 295 | Moveset * moveset; |
| 288 | Trans pre_trans; | 296 | Trans pre_trans; |
| 289 | TransDetector detect; | 297 | TransDetector detect; |
| 290 | int ntables; | 298 | int ntables; |
| @@ -312,8 +320,6 @@ threaddatasolve | |||
| 312 | Cube cube; | 320 | Cube cube; |
| 313 | Step * step; | 321 | Step * step; |
| 314 | int depth; | 322 | int depth; |
| 315 | Move * sorted_moves; | ||
| 316 | int * move_position; | ||
| 317 | SolveOptions * opts; | 323 | SolveOptions * opts; |
| 318 | AlgList * start; | 324 | AlgList * start; |
| 319 | AlgListNode ** node; | 325 | AlgListNode ** node; |
| @@ -329,7 +335,6 @@ threaddatagenpt | |||
| 329 | int nthreads; | 335 | int nthreads; |
| 330 | PruneData * pd; | 336 | PruneData * pd; |
| 331 | int d; | 337 | int d; |
| 332 | Move * ms; | ||
| 333 | int nchunks; | 338 | int nchunks; |
| 334 | pthread_mutex_t ** mutex; | 339 | pthread_mutex_t ** mutex; |
| 335 | pthread_mutex_t * upmutex; | 340 | pthread_mutex_t * upmutex; |
