aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/coord
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers/coord')
-rw-r--r--src/solvers/coord/checkdata.h5
-rw-r--r--src/solvers/coord/common.h5
-rw-r--r--src/solvers/coord/coord.h5
-rw-r--r--src/solvers/coord/corners.h5
-rw-r--r--src/solvers/coord/cornersx.h5
-rw-r--r--src/solvers/coord/cpepe.h5
-rw-r--r--src/solvers/coord/dr.h5
-rw-r--r--src/solvers/coord/dreo.h5
-rw-r--r--src/solvers/coord/drfin.h5
-rw-r--r--src/solvers/coord/drfinnoe.h5
-rw-r--r--src/solvers/coord/drslice.h5
-rw-r--r--src/solvers/coord/eo.h5
-rw-r--r--src/solvers/coord/gendata.h5
-rw-r--r--src/solvers/coord/htr.h5
-rw-r--r--src/solvers/coord/list.h5
-rw-r--r--src/solvers/coord/multisolve.h5
-rw-r--r--src/solvers/coord/solve.h5
-rw-r--r--src/solvers/coord/types_macros.h5
-rw-r--r--src/solvers/coord/utils.h5
19 files changed, 95 insertions, 0 deletions
diff --git a/src/solvers/coord/checkdata.h b/src/solvers/coord/checkdata.h
index 51265a8..a5d5316 100644
--- a/src/solvers/coord/checkdata.h
+++ b/src/solvers/coord/checkdata.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_CHECKDATA_H
2#define SOLVERS_COORD_CHECKDATA_H
3
1STATIC long long checkdata_coord_dispatch( 4STATIC long long checkdata_coord_dispatch(
2 const char *, unsigned long long, const unsigned char *); 5 const char *, unsigned long long, const unsigned char *);
3STATIC long long checkdata_coord( 6STATIC long long checkdata_coord(
@@ -120,3 +123,5 @@ checkdata_multicoord(
120 123
121 return NISSY_OK; 124 return NISSY_OK;
122} 125}
126
127#endif /* SOLVERS_COORD_CHECKDATA_H */
diff --git a/src/solvers/coord/common.h b/src/solvers/coord/common.h
index 3a62e85..8e6db20 100644
--- a/src/solvers/coord/common.h
+++ b/src/solvers/coord/common.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_COMMON_H
2#define SOLVERS_COORD_COMMON_H
3
1STATIC uint64_t coord_coord_generic( 4STATIC uint64_t coord_coord_generic(
2 const coord_t [NON_NULL], cube_t, const unsigned char *); 5 const coord_t [NON_NULL], cube_t, const unsigned char *);
3STATIC cube_t coord_cube_generic( 6STATIC cube_t coord_cube_generic(
@@ -229,3 +232,5 @@ coordinate_merge_cpco(cube_t cp, cube_t co)
229 232
230 return merged; 233 return merged;
231} 234}
235
236#endif /* SOLVERS_COORD_COMMON_H */
diff --git a/src/solvers/coord/coord.h b/src/solvers/coord/coord.h
index 98f4d05..6c4cc1b 100644
--- a/src/solvers/coord/coord.h
+++ b/src/solvers/coord/coord.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_COORD_H
2#define SOLVERS_COORD_COORD_H
3
1#include "types_macros.h" 4#include "types_macros.h"
2#include "common.h" 5#include "common.h"
3#include "eo.h" 6#include "eo.h"
@@ -16,3 +19,5 @@
16#include "checkdata.h" 19#include "checkdata.h"
17#include "solve.h" 20#include "solve.h"
18#include "multisolve.h" 21#include "multisolve.h"
22
23#endif /* SOLVERS_COORD_COORD_H */
diff --git a/src/solvers/coord/corners.h b/src/solvers/coord/corners.h
index cc0d9a5..6dd60b5 100644
--- a/src/solvers/coord/corners.h
+++ b/src/solvers/coord/corners.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_CORNERS_H
2#define SOLVERS_COORD_CORNERS_H
3
1#define CLASSES_CP_48 984 4#define CLASSES_CP_48 984
2 5
3STATIC uint64_t coordinate_corners_coord(const cube_t, const unsigned char *); 6STATIC uint64_t coordinate_corners_coord(const cube_t, const unsigned char *);
@@ -70,3 +73,5 @@ coordinate_corners_gendata(unsigned char *data)
70{ 73{
71 return coord_gendata_generic(&coordinate_corners, data); 74 return coord_gendata_generic(&coordinate_corners, data);
72} 75}
76
77#endif /* SOLVERS_COORD_CORNERS_H */
diff --git a/src/solvers/coord/cornersx.h b/src/solvers/coord/cornersx.h
index 788db8d..f4b564f 100644
--- a/src/solvers/coord/cornersx.h
+++ b/src/solvers/coord/cornersx.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_CORNERSX_H
2#define SOLVERS_COORD_CORNERSX_H
3
1STATIC bool is_cornersx_solved(uint64_t, const unsigned char *); 4STATIC bool is_cornersx_solved(uint64_t, const unsigned char *);
2 5
3STATIC coord_t coordinate_cornersx = { 6STATIC coord_t coordinate_cornersx = {
@@ -74,3 +77,5 @@ is_cornersx_solved(uint64_t coord, const unsigned char *data)
74 77
75 return false; 78 return false;
76} 79}
80
81#endif /* SOLVERS_COORD_CORNERSX_H */
diff --git a/src/solvers/coord/cpepe.h b/src/solvers/coord/cpepe.h
index 7035400..1ad80dd 100644
--- a/src/solvers/coord/cpepe.h
+++ b/src/solvers/coord/cpepe.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_CPEPE_H
2#define SOLVERS_COORD_CPEPE_H
3
1STATIC uint64_t coordinate_cpepe_coord(const cube_t, const unsigned char *); 4STATIC uint64_t coordinate_cpepe_coord(const cube_t, const unsigned char *);
2STATIC cube_t coordinate_cpepe_cube(uint64_t, const unsigned char *); 5STATIC cube_t coordinate_cpepe_cube(uint64_t, const unsigned char *);
3STATIC bool coordinate_cpepe_isnasty(uint64_t, const unsigned char *); 6STATIC bool coordinate_cpepe_isnasty(uint64_t, const unsigned char *);
@@ -71,3 +74,5 @@ coordinate_cpepe_gendata(unsigned char *data)
71{ 74{
72 return coord_gendata_generic(&coordinate_cpepe, data); 75 return coord_gendata_generic(&coordinate_cpepe, data);
73} 76}
77
78#endif /* SOLVERS_COORD_CPEPE_H */
diff --git a/src/solvers/coord/dr.h b/src/solvers/coord/dr.h
index 8100910..c5c73c2 100644
--- a/src/solvers/coord/dr.h
+++ b/src/solvers/coord/dr.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_DR_H
2#define SOLVERS_COORD_DR_H
3
1#define DREOESEP_CLASSES UINT64_C(64430) 4#define DREOESEP_CLASSES UINT64_C(64430)
2#define DREOESEP_MAX (POW_2_11 * COMB_12_4) 5#define DREOESEP_MAX (POW_2_11 * COMB_12_4)
3 6
@@ -117,3 +120,5 @@ is_eoco_solvable(cube_t cube) {
117 120
118 return cocount % 3 == 0 && eocount % 2 == 0; 121 return cocount % 3 == 0 && eocount % 2 == 0;
119} 122}
123
124#endif /* SOLVERS_COORD_DR_H */
diff --git a/src/solvers/coord/dreo.h b/src/solvers/coord/dreo.h
index c5cacac..a201ae6 100644
--- a/src/solvers/coord/dreo.h
+++ b/src/solvers/coord/dreo.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_DREO_H
2#define SOLVERS_COORD_DREO_H
3
1#define DRESEP_CLASSES 81 4#define DRESEP_CLASSES 81
2 5
3STATIC uint64_t coord_dresep_nosym(cube_t); 6STATIC uint64_t coord_dresep_nosym(cube_t);
@@ -101,3 +104,5 @@ is_dreo_solvable(cube_t cube) {
101 104
102 return cocount % 3 == 0; 105 return cocount % 3 == 0;
103} 106}
107
108#endif /* SOLVERS_COORD_DREO_H */
diff --git a/src/solvers/coord/drfin.h b/src/solvers/coord/drfin.h
index 569419b..ec645a2 100644
--- a/src/solvers/coord/drfin.h
+++ b/src/solvers/coord/drfin.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_DRFIN_H
2#define SOLVERS_COORD_DRFIN_H
3
1STATIC bool is_drfin_solvable(cube_t); 4STATIC bool is_drfin_solvable(cube_t);
2 5
3STATIC multicoord_t multicoordinate_drfin = { 6STATIC multicoord_t multicoordinate_drfin = {
@@ -15,3 +18,5 @@ is_drfin_solvable(cube_t cube)
15 coord_co(cube) == 0 && 18 coord_co(cube) == 0 &&
16 issolvable((oriented_cube_t){.cube = cube, .orientation = 0}); 19 issolvable((oriented_cube_t){.cube = cube, .orientation = 0});
17} 20}
21
22#endif /* SOLVERS_COORD_DRFIN_H */
diff --git a/src/solvers/coord/drfinnoe.h b/src/solvers/coord/drfinnoe.h
index 63f4edf..5ffffc3 100644
--- a/src/solvers/coord/drfinnoe.h
+++ b/src/solvers/coord/drfinnoe.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_DRFINNOE_H
2#define SOLVERS_COORD_DRFINNOE_H
3
1/* 4/*
2TODO 5TODO
3 6
@@ -96,3 +99,5 @@ is_drfinnoe_solvable(cube_t cube) {
96 coord_eo(transform_edges(cube, TRANS_URr)) == 0 && 99 coord_eo(transform_edges(cube, TRANS_URr)) == 0 &&
97 coord_co(cube) == 0; 100 coord_co(cube) == 0;
98} 101}
102
103#endif /* SOLVERS_COORD_DRFINNOE_H */
diff --git a/src/solvers/coord/drslice.h b/src/solvers/coord/drslice.h
index 42699f8..87bf87e 100644
--- a/src/solvers/coord/drslice.h
+++ b/src/solvers/coord/drslice.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_DRSLICE_H
2#define SOLVERS_COORD_DRSLICE_H
3
1/* 4/*
2The DRSLICE coordinate is almost identical to DRFINNOE, but it allows for 5The DRSLICE coordinate is almost identical to DRFINNOE, but it allows for
3the centers of the E layer to be off by a rotation. For this reason we reuse 6the centers of the E layer to be off by a rotation. For this reason we reuse
@@ -95,3 +98,5 @@ is_drslice_solved(uint64_t i, const unsigned char *data)
95 /* Pre-computed coordinates of U D' (= U' D up to trans) and U2 D2 */ 98 /* Pre-computed coordinates of U D' (= U' D up to trans) and U2 D2 */
96 return i == 0 || i == 109779816 || i == 68468527; 99 return i == 0 || i == 109779816 || i == 68468527;
97} 100}
101
102#endif /* SOLVERS_COORD_DRSLICE_H */
diff --git a/src/solvers/coord/eo.h b/src/solvers/coord/eo.h
index 42196af..a5a0e85 100644
--- a/src/solvers/coord/eo.h
+++ b/src/solvers/coord/eo.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_EO_H
2#define SOLVERS_COORD_EO_H
3
1STATIC uint64_t coordinate_eo_coord(cube_t, const unsigned char *); 4STATIC uint64_t coordinate_eo_coord(cube_t, const unsigned char *);
2STATIC cube_t coordinate_eo_cube(uint64_t, const unsigned char *); 5STATIC cube_t coordinate_eo_cube(uint64_t, const unsigned char *);
3STATIC bool coordinate_eo_isnasty(uint64_t, const unsigned char *); 6STATIC bool coordinate_eo_isnasty(uint64_t, const unsigned char *);
@@ -57,3 +60,5 @@ coordinate_eo_gendata(unsigned char *data)
57{ 60{
58 return 0; 61 return 0;
59} 62}
63
64#endif /* SOLVERS_COORD_EO_H */
diff --git a/src/solvers/coord/gendata.h b/src/solvers/coord/gendata.h
index 81ab842..a48263c 100644
--- a/src/solvers/coord/gendata.h
+++ b/src/solvers/coord/gendata.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_GENDATA_H
2#define SOLVERS_COORD_GENDATA_H
3
1STATIC size_t gendata_coord(const coord_t [NON_NULL], unsigned char *); 4STATIC size_t gendata_coord(const coord_t [NON_NULL], unsigned char *);
2STATIC size_t gendata_multicoord( 5STATIC size_t gendata_multicoord(
3 const multicoord_t [NON_NULL], unsigned char *); 6 const multicoord_t [NON_NULL], unsigned char *);
@@ -362,3 +365,5 @@ set_coord_pval(
362 table[COORD_INDEX(i)] = (table[COORD_INDEX(i)] & (~COORD_MASK(i))) 365 table[COORD_INDEX(i)] = (table[COORD_INDEX(i)] & (~COORD_MASK(i)))
363 | (val << COORD_SHIFT(i)); 366 | (val << COORD_SHIFT(i));
364} 367}
368
369#endif /* SOLVERS_COORD_GENDATA_H */
diff --git a/src/solvers/coord/htr.h b/src/solvers/coord/htr.h
index 602625b..d6fc311 100644
--- a/src/solvers/coord/htr.h
+++ b/src/solvers/coord/htr.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_HTR_H
2#define SOLVERS_COORD_HTR_H
3
1STATIC uint64_t coordinate_htr_coord(cube_t, const unsigned char *); 4STATIC uint64_t coordinate_htr_coord(cube_t, const unsigned char *);
2STATIC cube_t coordinate_htr_cube(uint64_t, const unsigned char *); 5STATIC cube_t coordinate_htr_cube(uint64_t, const unsigned char *);
3STATIC bool coordinate_htr_isnasty(uint64_t, const unsigned char *); 6STATIC bool coordinate_htr_isnasty(uint64_t, const unsigned char *);
@@ -123,3 +126,5 @@ is_cp_htr(uint64_t i, const unsigned char *data)
123 126
124 return e == 0 && is_cp16_htr_table[c / 8] & (UINT8_C(1) << (c % 8)); 127 return e == 0 && is_cp16_htr_table[c / 8] & (UINT8_C(1) << (c % 8));
125} 128}
129
130#endif /* SOLVERS_COORD_HTR_H */
diff --git a/src/solvers/coord/list.h b/src/solvers/coord/list.h
index 6856c13..71f7920 100644
--- a/src/solvers/coord/list.h
+++ b/src/solvers/coord/list.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_LIST_H
2#define SOLVERS_COORD_LIST_H
3
1coord_t *all_coordinates[] = { 4coord_t *all_coordinates[] = {
2 &coordinate_eo, 5 &coordinate_eo,
3 &coordinate_dr, 6 &coordinate_dr,
@@ -15,3 +18,5 @@ multicoord_t *all_multicoordinates[] = {
15 &multicoordinate_drfin, 18 &multicoordinate_drfin,
16 NULL 19 NULL
17}; 20};
21
22#endif /* SOLVERS_COORD_LIST_H */
diff --git a/src/solvers/coord/multisolve.h b/src/solvers/coord/multisolve.h
index efd287d..4990a39 100644
--- a/src/solvers/coord/multisolve.h
+++ b/src/solvers/coord/multisolve.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_MULTISOLVE_H
2#define SOLVERS_COORD_MULTISOLVE_H
3
1/* 4/*
2For now the only multicoordinate is DRFIN, and this solver reflects this. 5For now the only multicoordinate is DRFIN, and this solver reflects this.
3For example, NISS is not available. 6For example, NISS is not available.
@@ -297,3 +300,5 @@ solve_multicoord_error_unsolvable:
297 LOG("[%s solve] Error: cube not ready\n", mcoord->name); 300 LOG("[%s solve] Error: cube not ready\n", mcoord->name);
298 return NISSY_ERROR_UNSOLVABLE_CUBE; 301 return NISSY_ERROR_UNSOLVABLE_CUBE;
299} 302}
303
304#endif /* SOLVERS_COORD_MULTISOLVE_H */
diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h
index 6bb9af2..9a0c63c 100644
--- a/src/solvers/coord/solve.h
+++ b/src/solvers/coord/solve.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_SOLVE_H
2#define SOLVERS_COORD_SOLVE_H
3
1typedef struct { 4typedef struct {
2 cube_t cube; 5 cube_t cube;
3 cube_t inverse; 6 cube_t inverse;
@@ -400,3 +403,5 @@ solve_coord_error_unsolvable:
400 LOG("[%s solve] Error: cube not ready\n", coord->name); 403 LOG("[%s solve] Error: cube not ready\n", coord->name);
401 return NISSY_ERROR_UNSOLVABLE_CUBE; 404 return NISSY_ERROR_UNSOLVABLE_CUBE;
402} 405}
406
407#endif /* SOLVERS_COORD_SOLVE_H */
diff --git a/src/solvers/coord/types_macros.h b/src/solvers/coord/types_macros.h
index 81db9d4..b042788 100644
--- a/src/solvers/coord/types_macros.h
+++ b/src/solvers/coord/types_macros.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_TYPES_MACROS_H
2#define SOLVERS_COORD_TYPES_MACROS_H
3
1#define COORD_INDEX(i) ((i)/2) 4#define COORD_INDEX(i) ((i)/2)
2#define COORD_SHIFT(i) (UINT8_C(4) * (uint8_t)((i) % 2)) 5#define COORD_SHIFT(i) (UINT8_C(4) * (uint8_t)((i) % 2))
3#define COORD_MASK(i) (UINT8_C(0xF) << COORD_SHIFT(i)) 6#define COORD_MASK(i) (UINT8_C(0xF) << COORD_SHIFT(i))
@@ -53,3 +56,5 @@ typedef struct {
53 uint64_t moves_mask; 56 uint64_t moves_mask;
54 bool (*is_solvable)(cube_t); 57 bool (*is_solvable)(cube_t);
55} multicoord_t; 58} multicoord_t;
59
60#endif /* SOLVERS_COORD_TYPES_MACROS_H */
diff --git a/src/solvers/coord/utils.h b/src/solvers/coord/utils.h
index 0062587..232d6f8 100644
--- a/src/solvers/coord/utils.h
+++ b/src/solvers/coord/utils.h
@@ -1,3 +1,6 @@
1#ifndef SOLVERS_COORD_UTILS_H
2#define SOLVERS_COORD_UTILS_H
3
1STATIC coord_t *parse_coord(size_t, const char *); 4STATIC coord_t *parse_coord(size_t, const char *);
2STATIC multicoord_t *parse_multicoord(size_t, const char *); 5STATIC multicoord_t *parse_multicoord(size_t, const char *);
3STATIC void parse_coord_and_trans( 6STATIC void parse_coord_and_trans(
@@ -80,3 +83,5 @@ dataid_coord(const char *ca, char dataid[SIZE(NISSY_SIZE_DATAID)])
80 LOG("Error: cannot parse coordinate from '%s'\n", ca); 83 LOG("Error: cannot parse coordinate from '%s'\n", ca);
81 return NISSY_ERROR_INVALID_SOLVER; 84 return NISSY_ERROR_INVALID_SOLVER;
82} 85}
86
87#endif /* SOLVERS_COORD_UTILS_H */

Generated with cgit - Back to sebastiano.tronto.net