MyMediaLite
3.11
|
Class for storing dense matrices More...
Public Member Functions | |
void | AddRows (int num_rows) |
Enlarges the matrix to num_rows rows More... | |
IMatrix< T > | CreateMatrix (int num_rows, int num_columns) |
Create a matrix with a given number of rows and columns More... | |
IList< T > | GetColumn (int j) |
Returns a copy of the j-th column of the matrix More... | |
IList< T > | GetRow (int i) |
Returns a copy of the i-th row of the matrix More... | |
void | Init (T d) |
Init the matrix with a default value More... | |
Matrix (int dim1, int dim2) | |
Initializes a new instance of the Matrix class More... | |
Matrix (int dim1, uint dim2) | |
Initializes a new instance of the Matrix class More... | |
Matrix (uint dim1, int dim2) | |
Initializes a new instance of the Matrix class More... | |
Matrix (uint dim1, uint dim2) | |
Initializes a new instance of the Matrix class More... | |
Matrix (Matrix< T > matrix) | |
Copy constructor. Creates a deep copy of the given matrix. More... | |
Matrix (IList< IList< T >> data) | |
Constructor that takes a list of lists to initialize the matrix More... | |
void | Resize (int num_rows, int num_cols) |
Grows or shrinks the matrix to the requested size, if necessary More... | |
void | SetColumn (int j, IList< T > column) |
Sets the values of the j-th column to the values in a given array More... | |
void | SetColumnToOneValue (int j, T v) |
Sets an entire column to a specified value More... | |
void | SetRow (int i, IList< T > row) |
Sets the values of the i-th row to the values in a given array More... | |
void | SetRowToOneValue (int i, T v) |
Sets an entire row to a specified value More... | |
IMatrix< T > | Transpose () |
Get the transpose of the matrix, i.e. a matrix where rows and columns are interchanged More... | |
Public Attributes | |
int | dim1 |
Dimension 1, the number of rows More... | |
int | dim2 |
Dimension 2, the number of columns More... | |
Properties | |
virtual bool | IsSymmetric [get] |
int | NumberOfColumns [get] |
int | NumberOfRows [get] |
virtual T | this[int i, int j] [get, set] |
T | this[int x, int y] [get, set] |
The value at (i,j) More... | |
Class for storing dense matrices
The data is stored in row-major mode. Indexes are zero-based.
T | the type of the matrix entries |
|
inline |
Initializes a new instance of the Matrix class
dim1 | the number of rows |
dim2 | the number of columns |
|
inline |
Initializes a new instance of the Matrix class
dim1 | the number of rows |
dim2 | the number of columns |
|
inline |
Initializes a new instance of the Matrix class
dim1 | the number of rows |
dim2 | the number of columns |
|
inline |
Initializes a new instance of the Matrix class
dim1 | the number of rows |
dim2 | the number of columns |
Copy constructor. Creates a deep copy of the given matrix.
matrix | the matrix to be copied |
|
inline |
Constructor that takes a list of lists to initialize the matrix
data | a list of lists of T |
|
inline |
Enlarges the matrix to num_rows rows
Do nothing if num_rows is less than dim1. The new entries are filled with zeros.
num_rows | the minimum number of rows |
|
inline |
Create a matrix with a given number of rows and columns
num_rows | the number of rows |
num_columns | the number of columns |
Implements IMatrix< T >.
|
inline |
Returns a copy of the j-th column of the matrix
j | the column ID |
|
inline |
Returns a copy of the i-th row of the matrix
i | the row ID |
|
inline |
Init the matrix with a default value
d | the default value |
|
inline |
Grows or shrinks the matrix to the requested size, if necessary
The new entries are filled with zeros. Obsolete entries are removed.
num_rows | the number of rows |
num_cols | the number of columns |
Implements IMatrix< T >.
|
inline |
Sets the values of the j-th column to the values in a given array
j | the column ID |
column | a list of T of length dim2 |
|
inline |
Sets an entire column to a specified value
v | the value to be used |
j | the column ID |
|
inline |
Sets the values of the i-th row to the values in a given array
i | the row ID |
row | a list of T of length dim1 |
|
inline |
Sets an entire row to a specified value
v | the value to be used |
i | the row ID |
|
inline |
Get the transpose of the matrix, i.e. a matrix where rows and columns are interchanged
Implements IMatrix< T >.
int dim1 |
Dimension 1, the number of rows
int dim2 |
Dimension 2, the number of columns
|
getsetinherited |
The value at (i,j)
The value at (i,j)
x | the row ID |
y | the column ID |