aboutsummaryrefslogtreecommitdiff
path: root/src/cubetypes.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-12-16 19:25:58 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-12-16 19:25:58 +0100
commit2f924f942bd6e7126e8f1d8692e475c95bd9fe82 (patch)
treedd5877c2fd836f43523263e48632946423401093 /src/cubetypes.h
parent4e2b4e603c7e84c7556f489d7d8dab06915b3a9b (diff)
downloadnissy-2f924f942bd6e7126e8f1d8692e475c95bd9fe82.tar.gz
nissy-2f924f942bd6e7126e8f1d8692e475c95bd9fe82.zip
Added a new pruning table (equivalent to nxopt31). I have not tested it yet, it takes a while to generate.
Plus I have done a whole lot of refactoring in random places because I cannot focus on one thing at the time.
Diffstat (limited to '')
-rw-r--r--src/cubetypes.h23
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;
83typedef struct cubearray CubeArray; 84typedef struct cubearray CubeArray;
84typedef struct dfsarg DfsArg; 85typedef struct dfsarg DfsArg;
85typedef struct estimatedata EstimateData; 86typedef struct estimatedata EstimateData;
87typedef struct moveset Moveset;
86typedef struct piecefilter PieceFilter; 88typedef struct piecefilter PieceFilter;
87typedef struct prunedata PruneData; 89typedef struct prunedata PruneData;
88typedef struct solveoptions SolveOptions; 90typedef struct solveoptions SolveOptions;
@@ -97,7 +99,6 @@ typedef int (*Estimator) (DfsArg *);
97typedef bool (*Validator) (Alg *); 99typedef bool (*Validator) (Alg *);
98typedef void (*Exec) (CommandArgs *); 100typedef void (*Exec) (CommandArgs *);
99typedef uint64_t (*Indexer) (Cube); 101typedef uint64_t (*Indexer) (Cube);
100typedef bool (*Moveset) (Move);
101typedef CommandArgs * (*ArgParser) (int, char **); 102typedef CommandArgs * (*ArgParser) (int, char **);
102typedef Trans (*TransDetector) (Cube); 103typedef Trans (*TransDetector) (Cube);
103typedef int (*TransFinder) (uint64_t, Trans *); 104typedef 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
222struct 221struct
@@ -233,6 +232,15 @@ estimatedata
233}; 232};
234 233
235struct 234struct
235moveset
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
243struct
236piecefilter 244piecefilter
237{ 245{
238 bool epose; 246 bool epose;
@@ -252,11 +260,11 @@ struct
252prunedata 260prunedata
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
262struct 270struct
@@ -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;

Generated with cgit - Back to sebastiano.tronto.net