introduce bitloops
This commit is contained in:
41
src/main/generated-sources/puzzle/dict800/DictDataL3.java
Normal file
41
src/main/generated-sources/puzzle/dict800/DictDataL3.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package puzzle.dict800;
|
||||
|
||||
public final class DictDataL3 {
|
||||
private DictDataL3() {}
|
||||
|
||||
static final int LEN = 3;
|
||||
static final int ROWS = 78;
|
||||
static final int COLS = 8;
|
||||
static final int WORDS_LEN = 490;
|
||||
static final int POS_LEN = 624;
|
||||
|
||||
private static long[] words() {
|
||||
return DictDataL3W0.get();
|
||||
}
|
||||
|
||||
private static long[] posFlat() {
|
||||
return DictDataL3P0.get();
|
||||
}
|
||||
|
||||
public static puzzle.SwedishGenerator.DictEntry entry() {
|
||||
long[] wds = words();
|
||||
long[] flat = posFlat();
|
||||
long[][] pos = reshape(flat, ROWS, COLS);
|
||||
return new puzzle.SwedishGenerator.DictEntry(wds, pos, wds.length, (wds.length + 63) >>> 6);
|
||||
}
|
||||
|
||||
private static int copy(long[] dst, int at, long[] src) {
|
||||
System.arraycopy(src, 0, dst, at, src.length);
|
||||
return at + src.length;
|
||||
}
|
||||
|
||||
private static long[][] reshape(long[] flat, int rows, int cols) {
|
||||
long[][] out = new long[rows][cols];
|
||||
int k = 0;
|
||||
for (int r = 0; r < rows; r++) {
|
||||
System.arraycopy(flat, k, out[r], 0, cols);
|
||||
k += cols;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user