From b6fd508253bce9225dd24b6538adb5093892c4f8 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 7 Dec 2021 12:20:51 +0100 Subject: Little performance improvement in optimal solver - more to come! --- src/cubetypes.h | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'src/cubetypes.h') diff --git a/src/cubetypes.h b/src/cubetypes.h index f11f480..3f350af 100644 --- a/src/cubetypes.h +++ b/src/cubetypes.h @@ -81,8 +81,9 @@ typedef struct commandargs CommandArgs; typedef struct coordinate Coordinate; typedef struct cube Cube; typedef struct cubearray CubeArray; -typedef struct cubetarget CubeTarget; typedef struct dfsdata DfsData; +typedef struct estimatedata EstimateData; +typedef struct localinfo LocalInfo; typedef struct piecefilter PieceFilter; typedef struct prunedata PruneData; typedef struct solveoptions SolveOptions; @@ -92,7 +93,7 @@ typedef struct threaddata ThreadData; typedef Cube (*AntiIndexer) (uint64_t); typedef bool (*Checker) (Cube); -typedef int (*Estimator) (CubeTarget); +typedef int (*Estimator) (EstimateData *); typedef bool (*Validator) (Alg *); typedef void (*Exec) (CommandArgs *); typedef uint64_t (*Indexer) (Cube); @@ -195,13 +196,6 @@ cubearray int * cpos; }; -struct -cubetarget -{ - Cube cube; - int target; -}; - struct dfsdata { @@ -211,6 +205,7 @@ dfsdata bool niss; Move last1; Move last2; + EstimateData * ed; AlgList * sols; pthread_mutex_t * sols_mutex; Alg * current_alg; @@ -219,6 +214,29 @@ dfsdata uint8_t * visited; }; +struct +estimatedata +{ + Cube cube; + int target; + Move lastmove; + uint64_t movebitmask; + LocalInfo * li; +}; + +struct +localinfo +{ + int corners; + int normal_ud; + int normal_fb; + int normal_rl; + int inverse_ud; + int inverse_fb; + int inverse_rl; + int prev_ret; +}; + struct piecefilter { -- cgit v1.3