Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

SparseBitmatrix Class Reference

A sparse bit matrix, implemented as list of columns having 1 for each row. More...

#include <SparseBitmatrix.hpp>

List of all members.

Public Member Functions

 SparseBitmatrix (int numRows)
 SparseBitmatrix (int numRows, int rowCapacity)
 SparseBitmatrix (int numRows, int *rowCapacities)
 SparseBitmatrix (int numRows, int *rowCapacities, int *rowLabels)
 ~SparseBitmatrix ()
int nRows () const
void setNRows (int nRows)
int & rowLength (int row) const
int * rowValues (int row) const
void setRowLength (int row, int length)
void push_back (int row, int column)
int maxRowLength () const
void setMaxRowLength (int maxRowLength)
int computeMaxRowLength ()
ROW_T rowLabel (int row) const
void setRowLabel (int row, ROW_T label)
ROW_TgetRowLabels () const
int capacity () const
 Return number of rows that maximally can be stored.
int capacity (int row) const
 Return number of elements that maximally can be stored in a given row.
int * capacities () const
 Return number of elements that maximally can be stored in a given row.
SparseBitvectorgetRow (int row) const
 DO NOT USE: is slow and opens up a memory leak ? If used with a copy constructor as SparseBitvector x(matrix.getRow(15)); increases instruction and data reference counts.
void computeEmpiricalDensity (long &numCells, long &numUsedCells) const
 Increase given variables by the number of cells in this matrix and the number of used cells.
void dump () const
void dumpStructure () const
void sortRows ()
int filterMinimalRowLength (int minRowLength)
 Retain only rows with a given minimal row length.
int filterMinimalRowLength_destroyStructure (int minRowLength)
 Retain only rows with a given minimal row length.
void shiftRowStorage (int firstRow)
 Shift row storage s.t.

Private Attributes

int numRows
int ** rows
int m_maxRowLength
int * rowLengths
ROW_TrowLabels
int sizeRows
int * rowSizes


Detailed Description

A sparse bit matrix, implemented as list of columns having 1 for each row.

Please note that maxRowLength is not managed automatically (for efficiency).

Author:
Lars Schmidt-Thieme
Version:
1.0

Definition at line 30 of file SparseBitmatrix.hpp.


Constructor & Destructor Documentation

SparseBitmatrix::SparseBitmatrix int  numRows  ) 
 

Definition at line 16 of file SparseBitmatrix.cpp.

References m_maxRowLength, rowLabels, rowLengths, rows, rowSizes, and sizeRows.

SparseBitmatrix::SparseBitmatrix int  numRows,
int  rowCapacity
 

Definition at line 34 of file SparseBitmatrix.cpp.

References m_maxRowLength, rowLabels, rowLengths, rows, rowSizes, and sizeRows.

SparseBitmatrix::SparseBitmatrix int  numRows,
int *  rowCapacities
 

Definition at line 61 of file SparseBitmatrix.cpp.

References m_maxRowLength, rowLabels, rowLengths, rows, rowSizes, and sizeRows.

SparseBitmatrix::SparseBitmatrix int  numRows,
int *  rowCapacities,
int *  rowLabels
 

Definition at line 99 of file SparseBitmatrix.cpp.

References m_maxRowLength, rowLengths, rows, rowSizes, and sizeRows.

SparseBitmatrix::~SparseBitmatrix  ) 
 

Definition at line 137 of file SparseBitmatrix.cpp.

References rowLabels, rowLengths, rows, rowSizes, and sizeRows.


Member Function Documentation

int* SparseBitmatrix::capacities  )  const [inline]
 

Return number of elements that maximally can be stored in a given row.

Definition at line 135 of file SparseBitmatrix.hpp.

References rowSizes.

int SparseBitmatrix::capacity int  row  )  const [inline]
 

Return number of elements that maximally can be stored in a given row.

Definition at line 126 of file SparseBitmatrix.hpp.

References rowSizes, and sizeRows.

int SparseBitmatrix::capacity  )  const [inline]
 

Return number of rows that maximally can be stored.

Definition at line 121 of file SparseBitmatrix.hpp.

References sizeRows.

void SparseBitmatrix::computeEmpiricalDensity long &  numCells,
long &  numUsedCells
const
 

Increase given variables by the number of cells in this matrix and the number of used cells.

Definition at line 272 of file SparseBitmatrix.cpp.

References numRows, rowLengths, and rows.

int SparseBitmatrix::computeMaxRowLength  )  [inline]
 

Definition at line 96 of file SparseBitmatrix.hpp.

References m_maxRowLength, and rowLengths.

Referenced by Eclat< TRANSACTION_READER, PATTERN_WRITER >::findFrequentPatterns().

void SparseBitmatrix::dump  )  const
 

Definition at line 199 of file SparseBitmatrix.cpp.

References numRows, rowLabels, rowLengths, rows, rowSizes, and sizeRows.

Referenced by Eclat< TRANSACTION_READER, PATTERN_WRITER >::depthFirstWalk(), and Eclat< TRANSACTION_READER, PATTERN_WRITER >::findFrequentPatterns().

void SparseBitmatrix::dumpStructure  )  const
 

Definition at line 243 of file SparseBitmatrix.cpp.

References numRows, rowLengths, rowSizes, and sizeRows.

int SparseBitmatrix::filterMinimalRowLength int  minRowLength  ) 
 

Retain only rows with a given minimal row length.

(Re)computes maxRowLength as a side-effect.

Returns:
number of rows retained.

Definition at line 305 of file SparseBitmatrix.cpp.

References m_maxRowLength, numRows, rowLabels, rowLengths, rows, and rowSizes.

int SparseBitmatrix::filterMinimalRowLength_destroyStructure int  minRowLength  ) 
 

Retain only rows with a given minimal row length.

(Re)computes maxRowLength as a side-effect.

Returns:
number of rows retained. DESTROYS structure of the bitmatrix. LEAKS MEMORY.

Definition at line 335 of file SparseBitmatrix.cpp.

References m_maxRowLength, numRows, rowLabels, rowLengths, rows, and rowSizes.

SparseBitvector& SparseBitmatrix::getRow int  row  )  const [inline]
 

DO NOT USE: is slow and opens up a memory leak ? If used with a copy constructor as SparseBitvector x(matrix.getRow(15)); increases instruction and data reference counts.

Definition at line 145 of file SparseBitmatrix.hpp.

References rowLengths, rows, and rowSizes.

ROW_T* SparseBitmatrix::getRowLabels  )  const [inline]
 

Definition at line 114 of file SparseBitmatrix.hpp.

int SparseBitmatrix::maxRowLength  )  const [inline]
 

Definition at line 94 of file SparseBitmatrix.hpp.

References m_maxRowLength.

Referenced by Eclat< TRANSACTION_READER, PATTERN_WRITER >::depthFirstWalk().

int SparseBitmatrix::nRows  )  const [inline]
 

Definition at line 38 of file SparseBitmatrix.hpp.

Referenced by Eclat< TRANSACTION_READER, PATTERN_WRITER >::checkUpToTwoRows(), Eclat< TRANSACTION_READER, PATTERN_WRITER >::depthFirstWalk(), intersectSparseBitmatrix(), setdifferenceBySparseBitmatrix(), and setdifferenceOfSparseBitmatrix().

void SparseBitmatrix::push_back int  row,
int  column
[inline]
 

Definition at line 86 of file SparseBitmatrix.hpp.

References rowLengths, rows, and rowSizes.

Referenced by createSparseItemTransactionIncidenceMatrix().

ROW_T SparseBitmatrix::rowLabel int  row  )  const [inline]
 

Definition at line 104 of file SparseBitmatrix.hpp.

Referenced by Eclat< TRANSACTION_READER, PATTERN_WRITER >::checkUpToTwoRows(), Eclat< TRANSACTION_READER, PATTERN_WRITER >::depthFirstWalk(), Eclat< TRANSACTION_READER, PATTERN_WRITER >::findFrequentPatterns(), intersectSparseBitmatrix(), setdifferenceBySparseBitmatrix(), and setdifferenceOfSparseBitmatrix().

int& SparseBitmatrix::rowLength int  row  )  const [inline]
 

Definition at line 44 of file SparseBitmatrix.hpp.

References rowLengths, and sizeRows.

Referenced by Eclat< TRANSACTION_READER, PATTERN_WRITER >::checkUpToTwoRows(), Eclat< TRANSACTION_READER, PATTERN_WRITER >::depthFirstWalk(), and Eclat< TRANSACTION_READER, PATTERN_WRITER >::findFrequentPatterns().

int* SparseBitmatrix::rowValues int  row  )  const [inline]
 

Definition at line 49 of file SparseBitmatrix.hpp.

References rows, and sizeRows.

void SparseBitmatrix::setMaxRowLength int  maxRowLength  )  [inline]
 

Definition at line 95 of file SparseBitmatrix.hpp.

References m_maxRowLength.

Referenced by intersectSparseBitmatrix(), setdifferenceBySparseBitmatrix(), and setdifferenceOfSparseBitmatrix().

void SparseBitmatrix::setNRows int  nRows  )  [inline]
 

Definition at line 39 of file SparseBitmatrix.hpp.

References sizeRows.

Referenced by intersectSparseBitmatrix(), setdifferenceBySparseBitmatrix(), and setdifferenceOfSparseBitmatrix().

void SparseBitmatrix::setRowLabel int  row,
ROW_T  label
[inline]
 

Definition at line 109 of file SparseBitmatrix.hpp.

Referenced by intersectSparseBitmatrix(), setdifferenceBySparseBitmatrix(), and setdifferenceOfSparseBitmatrix().

void SparseBitmatrix::setRowLength int  row,
int  length
[inline]
 

Definition at line 54 of file SparseBitmatrix.hpp.

References rowLengths, rowSizes, and sizeRows.

void SparseBitmatrix::shiftRowStorage int  firstRow  ) 
 

Shift row storage s.t.

given row is row 0. Release memory for all rows before.

void SparseBitmatrix::sortRows  ) 
 


Member Data Documentation

int SparseBitmatrix::m_maxRowLength [private]
 

Definition at line 199 of file SparseBitmatrix.hpp.

Referenced by computeMaxRowLength(), filterMinimalRowLength(), filterMinimalRowLength_destroyStructure(), maxRowLength(), setMaxRowLength(), and SparseBitmatrix().

int SparseBitmatrix::numRows [private]
 

Definition at line 197 of file SparseBitmatrix.hpp.

Referenced by cardinalitySetdifferenceBySparseBitmatrix_TwoRows(), computeEmpiricalDensity(), dump(), dumpStructure(), filterMinimalRowLength(), and filterMinimalRowLength_destroyStructure().

ROW_T* SparseBitmatrix::rowLabels [private]
 

Definition at line 201 of file SparseBitmatrix.hpp.

Referenced by dump(), filterMinimalRowLength(), filterMinimalRowLength_destroyStructure(), SparseBitmatrix(), and ~SparseBitmatrix().

int* SparseBitmatrix::rowLengths [private]
 

Definition at line 200 of file SparseBitmatrix.hpp.

Referenced by cardinalitySetdifferenceBySparseBitmatrix_TwoRows(), computeEmpiricalDensity(), computeMaxRowLength(), dump(), dumpStructure(), filterMinimalRowLength(), filterMinimalRowLength_destroyStructure(), getRow(), push_back(), rowLength(), setRowLength(), SparseBitmatrix(), and ~SparseBitmatrix().

int** SparseBitmatrix::rows [private]
 

Definition at line 198 of file SparseBitmatrix.hpp.

Referenced by cardinalitySetdifferenceBySparseBitmatrix_TwoRows(), computeEmpiricalDensity(), dump(), filterMinimalRowLength(), filterMinimalRowLength_destroyStructure(), getRow(), push_back(), rowValues(), SparseBitmatrix(), and ~SparseBitmatrix().

int* SparseBitmatrix::rowSizes [private]
 

Definition at line 205 of file SparseBitmatrix.hpp.

Referenced by capacities(), capacity(), dump(), dumpStructure(), filterMinimalRowLength(), filterMinimalRowLength_destroyStructure(), getRow(), push_back(), setRowLength(), SparseBitmatrix(), and ~SparseBitmatrix().

int SparseBitmatrix::sizeRows [private]
 

Definition at line 204 of file SparseBitmatrix.hpp.

Referenced by capacity(), dump(), dumpStructure(), rowLength(), rowValues(), setNRows(), setRowLength(), SparseBitmatrix(), and ~SparseBitmatrix().


The documentation for this class was generated from the following files:
Generated on Sun Sep 17 17:55:39 2006 for FIM environment by  doxygen 1.4.4