org.apache.mahout.math.bitvector
Class QuickBitVector

java.lang.Object
  extended by org.apache.mahout.math.bitvector.QuickBitVector

Deprecated. until unit tests are in place. Until this time, this class/interface is unsupported.

@Deprecated
public class QuickBitVector
extends java.lang.Object


Field Summary
protected static int BITS_PER_UNIT
          Deprecated.  
 
Method Summary
static void clear(long[] bits, int bitIndex)
          Deprecated. Changes the bit with index bitIndex in the bitvector bits to the "clear" (false) state.
static boolean get(long[] bits, int bitIndex)
          Deprecated. Returns from the bitvector the value of the bit with the specified index.
static long getLongFromTo(long[] bits, int from, int to)
          Deprecated. Returns a long value representing bits of a bitvector from index from to index to.
static int leastSignificantBit(int value)
          Deprecated. Returns the index of the least significant bit in state "true".
static long[] makeBitVector(int size, int bitsPerElement)
          Deprecated. Constructs a low level bitvector that holds size elements, with each element taking bitsPerElement bits.
static int mostSignificantBit(int value)
          Deprecated. Returns the index of the most significant bit in state "true".
protected static int offset(int bitIndex)
          Deprecated. Returns the index within the unit that contains the given bitIndex.
static void put(long[] bits, int bitIndex, boolean value)
          Deprecated. Sets the bit with index bitIndex in the bitvector bits to the state specified by value.
static void putLongFromTo(long[] bits, long value, int from, int to)
          Deprecated. Sets bits of a bitvector from index from to index to to the bits of value.
static void set(long[] bits, int bitIndex)
          Deprecated. Changes the bit with index bitIndex in the bitvector bits to the "set" (true) state.
protected static int unit(int bitIndex)
          Deprecated. Returns the index of the unit that contains the given bitIndex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BITS_PER_UNIT

protected static final int BITS_PER_UNIT
Deprecated. 
See Also:
Constant Field Values
Method Detail

clear

public static void clear(long[] bits,
                         int bitIndex)
Deprecated. 
Changes the bit with index bitIndex in the bitvector bits to the "clear" (false) state.

Parameters:
bits - the bitvector.
bitIndex - the index of the bit to be cleared.

get

public static boolean get(long[] bits,
                          int bitIndex)
Deprecated. 
Returns from the bitvector the value of the bit with the specified index. The value is true if the bit with the index bitIndex is currently set; otherwise, returns false.

Parameters:
bits - the bitvector.
bitIndex - the bit index.
Returns:
the value of the bit with the specified index.

getLongFromTo

public static long getLongFromTo(long[] bits,
                                 int from,
                                 int to)
Deprecated. 
Returns a long value representing bits of a bitvector from index from to index to. Bits are returned as a long value with the return value having bit 0 set to bit from, ..., bit to-from set to bit to. All other bits of return value are set to 0. If from > to then returns zero (0L). Precondition (not checked): to-from+1 <= 64.

Parameters:
bits - the bitvector.
from - index of start bit (inclusive).
to - index of end bit (inclusive).
Returns:
the specified bits as long value.

leastSignificantBit

public static int leastSignificantBit(int value)
Deprecated. 
Returns the index of the least significant bit in state "true". Returns 32 if no bit is in state "true". Examples:
 0x80000000 --> 31
 0x7fffffff --> 0
 0x00000001 --> 0
 0x00000000 --> 32
 


makeBitVector

public static long[] makeBitVector(int size,
                                   int bitsPerElement)
Deprecated. 
Constructs a low level bitvector that holds size elements, with each element taking bitsPerElement bits.

Parameters:
size - the number of elements to be stored in the bitvector (must be >= 0).
bitsPerElement - the number of bits one single element takes.
Returns:
a low level bitvector.

mostSignificantBit

public static int mostSignificantBit(int value)
Deprecated. 
Returns the index of the most significant bit in state "true". Returns -1 if no bit is in state "true". Examples:
 0x80000000 --> 31
 0x7fffffff --> 30
 0x00000001 --> 0
 0x00000000 --> -1
 


offset

protected static int offset(int bitIndex)
Deprecated. 
Returns the index within the unit that contains the given bitIndex.


put

public static void put(long[] bits,
                       int bitIndex,
                       boolean value)
Deprecated. 
Sets the bit with index bitIndex in the bitvector bits to the state specified by value.

Parameters:
bits - the bitvector.
bitIndex - the index of the bit to be changed.
value - the value to be stored in the bit.

putLongFromTo

public static void putLongFromTo(long[] bits,
                                 long value,
                                 int from,
                                 int to)
Deprecated. 
Sets bits of a bitvector from index from to index to to the bits of value. Bit from is set to bit 0 of value, ..., bit to is set to bit to-from of value. All other bits stay unaffected. If from > to then does nothing. Precondition (not checked): to-from+1 <= 64.

Parameters:
bits - the bitvector.
value - the value to be copied into the bitvector.
from - index of start bit (inclusive).
to - index of end bit (inclusive).

set

public static void set(long[] bits,
                       int bitIndex)
Deprecated. 
Changes the bit with index bitIndex in the bitvector bits to the "set" (true) state.

Parameters:
bits - the bitvector.
bitIndex - the index of the bit to be set.

unit

protected static int unit(int bitIndex)
Deprecated. 
Returns the index of the unit that contains the given bitIndex.



Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.