introduce bitloops

This commit is contained in:
mike
2026-01-13 01:17:08 +01:00
parent 6119722867
commit 81ae0aa84c
3 changed files with 59 additions and 76 deletions

View File

@@ -127,27 +127,6 @@ public record Export() {
}
}
static class Bit {
long l1, l2;
public boolean get(int bitIndex) {
if ((bitIndex & 64) == 0) return (l1 & (1L << bitIndex)) != 0L;
return (l2 & (1L << (bitIndex & 63))) != 0L;
}
public void set(int bitIndex) {
if ((bitIndex & 64) == 0) this.l1 |= 1L << bitIndex;
else this.l2 |= 1L << (bitIndex & 63);
}
public void or(long lo, long hi) {
this.l1 |= lo;
this.l2 |= hi;
}
public void clear() {
l1 = 0L;
l2 = 0L;
}
}
record Bit1029(long[] bits) {
public Bit1029() { this(new long[2048]); }