introduce bitloops

This commit is contained in:
mike
2026-01-17 03:37:38 +01:00
parent 44f53801a3
commit d3c7128cf9
3 changed files with 12 additions and 27 deletions

View File

@@ -973,7 +973,7 @@ public record SwedishGenerator(Rng rng, int[] stack, Clues cache) {
return true;
}
void chooseMRV() {
SwedishGenerator.Slotinfo best = null;
Slotinfo best = null;
for (int i = 0, count, count2 = -1, bestScore = -1, n = TOTAL; i < n; i++) {
var s = slots[i];
if (s.assign.w != X) continue;
@@ -1049,11 +1049,9 @@ public record SwedishGenerator(Rng rng, int[] stack, Clues cache) {
if (!placeWord(k, slo, shi, w)) continue;
Bit1029.set(used, lemIdx);
//assigned[k] = w;
s.assign.w = w;
if (backtrack(depth + 1)) return true;
s.assign.w = X;
//assigned[k] = X;
Bit1029.clear(used, lemIdx);
glo = low;
ghi = top;
@@ -1073,15 +1071,13 @@ public record SwedishGenerator(Rng rng, int[] stack, Clues cache) {
low = glo;
top = ghi;
if (!placeWord(k, slo, shi, w)) continue;
Bit1029.set(used, lemIdx);
s.assign.w = w;
//assigned[k] = w;
if (backtrack(depth + 1)) return true;
s.assign.w = X;
//assigned[k] = X;
Bit1029.clear(used, lemIdx);
glo = low;
ghi = top;
}