| java.lang.Object gnu.math.BitOps
BitOps | public class BitOps (Code) | | Implements logical (bit-wise) operations on infinite-precision integers.
There are no BitOps object - all the functions here are static.
The semantics used are the same as for Common Lisp.
author: Per Bothner |
Method Summary | |
public static IntNum | and(IntNum x, int y) Return the logical (bit-wise) "and" of an IntNum and an int. | public static IntNum | and(IntNum x, IntNum y) Return the logical (bit-wise) "and" of two IntNums. | public static int | bitCount(int i) | public static int | bitCount(int[] x, int len) | public static int | bitCount(IntNum x) Count one bits in an IntNum.
If argument is negative, count zero bits instead. | public static IntNum | bitOp(int op, IntNum x, IntNum y) Do one the the 16 possible bit-wise operations of two IntNums. | public static boolean | bitValue(IntNum x, int bitno) Return the value of a specified bit in an IntNum. | public static IntNum | extract(IntNum x, int startBit, int endBit) Extract a bit-field as an unsigned integer. | public static IntNum | ior(IntNum x, IntNum y) Return the logical (bit-wise) "(inclusive) or" of two IntNums. | public static IntNum | not(IntNum x) Return the logical (bit-wise) negation of an IntNum. | public static void | setBitOp(IntNum result, int op, IntNum x, IntNum y) Do one the the 16 possible bit-wise operations of two IntNums. | public static int | swappedOp(int op) Return the boolean opcode (for bitOp) for swapped operands.
I.e. | public static boolean | test(IntNum x, int y) Return true iff an IntNum and an int have any true bits in common. | public static boolean | test(IntNum x, IntNum y) Return true iff two IntNums have any true bits in common. | public static IntNum | xor(IntNum x, IntNum y) Return the logical (bit-wise) "exclusive or" of two IntNums. |
bit4_count | final static byte[] bit4_count(Code) | | |
and | public static IntNum and(IntNum x, int y)(Code) | | Return the logical (bit-wise) "and" of an IntNum and an int.
|
bitCount | public static int bitCount(int i)(Code) | | |
bitCount | public static int bitCount(int[] x, int len)(Code) | | |
bitCount | public static int bitCount(IntNum x)(Code) | | Count one bits in an IntNum.
If argument is negative, count zero bits instead.
|
bitOp | public static IntNum bitOp(int op, IntNum x, IntNum y)(Code) | | Do one the the 16 possible bit-wise operations of two IntNums.
|
bitValue | public static boolean bitValue(IntNum x, int bitno)(Code) | | Return the value of a specified bit in an IntNum.
|
extract | public static IntNum extract(IntNum x, int startBit, int endBit)(Code) | | Extract a bit-field as an unsigned integer.
|
not | public static IntNum not(IntNum x)(Code) | | Return the logical (bit-wise) negation of an IntNum.
|
setBitOp | public static void setBitOp(IntNum result, int op, IntNum x, IntNum y)(Code) | | Do one the the 16 possible bit-wise operations of two IntNums.
|
swappedOp | public static int swappedOp(int op)(Code) | | Return the boolean opcode (for bitOp) for swapped operands.
I.e. bitOp (swappedOp(op), x, y) == bitOp (op, y, x).
|
test | public static boolean test(IntNum x, int y)(Code) | | Return true iff an IntNum and an int have any true bits in common.
|
test | public static boolean test(IntNum x, IntNum y)(Code) | | Return true iff two IntNums have any true bits in common.
|
|
|