diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-17 08:09:46 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-17 08:23:19 +0200 |
| commit | b02fce00115ac597ba34fda128e43586f8710438 (patch) | |
| tree | 59eda512e42baa0a3ed41c19b54419d92278313f /src/solvers/coord/gendata.h | |
| parent | 5e741a00a1350477c7d8778cb466c8efa27b152d (diff) | |
| download | nissy-core-b02fce00115ac597ba34fda128e43586f8710438.tar.gz nissy-core-b02fce00115ac597ba34fda128e43586f8710438.zip | |
Small optimization for coord gendata
Diffstat (limited to '')
| -rw-r--r-- | src/solvers/coord/gendata.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/solvers/coord/gendata.h b/src/solvers/coord/gendata.h index 0cc012e..b43c56d 100644 --- a/src/solvers/coord/gendata.h +++ b/src/solvers/coord/gendata.h | |||
| @@ -100,9 +100,6 @@ genptable_coord( | |||
| 100 | tableinfo_t info; | 100 | tableinfo_t info; |
| 101 | 101 | ||
| 102 | tablesize = DIV_ROUND_UP(coord->max, 2); | 102 | tablesize = DIV_ROUND_UP(coord->max, 2); |
| 103 | |||
| 104 | memset(table, 0xFF, tablesize); | ||
| 105 | |||
| 106 | info = (tableinfo_t) { | 103 | info = (tableinfo_t) { |
| 107 | .solver = "coordinate solver for ", | 104 | .solver = "coordinate solver for ", |
| 108 | .type = TABLETYPE_PRUNING, | 105 | .type = TABLETYPE_PRUNING, |
| @@ -117,6 +114,7 @@ genptable_coord( | |||
| 117 | .next = 0 | 114 | .next = 0 |
| 118 | }; | 115 | }; |
| 119 | 116 | ||
| 117 | memset(table, 0xFF, tablesize); | ||
| 120 | memset(info.distribution, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t)); | 118 | memset(info.distribution, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t)); |
| 121 | append_coord_name(coord, info.solver); | 119 | append_coord_name(coord, info.solver); |
| 122 | 120 | ||
| @@ -124,7 +122,7 @@ genptable_coord( | |||
| 124 | i = coord->coord(SOLVED_CUBE, data); | 122 | i = coord->coord(SOLVED_CUBE, data); |
| 125 | set_coord_pval(coord, table, i, 0); | 123 | set_coord_pval(coord, table, i, 0); |
| 126 | info.distribution[0] = 1; | 124 | info.distribution[0] = 1; |
| 127 | for (d = 1, tot = 1; tot < coord->max && d < 20; d++) { | 125 | for (d = 1, tot = 1; tot < coord->max && d < 15; d++) { |
| 128 | t = 0; | 126 | t = 0; |
| 129 | if (switch_to_fromnew(tot, coord->max, nm)) { | 127 | if (switch_to_fromnew(tot, coord->max, nm)) { |
| 130 | for (i = 0; i < coord->max; i++) | 128 | for (i = 0; i < coord->max; i++) |
| @@ -143,7 +141,14 @@ genptable_coord( | |||
| 143 | PRIu64 " of %" PRIu64 ")\n", | 141 | PRIu64 " of %" PRIu64 ")\n", |
| 144 | coord->name, d, t, tot, coord->max); | 142 | coord->name, d, t, tot, coord->max); |
| 145 | } | 143 | } |
| 146 | info.maxvalue = d-1; | 144 | if (tot == coord->max) { |
| 145 | info.maxvalue = d-1; | ||
| 146 | } else { | ||
| 147 | LOG("[%s gendata] Depth >= 15: %" PRIu64 " remaining\n", | ||
| 148 | coord->name, coord->max - tot); | ||
| 149 | info.distribution[d] = coord->max - tot; | ||
| 150 | info.maxvalue = 15; | ||
| 151 | } | ||
| 147 | 152 | ||
| 148 | return info; | 153 | return info; |
| 149 | } | 154 | } |
