diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-17 08:54:20 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-17 08:54:20 +0200 |
| commit | 2d0ab15ac1f81c76cb6bb31bbdad3d2ee339e062 (patch) | |
| tree | a20741b4fb345d24b3149bd50bcfe5833484fd2b /src/solvers/coord/drfinnoe.h | |
| parent | 0ad2e864f63e77157815242b96faafdfae376dd8 (diff) | |
| download | nissy-core-2d0ab15ac1f81c76cb6bb31bbdad3d2ee339e062.tar.gz nissy-core-2d0ab15ac1f81c76cb6bb31bbdad3d2ee339e062.zip | |
Renamed drslice drfinnoe
Diffstat (limited to 'src/solvers/coord/drfinnoe.h')
| -rw-r--r-- | src/solvers/coord/drfinnoe.h | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/src/solvers/coord/drfinnoe.h b/src/solvers/coord/drfinnoe.h new file mode 100644 index 0000000..984b10a --- /dev/null +++ b/src/solvers/coord/drfinnoe.h | |||
| @@ -0,0 +1,140 @@ | |||
| 1 | /* | ||
| 2 | TODO | ||
| 3 | |||
| 4 | The pruning table for this coordinate shows some odd behavior, which | ||
| 5 | is actually also present in nissy-classic: after completing depth 14, | ||
| 6 | if the search is let run for higher depth, no more positions are found. | ||
| 7 | This could be as simple as a small bug in the logic of the pruning table | ||
| 8 | calculations - I may be assuming somewhere that I am never going to search | ||
| 9 | for depths >= 15, since they are the highest possible value anyway - | ||
| 10 | or some reason related to symmetry - are some cases actually impossible? | ||
| 11 | In the worst case, it is a bug to be fixed, but I find it unlikely. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #define CLASSES_CP_16 2768 | ||
| 15 | |||
| 16 | STATIC uint64_t coordinate_cp_coord(cube_t); | ||
| 17 | STATIC cube_t coordinate_cp_cube(uint64_t); | ||
| 18 | STATIC uint64_t coordinate_epud_coord(cube_t); | ||
| 19 | STATIC cube_t coordinate_epud_cube(uint64_t); | ||
| 20 | STATIC cube_t coordinate_drfinnoe_merge(cube_t, cube_t); | ||
| 21 | |||
| 22 | STATIC uint64_t coordinate_drfinnoe_coord(cube_t, const unsigned char *); | ||
| 23 | STATIC cube_t coordinate_drfinnoe_cube(uint64_t, const unsigned char *); | ||
| 24 | STATIC bool coordinate_drfinnoe_isnasty(uint64_t, const unsigned char *); | ||
| 25 | STATIC size_t coordinate_drfinnoe_gendata(unsigned char *); | ||
| 26 | |||
| 27 | STATIC bool is_drfinnoe_solvable(cube_t); | ||
| 28 | |||
| 29 | STATIC coord_t coordinate_drfinnoe = { | ||
| 30 | .name = "DRFINNOE", | ||
| 31 | .coord = &coordinate_drfinnoe_coord, | ||
| 32 | .cube = &coordinate_drfinnoe_cube, | ||
| 33 | .isnasty = &coordinate_drfinnoe_isnasty, | ||
| 34 | .gendata = coordinate_drfinnoe_gendata, | ||
| 35 | .max = CLASSES_CP_16 * FACT_8, | ||
| 36 | .trans_mask = TM_UDFIX, | ||
| 37 | .moves_mask = MM18_DR, | ||
| 38 | .axistrans = { | ||
| 39 | [AXIS_UD] = TRANS_UFr, | ||
| 40 | [AXIS_RL] = TRANS_RFr, | ||
| 41 | [AXIS_FB] = TRANS_FDr, | ||
| 42 | }, | ||
| 43 | .is_admissible = &solution_always_valid, | ||
| 44 | .is_solvable = &is_drfinnoe_solvable, | ||
| 45 | .pruning_distribution = { | ||
| 46 | [0] = 1, | ||
| 47 | [1] = 3, | ||
| 48 | [2] = 10, | ||
| 49 | [3] = 52, | ||
| 50 | [4] = 285, | ||
| 51 | [5] = 1318, | ||
| 52 | [6] = 5671, | ||
| 53 | [7] = 26502, | ||
| 54 | [8] = 115467, | ||
| 55 | [9] = 470846, | ||
| 56 | [10] = 1853056, | ||
| 57 | [11] = 6535823, | ||
| 58 | [12] = 18349792, | ||
| 59 | [13] = 32843350, | ||
| 60 | [14] = 34118883, | ||
| 61 | [15] = 17284701 | ||
| 62 | }, | ||
| 63 | .pruning_max = 15, | ||
| 64 | .sym = { | ||
| 65 | .classes = CLASSES_CP_16, | ||
| 66 | .max = FACT_8, | ||
| 67 | .coord = &coordinate_cp_coord, | ||
| 68 | .cube = &coordinate_cp_cube, | ||
| 69 | .max2 = FACT_8, | ||
| 70 | .coord2 = &coordinate_epud_coord, | ||
| 71 | .cube2 = &coordinate_epud_cube, | ||
| 72 | .merge = &coordinate_drfinnoe_merge, | ||
| 73 | }, | ||
| 74 | }; | ||
| 75 | |||
| 76 | STATIC uint64_t | ||
| 77 | coordinate_cp_coord(cube_t c) | ||
| 78 | { | ||
| 79 | return coord_cp(c); | ||
| 80 | } | ||
| 81 | |||
| 82 | STATIC cube_t | ||
| 83 | coordinate_cp_cube(uint64_t i) | ||
| 84 | { | ||
| 85 | return invcoord_cp(i); | ||
| 86 | } | ||
| 87 | |||
| 88 | STATIC uint64_t | ||
| 89 | coordinate_epud_coord(cube_t c) | ||
| 90 | { | ||
| 91 | return coord_epud(c); | ||
| 92 | } | ||
| 93 | |||
| 94 | STATIC cube_t | ||
| 95 | coordinate_epud_cube(uint64_t i) | ||
| 96 | { | ||
| 97 | return invcoord_epud(i); | ||
| 98 | } | ||
| 99 | |||
| 100 | STATIC cube_t | ||
| 101 | coordinate_drfinnoe_merge(cube_t c1, cube_t c2) | ||
| 102 | { | ||
| 103 | cube_t merged; | ||
| 104 | |||
| 105 | merged = c1; | ||
| 106 | copy_edges(&merged, c2); | ||
| 107 | |||
| 108 | return merged; | ||
| 109 | } | ||
| 110 | |||
| 111 | STATIC uint64_t | ||
| 112 | coordinate_drfinnoe_coord(cube_t cube, const unsigned char *data) | ||
| 113 | { | ||
| 114 | return coord_coord_generic(&coordinate_drfinnoe, cube, data); | ||
| 115 | } | ||
| 116 | |||
| 117 | STATIC cube_t | ||
| 118 | coordinate_drfinnoe_cube(uint64_t i, const unsigned char *data) | ||
| 119 | { | ||
| 120 | return coord_cube_generic(&coordinate_drfinnoe, i, data); | ||
| 121 | } | ||
| 122 | |||
| 123 | STATIC bool | ||
| 124 | coordinate_drfinnoe_isnasty(uint64_t i, const unsigned char *data) | ||
| 125 | { | ||
| 126 | return coord_isnasty_generic(&coordinate_drfinnoe, i, data); | ||
| 127 | } | ||
| 128 | |||
| 129 | STATIC size_t | ||
| 130 | coordinate_drfinnoe_gendata(unsigned char *data) | ||
| 131 | { | ||
| 132 | return coord_gendata_generic(&coordinate_drfinnoe, data); | ||
| 133 | } | ||
| 134 | |||
| 135 | STATIC bool | ||
| 136 | is_drfinnoe_solvable(cube_t cube) { | ||
| 137 | return coord_eo(cube) == 0 && | ||
| 138 | coord_eo(transform_edges(cube, TRANS_URr)) == 0 && | ||
| 139 | coord_co(cube) == 0; | ||
| 140 | } | ||
