Sparse representation of a boolean matrix, using binary search (memory efficient). More...
Public Member Functions | |
IMatrix< bool > | CreateMatrix (int x, int y) |
IList< int > | GetEntriesByColumn (int column_id) |
IList< int > | GetEntriesByRow (int row_id) |
Get all true entries (column IDs) of a row. | |
int | NumEntriesByColumn (int column_id) |
Get all the number of entries in a column. | |
int | NumEntriesByRow (int row_id) |
Get all the number of entries in a row. | |
int | Overlap (IBooleanMatrix 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. | |
IMatrix< bool > | 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, IList< 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. | |
ICollection< 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 rows of the matrix. |
Sparse representation of a boolean matrix, using binary search (memory efficient).
Fast row-wise access is possible. Indexes are zero-based.
IList<int> GetEntriesByColumn | ( | int | column_id | ) |
Takes O(N log(M)) worst-case time, where N is the number of rows and M is the number of columns.
Implements IBooleanMatrix.
IList<int> GetEntriesByRow | ( | int | row_id | ) |
Get all true entries (column IDs) of a row.
row_id | the row ID |
Implements IBooleanMatrix.
int NumEntriesByColumn | ( | int | column_id | ) |
Get all the number of entries in a column.
column_id | the column ID |
Implements IBooleanMatrix.
int NumEntriesByRow | ( | int | row_id | ) |
Get all the number of entries in a row.
row_id | the row ID |
Implements IBooleanMatrix.
int Overlap | ( | IBooleanMatrix | s | ) |
Get the overlap of two matrices, i.e. the number of true entries where they agree.
s | the IBooleanMatrix to compare to |
Implements IBooleanMatrix.
void RemoveColumn | ( | int[] | delete_columns | ) |
Removes several columns, and fills the gap by decrementing all occurrences of higher column IDs.
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.
y | the column ID |
IMatrix<bool> Transpose | ( | ) |
Get the transpose of the matrix, i.e. a matrix where rows and columns are interchanged.
ICollection<int> NonEmptyColumnIDs [get] |
The IDs of the non-empty columns in the matrix (the ones that contain at least one true entry).
Implements IBooleanMatrix.
ICollection<int> NonEmptyRowIDs [get] |
The IDs of the non-empty rows in the matrix (the ones that contain at least one true entry).
Implements IBooleanMatrix.
IList<KeyValuePair<int, IList<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.
The number of columns in the matrix
int NumberOfEntries [get] |
int NumberOfRows [get] |
The number of rows in the matrix.
The number of rows in the matrix
ICollection<int> this[int x] [get, set] |
bool this[int x, int y] [get, set] |