| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static int | nextHighestPowerOfTwo(int v)
returns the next highest power of two, or the current value if it's already a power of two or zero |
| public static long | nextHighestPowerOfTwo(long v)
returns the next highest power of two, or the current value if it's already a power of two or zero |
| public static long | pop_andnot(long[] arr1, long[] arr2, int wordOffset, int numWords)
Returns the popcount or cardinality of A & ~B. |
| public static long | pop_array(long[] arr, int wordOffset, int numWords)
Returns the number of set bits in an array of longs. |
| public static long | pop_intersect(long[] arr1, long[] arr2, int wordOffset, int numWords)
Returns the popcount or cardinality of the two sets after an intersection. |
| public static long | pop_union(long[] arr1, long[] arr2, int wordOffset, int numWords)
Returns the popcount or cardinality of the union of two sets. |
| public static long | pop_xor(long[] arr1, long[] arr2, int wordOffset, int numWords)
Returns the popcount or cardinality of A ^ B Neither array is modified. |
| BitUtil | back to summary |
|---|---|
| private BitUtil() | |
| nextHighestPowerOfTwo | back to summary |
|---|---|
| public static int nextHighestPowerOfTwo(int v) returns the next highest power of two, or the current value if it's already a power of two or zero | |
| nextHighestPowerOfTwo | back to summary |
|---|---|
| public static long nextHighestPowerOfTwo(long v) returns the next highest power of two, or the current value if it's already a power of two or zero | |
| pop_andnot | back to summary |
|---|---|
| public static long pop_andnot(long[] arr1, long[] arr2, int wordOffset, int numWords) Returns the popcount or cardinality of A & ~B. Neither array is modified. | |
| pop_array | back to summary |
|---|---|
| public static long pop_array(long[] arr, int wordOffset, int numWords) Returns the number of set bits in an array of longs. | |
| pop_intersect | back to summary |
|---|---|
| public static long pop_intersect(long[] arr1, long[] arr2, int wordOffset, int numWords) Returns the popcount or cardinality of the two sets after an intersection. Neither array is modified. | |
| pop_union | back to summary |
|---|---|
| public static long pop_union(long[] arr1, long[] arr2, int wordOffset, int numWords) Returns the popcount or cardinality of the union of two sets. Neither array is modified. | |
| pop_xor | back to summary |
|---|---|
| public static long pop_xor(long[] arr1, long[] arr2, int wordOffset, int numWords) Returns the popcount or cardinality of A ^ B Neither array is modified. | |