Package it.unimi.dsi.sux4j.scratch
Class NumberToBitVector
- java.lang.Object
-
- it.unimi.dsi.sux4j.scratch.NumberToBitVector
-
- All Implemented Interfaces:
it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
,java.io.Serializable
public class NumberToBitVector extends java.lang.Object implements it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
A transformation strategy that converts strings representing integers between 0 (inclusive) and 2k (exclusive)) into fixed-length binary vectors (most-significant bit is the 0-th).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NumberToBitVector(int width)
Creates a transformation strategy with given number of binary digits.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
copy()
long
length(java.math.BigInteger x)
static void
main(java.lang.String[] arg)
long
numBits()
it.unimi.dsi.bits.BitVector
toBitVector(java.math.BigInteger x)
-
-
-
Method Detail
-
copy
public it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger> copy()
- Specified by:
copy
in interfaceit.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
-
numBits
public long numBits()
- Specified by:
numBits
in interfaceit.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
-
length
public long length(java.math.BigInteger x)
- Specified by:
length
in interfaceit.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
-
toBitVector
public it.unimi.dsi.bits.BitVector toBitVector(java.math.BigInteger x)
- Specified by:
toBitVector
in interfaceit.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
-
main
public static void main(java.lang.String[] arg)
-
-