public final class BitUtil extends Object
Modifier and Type | Method and Description |
---|---|
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
|
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
|
static long |
pop_andnot(long[] arr1,
long[] arr2,
int wordOffset,
int numWords)
Returns the popcount or cardinality of A & ~B.
|
static long |
pop_array(long[] arr,
int wordOffset,
int numWords)
Returns the number of set bits in an array of longs.
|
static long |
pop_intersect(long[] arr1,
long[] arr2,
int wordOffset,
int numWords)
Returns the popcount or cardinality of the two sets after an intersection.
|
static long |
pop_union(long[] arr1,
long[] arr2,
int wordOffset,
int numWords)
Returns the popcount or cardinality of the union of two sets.
|
static long |
pop_xor(long[] arr1,
long[] arr2,
int wordOffset,
int numWords)
Returns the popcount or cardinality of A ^ B
Neither array is modified.
|
public static long pop_array(long[] arr, int wordOffset, int numWords)
public static long pop_intersect(long[] arr1, long[] arr2, int wordOffset, int numWords)
public static long pop_union(long[] arr1, long[] arr2, int wordOffset, int numWords)
public static long pop_andnot(long[] arr1, long[] arr2, int wordOffset, int numWords)
public static long pop_xor(long[] arr1, long[] arr2, int wordOffset, int numWords)
public static int nextHighestPowerOfTwo(int v)
public static long nextHighestPowerOfTwo(long v)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.