introduce bitloops
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package puzzle;
|
||||
|
||||
import static puzzle.SwedishGenerator.*;
|
||||
public final class DictData {
|
||||
private DictData() {}
|
||||
|
||||
public static final SwedishGenerator.Dict DICT = build();
|
||||
public static final Dict DICT = build();
|
||||
|
||||
private static SwedishGenerator.Dict build() {
|
||||
SwedishGenerator.DictEntry[] idx = new SwedishGenerator.DictEntry[SwedishGenerator.MAX_WORD_LENGTH_PLUS_ONE];
|
||||
private static Dict build() {
|
||||
DictEntry[] idx = new DictEntry[MAX_WORD_LENGTH_PLUS_ONE];
|
||||
idx[2] = DictDataL2.entry();
|
||||
idx[3] = DictDataL3.entry();
|
||||
idx[4] = DictDataL4.entry();
|
||||
@@ -14,6 +15,6 @@ public final class DictData {
|
||||
idx[6] = DictDataL6.entry();
|
||||
idx[7] = DictDataL7.entry();
|
||||
idx[8] = DictDataL8.entry();
|
||||
return new SwedishGenerator.Dict(idx, 40670);
|
||||
return new Dict(idx, 40670);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package puzzle;
|
||||
|
||||
import static puzzle.SwedishGenerator.*;
|
||||
public final class DictDataL3 {
|
||||
private DictDataL3() {}
|
||||
|
||||
@@ -17,11 +18,11 @@ public final class DictDataL3 {
|
||||
return DictDataL3P0.get();
|
||||
}
|
||||
|
||||
public static SwedishGenerator.DictEntry entry() {
|
||||
public static DictEntry entry() {
|
||||
long[] wds = words();
|
||||
long[] flat = posFlat();
|
||||
long[][] pos = reshape(flat, ROWS, COLS);
|
||||
return new SwedishGenerator.DictEntry(wds, pos, wds.length, (wds.length + 63) >>> 6);
|
||||
return new DictEntry(wds, pos, wds.length, (wds.length + 63) >>> 6);
|
||||
}
|
||||
|
||||
private static int copy(long[] dst, int at, long[] src) {
|
||||
|
||||
Reference in New Issue
Block a user