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<BigInteger>
,Serializable
public class NumberToBitVector
extends Object
implements it.unimi.dsi.bits.TransformationStrategy<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:
-
Constructor Summary
ConstructorsConstructorDescriptionNumberToBitVector
(int width) Creates a transformation strategy with given number of binary digits. -
Method Summary
Modifier and TypeMethodDescriptionit.unimi.dsi.bits.TransformationStrategy
<BigInteger> copy()
long
length
(BigInteger x) static void
long
numBits()
it.unimi.dsi.bits.BitVector
-
Constructor Details
-
NumberToBitVector
public NumberToBitVector(int width) Creates a transformation strategy with given number of binary digits.- Parameters:
width
- number of binary digits;
-
-
Method Details
-
copy
- Specified by:
copy
in interfaceit.unimi.dsi.bits.TransformationStrategy<BigInteger>
-
numBits
public long numBits()- Specified by:
numBits
in interfaceit.unimi.dsi.bits.TransformationStrategy<BigInteger>
-
length
- Specified by:
length
in interfaceit.unimi.dsi.bits.TransformationStrategy<BigInteger>
-
toBitVector
- Specified by:
toBitVector
in interfaceit.unimi.dsi.bits.TransformationStrategy<BigInteger>
-
main
-