Save This Page
Home » mahout-collections-1.0-src » org.apache.mahout.math.bitvector » [javadoc | source]
org.apache.mahout.math.bitvector
public class: BitMatrix [javadoc | source]
java.lang.Object
   org.apache.mahout.math.PersistentObject
      org.apache.mahout.math.bitvector.BitMatrix

All Implemented Interfaces:
    Cloneable, Serializable

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

Constructor:
 public BitMatrix(int columns,
    int rows) 
Method from org.apache.mahout.math.bitvector.BitMatrix Summary:
and,   andNot,   cardinality,   checkDimensionCompatibility,   clear,   clone,   columns,   containsBox,   copy,   elements,   elements,   equals,   forEachCoordinateInState,   get,   getQuick,   hashCode,   not,   or,   part,   put,   putQuick,   replaceBoxWith,   replaceBoxWith,   rows,   size,   toBitVector,   toString,   xor
Methods from org.apache.mahout.math.PersistentObject:
clone
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.mahout.math.bitvector.BitMatrix Detail:
 public  void and(BitMatrix other) 
      Deprecated!
    Performs a logical AND of the receiver with another bit matrix. The receiver is modified so that a bit in it has the value true if and only if it already had the value true and the corresponding bit in the other bit matrix argument has the value true.
 public  void andNot(BitMatrix other) 
      Deprecated!
    Clears all of the bits in receiver whose corresponding bit is set in the other bit matrix. In other words, determines the difference (A\B) between two bit matrices.
 public int cardinality() 
      Deprecated!
    Returns the number of bits currently in the true state. Optimized for speed. Particularly quick if the receiver is either sparse or dense.
 protected  void checkDimensionCompatibility(BitMatrix other) 
      Deprecated!
    Sanity check for operations requiring matrices with the same number of columns and rows.
 public  void clear() 
      Deprecated!
    Clears all bits of the receiver.
 public Object clone() 
      Deprecated!
    Cloning this BitMatrix produces a new BitMatrix that is equal to it. The clone of the bit matrix is another bit matrix that has exactly the same bits set to true as this bit matrix and the same number of columns and rows.
 public int columns() 
      Deprecated!
    Returns the number of columns of the receiver.
 protected  void containsBox(int column,
    int row,
    int width,
    int height) 
      Deprecated!
    Checks whether the receiver contains the given box.
 public BitMatrix copy() 
      Deprecated!
    Returns a shallow clone of the receiver; calls clone() and casts the result.
 protected long[] elements() 
      Deprecated!
 protected  void elements(long[] bits,
    int columns,
    int rows) 
      Deprecated!
    You normally need not use this method. Use this method only if performance is critical. Sets the bit matrix's backing bits, columns and rows. WARNING: For efficiency reasons and to keep memory usage low, the array is not copied. So if subsequently you modify the specified array directly via the [] operator, be sure you know what you're doing.
 public boolean equals(Object obj) 
      Deprecated!
    Compares this object against the specified object. The result is true if and only if the argument is not null and is a BitMatrix object that has the same number of columns and rows as the receiver and that has exactly the same bits set to true as the receiver.
 public boolean forEachCoordinateInState(boolean state,
    IntIntProcedure procedure) 
      Deprecated!
    Applies a procedure to each coordinate that holds a bit in the given state. Iterates rowwise downwards from [columns()-1,rows()-1] to [0,0]. Useful, for example, if you want to copy bits into an image or somewhere else. Optimized for speed. Particularly quick if one of the following conditions holds
    • state==true and the receiver is sparse (cardinality() is small compared to size()).
    • state==false and the receiver is dense (cardinality() is large compared to size()).
 public boolean get(int column,
    int row) 
      Deprecated!
    Returns from the receiver the value of the bit at the specified coordinate. The value is true if this bit is currently set; otherwise, returns false.
 public boolean getQuick(int column,
    int row) 
      Deprecated!
    Returns from the receiver the value of the bit at the specified coordinate; WARNING: Does not check preconditions. The value is true if this bit is currently set; otherwise, returns false.

    Provided with invalid parameters this method may return invalid values without throwing any exception. You should only use this method when you are absolutely sure that the coordinate is within bounds. Precondition (unchecked): column>=0 && column<columns() && row>=0 && row<rows().

 public int hashCode() 
      Deprecated!
    Returns a hash code value for the receiver.
 public  void not() 
      Deprecated!
    Performs a logical NOT on the bits of the receiver.
 public  void or(BitMatrix other) 
      Deprecated!
    Performs a logical OR of the receiver with another bit matrix. The receiver is modified so that a bit in it has the value true if and only if it either already had the value true or the corresponding bit in the other bit matrix argument has the value true.
 public BitMatrix part(int column,
    int row,
    int width,
    int height) 
      Deprecated!
    Constructs and returns a new matrix with width columns and height rows which is a copy of the contents of the given box. The box ranges from [column,row] to [column+width-1,row+height-1], all inclusive.
 public  void put(int column,
    int row,
    boolean value) 
      Deprecated!
    Sets the bit at the specified coordinate to the state specified by value.
 public  void putQuick(int column,
    int row,
    boolean value) 
      Deprecated!
    Sets the bit at the specified coordinate to the state specified by value; WARNING: Does not check preconditions.

    Provided with invalid parameters this method may return invalid values without throwing any exception. You should only use this method when you are absolutely sure that the coordinate is within bounds. Precondition (unchecked): column>=0 && column<columns() && row>=0 && row<rows().

 public  void replaceBoxWith(int column,
    int row,
    int width,
    int height,
    boolean value) 
      Deprecated!
    Sets the bits in the given box to the state specified by value. The box ranges from [column,row] to [column+width-1,row+height-1], all inclusive. (Does nothing if width <= 0 || height <= 0).
 public  void replaceBoxWith(int column,
    int row,
    int width,
    int height,
    BitMatrix source,
    int sourceColumn,
    int sourceRow) 
      Deprecated!
    Replaces a box of the receiver with the contents of another matrix's box. The source box ranges from [sourceColumn,sourceRow] to [sourceColumn+width-1,sourceRow+height-1], all inclusive. The destination box ranges from [column,row] to [column+width-1,row+height-1], all inclusive. Does nothing if width <= 0 || height <= 0. If source==this and the source and destination box intersect in an ambiguous way, then replaces as if using an intermediate auxiliary copy of the receiver.
 public int rows() 
      Deprecated!
    Returns the number of rows of the receiver.
 public int size() 
      Deprecated!
    Returns the size of the receiver which is columns()*rows().
 public BitVector toBitVector() 
      Deprecated!
    Converts the receiver to a bitvector. In many cases this method only makes sense on one-dimensional matrices. WARNING: The returned bitvector and the receiver share the same backing bits. Modifying either of them will affect the other. If this behaviour is not what you want, you should first use copy() to make sure both objects use separate internal storage.
 public String toString() 
      Deprecated!
    Returns a (very crude) string representation of the receiver.
 public  void xor(BitMatrix other) 
      Deprecated!
    Performs a logical XOR of the receiver with another bit matrix. The receiver is modified so that a bit in it has the value true if and only if one of the following statements holds:
    • The bit initially has the value true, and the corresponding bit in the argument has the value false.
    • The bit initially has the value false, and the corresponding bit in the argument has the value true.