SparseBooleanMatrix Class Reference

Sparse representation of a boolean matrix. More...

List of all members.

Public Member Functions

IMatrix< bool > CreateMatrix (int x, int y)
int Overlap (SparseBooleanMatrix s)
 Get the overlap of two matrices, i.e. the number of true entries where they agree.
void RemoveColumn (int[] delete_columns)
 Removes several columns, and fills the gap by decrementing all occurrences of higher column IDs.
void RemoveColumn (int y)
 Removes a column, and fills the gap by decrementing all occurrences of higher column IDs by one.
SparseBooleanMatrix Transpose ()
 Get the transpose of the matrix, i.e. a matrix where rows and columns are interchanged.

Properties

virtual bool IsSymmetric [get]
ICollection< int > NonEmptyColumnIDs [get]
 The IDs of the non-empty columns in the matrix (the ones that contain at least one true entry).
ICollection< int > NonEmptyRowIDs [get]
 The IDs of the non-empty rows in the matrix (the ones that contain at least one true entry).
IList< KeyValuePair< int,
HashSet< int > > > 
NonEmptyRows [get]
 The non-empty rows of the matrix (the ones that contain at least one true entry), with their IDs.
int NumberOfColumns [get]
 The number of columns in the matrix.
int NumberOfEntries [get]
 The number of (true) entries.
int NumberOfRows [get]
 The number of rows in the matrix.
IList< KeyValuePair< int,
HashSet< int > > > 
Rows [get]
 The rows of the matrix, with their IDs.
HashSet< int > this [int x] [get, set]
 Indexer to access the rows of the matrix.
bool this [int x, int y] [get, set]
 Indexer to access the elements of the matrix.

Detailed Description

Sparse representation of a boolean matrix.

Fast row-wise access is possible. Indexes are zero-based.


Member Function Documentation

int Overlap ( SparseBooleanMatrix  s  ) 

Get the overlap of two matrices, i.e. the number of true entries where they agree.

Parameters:
s the SparseBooleanMatrix to compare to
Returns:
the number of entries that are true in both matrices
void RemoveColumn ( int[]  delete_columns  ) 

Removes several columns, and fills the gap by decrementing all occurrences of higher column IDs.

Parameters:
delete_columns an array with column IDs
void RemoveColumn ( int  y  ) 

Removes a column, and fills the gap by decrementing all occurrences of higher column IDs by one.

Parameters:
y the column ID
SparseBooleanMatrix Transpose (  ) 

Get the transpose of the matrix, i.e. a matrix where rows and columns are interchanged.

Returns:
the transpose of the matrix

Property Documentation

ICollection<int> NonEmptyColumnIDs [get]

The IDs of the non-empty columns in the matrix (the ones that contain at least one true entry).

The IDs of the non-empty columns in the matrix (the ones that contain at least one true entry)

ICollection<int> NonEmptyRowIDs [get]

The IDs of the non-empty rows in the matrix (the ones that contain at least one true entry).

The IDs of the non-empty rows in the matrix (the ones that contain at least one true entry)

IList<KeyValuePair<int, HashSet<int> > > NonEmptyRows [get]

The non-empty rows of the matrix (the ones that contain at least one true entry), with their IDs.

The non-empty rows of the matrix (the ones that contain at least one true entry), with their IDs

int NumberOfColumns [get]

The number of columns in the matrix.

The number of columns in the matrix

int NumberOfEntries [get]

The number of (true) entries.

The number of (true) entries

int NumberOfRows [get]

The number of rows in the matrix.

The number of rows in the matrix

IList<KeyValuePair<int, HashSet<int> > > Rows [get]

The rows of the matrix, with their IDs.

The rows of the matrix, with their IDs

HashSet<int> this[int x] [get, set]

Indexer to access the rows of the matrix.

Parameters:
x the row ID
bool this[int x, int y] [get, set]

Indexer to access the elements of the matrix.

Parameters:
x the row ID
y the column ID

The documentation for this class was generated from the following file:
Generated on Tue May 24 12:44:17 2011 for MyMediaLite by  doxygen 1.6.3