MyMediaLite  3.10
Public Member Functions | Properties | List of all members
SymmetricSparseMatrix< T > Class Template Reference

a symmetric sparse matrix; consumes less memory More...

Inheritance diagram for SymmetricSparseMatrix< T >:
SparseMatrix< T > IMatrix< T > SymmetricCorrelationMatrix SkewSymmetricSparseMatrix BinaryDataSymmetricCorrelationMatrix Pearson BinaryCosine Cooccurrence Jaccard

Public Member Functions

override IMatrix< T > CreateMatrix (int num_rows, int num_columns)
 Create a matrix with a given number of rows and columns
virtual void Resize (int size)
 Resize to the given size
void Resize (int num_rows, int num_cols)
 Grows or shrinks the matrix to the requested size, if necessary
 SparseMatrix (int num_rows, int num_cols)
 Create a sparse matrix with a given number of rows
 SymmetricSparseMatrix (int dimension)
 Create a symmetric sparse matrix with a given dimension
virtual IMatrix< T > Transpose ()
 Get the transpose of the matrix, i.e. a matrix where rows and columns are interchanged

Properties

override bool IsSymmetric [get]
 Always true because the data type is symmetric
override IList< Tuple< int, int > > NonEmptyEntryIDs [get]
int NumberOfColumns [get, set]
override int NumberOfNonEmptyEntries [get]
int NumberOfRows [get]
override T this[int x, int y] [get, set]
 Access the elements of the sparse matrix
Dictionary< int, T > this[int x] [get]
 Get a row of the matrix

Detailed Description

a symmetric sparse matrix; consumes less memory

Type Constraints
T :new() 

Member Function Documentation

override IMatrix<T> CreateMatrix ( int  num_rows,
int  num_columns 
)
inlinevirtual

Create a matrix with a given number of rows and columns

Parameters
num_rowsthe number of rows
num_columnsthe number of columns
Returns
A matrix with num_rows rows and num_column columns

Reimplemented from SparseMatrix< T >.

Reimplemented in SkewSymmetricSparseMatrix.

virtual void Resize ( int  size)
inlinevirtual

Resize to the given size

Parameters
sizethe size

Reimplemented in SymmetricCorrelationMatrix.

void Resize ( int  num_rows,
int  num_cols 
)
inlineinherited

Grows or shrinks the matrix to the requested size, if necessary

The new entries are filled with zeros. Obsolete entries are removed.

Parameters
num_rowsthe number of rows
num_colsthe number of columns

Implements IMatrix< T >.

SparseMatrix ( int  num_rows,
int  num_cols 
)
inlineinherited

Create a sparse matrix with a given number of rows

Parameters
num_rowsthe number of rows
num_colsthe number of columns
SymmetricSparseMatrix ( int  dimension)
inline

Create a symmetric sparse matrix with a given dimension

Parameters
dimensionthe dimension (number of rows/columns)
virtual IMatrix<T> Transpose ( )
inlinevirtualinherited

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

Returns
the transpose of the matrix (copy)

Implements IMatrix< T >.

Property Documentation

override bool IsSymmetric
get

Always true because the data type is symmetric

Always true because the data type is symmetric

override T this[int x, int y]
getset

Access the elements of the sparse matrix

Parameters
xthe row ID
ythe column ID
Dictionary<int, T> this[int x]
getinherited

Get a row of the matrix

Parameters
xthe row ID

The documentation for this class was generated from the following file: