MyMediaLite  3.09
Public Member Functions | Public Attributes | Protected Attributes | Properties
SymmetricMatrix< T > Class Template Reference

Class for storing dense matrices. More...

Inheritance diagram for SymmetricMatrix< T >:
IMatrix< T >

List of all members.

Public Member Functions

IMatrix< T > CreateMatrix (int num_rows, int num_columns)
 Create a matrix with a given number of rows and columns.
void Resize (int size)
 Resize to the given size.
void Resize (int num_rows, int num_columns)
 Grows or shrinks the matrix to the requested size, if necessary.
 SymmetricMatrix (int dim)
 Initializes a new instance of the SymmetricMatrix class.
IMatrix< T > Transpose ()
 Get the transpose of the matrix, i.e. a matrix where rows and columns are interchanged.

Public Attributes

int dim
 Dimension, the number of rows and columns.

Protected Attributes

internal T[][] data
 Data array: data is stored in columns.

Properties

virtual bool IsSymmetric [get]
 True if the matrix is stored in a symmetric manner, false otherwise.
int NumberOfColumns [get]
 The number of columns of the matrix.
int NumberOfRows [get]
 The number of rows of the matrix.
virtual T this[int i, int j] [get, set]
this[int x, int y] [get, set]
 The value at (i,j)

Detailed Description

template<T>
class MyMediaLite::DataType::SymmetricMatrix< T >

Class for storing dense matrices.

The data is stored in row-major mode. Indexes are zero-based.

Template Parameters:
Tthe type of the matrix entries

Member Function Documentation

IMatrix<T> CreateMatrix ( int  num_rows,
int  num_columns 
) [inline]

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

Implements IMatrix< T >.

void Resize ( int  size) [inline]

Resize to the given size.

Parameters:
sizethe size
void Resize ( int  num_rows,
int  num_cols 
) [inline]

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 >.

SymmetricMatrix ( int  dim) [inline]

Initializes a new instance of the SymmetricMatrix class.

Parameters:
dimthe number of rows and columns
IMatrix<T> Transpose ( ) [inline]

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 >.


Member Data Documentation

internal T [][] data [protected]

Data array: data is stored in columns.

int dim

Dimension, the number of rows and columns.


Property Documentation

virtual bool IsSymmetric [get]

True if the matrix is stored in a symmetric manner, false otherwise.

Also true for skew symmetric matrices that exploit this property in order to save memory

Implements IMatrix< T >.

int NumberOfColumns [get]

The number of columns of the matrix.

The number of columns of the matrix

Implements IMatrix< T >.

int NumberOfRows [get]

The number of rows of the matrix.

The number of rows of the matrix

Implements IMatrix< T >.

T this[int x, int y] [get, set, inherited]

The value at (i,j)

The value at (i,j)

Parameters:
xthe row ID
ythe column ID

Implemented in SparseMatrix< T >, SparseBooleanMatrix, SkewSymmetricSparseMatrix, and SymmetricSparseMatrix< T >.


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