public final class BitVector extends Object
Constructor and Description |
---|
BitVector() |
Modifier and Type | Method and Description |
---|---|
static int |
branchingBit(long[] a,
long[] b,
int aIdx,
int bIdx,
int bitOffset,
int bitLen) |
static long[] |
clone(long[] vector) |
static void |
copy(long[] src,
int srcOffset,
long[] dst,
int dstOffset,
int len)
Copies a bit range from one vector to another.
|
static long[] |
create(int length) |
static long |
get(long[] vector,
int offset,
int len)
Reads a bit range from the vector, which cannot be longer than 64 bits.
|
static long[] |
insert(long[] vector,
int vectorLen,
long val,
int offset,
int len) |
static long[] |
interleave(int bitLen,
long[] vectors) |
static long[] |
interpose(long[] vector,
int vectorLen,
int offset,
int len)
Returns a copy of the vector, with an empty bit range inserted at the specified location.
|
static void |
overwrite(long[] vector,
int bitIdx,
boolean flag) |
static void |
overwrite(long[] vector,
long val,
int offset,
int len)
Overwrites a bit range within the vector.
|
static long[] |
remove(long[] vector,
int vectorLen,
int offset,
int len)
Returns a copy of the vector, with a bit range excised from the specified location.
|
static boolean |
test(long[] vector,
int bitIndex) |
public static long[] create(int length)
length
- the bit length of the vectorpublic static long[] clone(long[] vector)
public static boolean test(long[] vector, int bitIndex)
vector
- the bit vectorbitIndex
- the bit to be testedpublic static long[] interleave(int bitLen, long[] vectors)
bitLen
- the number of significant bits in each vectorvectors
- a list of bit-vectorspublic static int branchingBit(long[] a, long[] b, int aIdx, int bIdx, int bitOffset, int bitLen)
public static long get(long[] vector, int offset, int len)
vector
- the bit vectoroffset
- the bit offsetlen
- the bit lengthpublic static void overwrite(long[] vector, long val, int offset, int len)
vector
- the bit vectorval
- the rowValue to setoffset
- the offset of the writelen
- the bit length of the rowValuepublic static void overwrite(long[] vector, int bitIdx, boolean flag)
public static void copy(long[] src, int srcOffset, long[] dst, int dstOffset, int len)
src
- the source vectorsrcOffset
- the bit offset within srcdst
- the destination vectordstOffset
- the bit offset within dstlen
- the length of the bit rangepublic static long[] interpose(long[] vector, int vectorLen, int offset, int len)
vector
- the bit vectorvectorLen
- the length of the bit vectoroffset
- the offset within the bit vectorlen
- the length of the empty bit rangepublic static long[] insert(long[] vector, int vectorLen, long val, int offset, int len)
vector
- the bit vectorvectorLen
- the length of the bit vectorval
- the rowValue to be insertedoffset
- the offset within the bit vectorlen
- the bit length of the rowValuepublic static long[] remove(long[] vector, int vectorLen, int offset, int len)
vector
- the bit vectorvectorLen
- the length of the bit vectoroffset
- the offset within the bit vectorlen
- the length of the excised bit range