MatrixUtils Class Reference
Utilities to work with matrices.
More...
List of all members.
Static Public Member Functions |
static double | ColumnAverage (Matrix< double > matrix, int col) |
| Compute the average value of the entries in a column of a matrix.
|
static bool | ContainsNaN (Matrix< double > matrix) |
| Check whether a matrix contains NaN ("not a number") elements.
|
static double | FrobeniusNorm (Matrix< double > matrix) |
| Compute the Frobenius norm (square root of the sum of squared entries) of a matrix.
|
static void | Inc (Matrix< double > matrix1, Matrix< double > matrix2) |
| Increment the elements in one matrix by the ones in another.
|
static void | Inc (Matrix< double > matrix, int i, int j, double v) |
| Increments the specified matrix element by a double value.
|
static void | InitNormal (Matrix< double > matrix, double mean, double stdev) |
| Initializes a double matrix with normal distributed (Gaussian) noise.
|
static void | InitNormal (Matrix< double > matrix, double mean, double stdev, int row) |
| Initializes one row of a double matrix with normal distributed (Gaussian) noise.
|
static void | Multiply (Matrix< double > matrix, double d) |
| Multiply all entries of a matrix with a scalar.
|
static double | RowAverage (Matrix< double > matrix, int row) |
| Compute the average value of the entries in a row of a matrix.
|
static double | RowScalarProduct (Matrix< double > matrix1, int i, Matrix< double > matrix2, int j) |
| Compute the scalar product between two rows of two matrices.
|
static double | RowScalarProduct (Matrix< double > matrix, int i, IList< double > vector) |
| Compute the scalar product between a vector and a row of the matrix.
|
Detailed Description
Utilities to work with matrices.
Member Function Documentation
static double ColumnAverage |
( |
Matrix< double > |
matrix, |
|
|
int |
col | |
|
) |
| | [static] |
Compute the average value of the entries in a column of a matrix.
- Parameters:
-
| matrix | the matrix |
| col | the column ID |
- Returns:
- the average
static bool ContainsNaN |
( |
Matrix< double > |
matrix |
) |
[static] |
Check whether a matrix contains NaN ("not a number") elements.
- Parameters:
-
- Returns:
- true if there are NaN elements in the matrix, false otherwise
static double FrobeniusNorm |
( |
Matrix< double > |
matrix |
) |
[static] |
static void Inc |
( |
Matrix< double > |
matrix1, |
|
|
Matrix< double > |
matrix2 | |
|
) |
| | [static] |
Increment the elements in one matrix by the ones in another.
- Parameters:
-
| matrix1 | the matrix to be incremented |
| matrix2 | the other matrix |
static void Inc |
( |
Matrix< double > |
matrix, |
|
|
int |
i, |
|
|
int |
j, |
|
|
double |
v | |
|
) |
| | [static] |
Increments the specified matrix element by a double value.
- Parameters:
-
| matrix | The matrix. |
| i | the row |
| j | the column |
| v | the value |
static void InitNormal |
( |
Matrix< double > |
matrix, |
|
|
double |
mean, |
|
|
double |
stdev | |
|
) |
| | [static] |
Initializes a double matrix with normal distributed (Gaussian) noise.
- Parameters:
-
| matrix | the matrix to initialize |
| mean | the mean of the normal distribution drawn from |
| stdev | the standard deviation of the normal distribution |
static void InitNormal |
( |
Matrix< double > |
matrix, |
|
|
double |
mean, |
|
|
double |
stdev, |
|
|
int |
row | |
|
) |
| | [static] |
Initializes one row of a double matrix with normal distributed (Gaussian) noise.
- Parameters:
-
| matrix | the matrix to initialize |
| mean | the mean of the normal distribution drawn from |
| stdev | the standard deviation of the normal distribution |
| row | the row to be initialized |
static void Multiply |
( |
Matrix< double > |
matrix, |
|
|
double |
d | |
|
) |
| | [static] |
Multiply all entries of a matrix with a scalar.
- Parameters:
-
| matrix | the matrix |
| d | the number to multiply with |
static double RowAverage |
( |
Matrix< double > |
matrix, |
|
|
int |
row | |
|
) |
| | [static] |
Compute the average value of the entries in a row of a matrix.
- Parameters:
-
| matrix | the matrix |
| row | the row ID |
- Returns:
- the average
static double RowScalarProduct |
( |
Matrix< double > |
matrix1, |
|
|
int |
i, |
|
|
Matrix< double > |
matrix2, |
|
|
int |
j | |
|
) |
| | [static] |
Compute the scalar product between two rows of two matrices.
- Parameters:
-
| matrix1 | the first matrix |
| i | the first row ID |
| matrix2 | the second matrix |
| j | the second row ID |
- Returns:
- the scalar product of row i of matrix1 and row j of matrix2
static double RowScalarProduct |
( |
Matrix< double > |
matrix, |
|
|
int |
i, |
|
|
IList< double > |
vector | |
|
) |
| | [static] |
Compute the scalar product between a vector and a row of the matrix.
- Parameters:
-
| matrix | the matrix |
| i | the row ID |
| vector | the numeric vector |
- Returns:
- the scalar product of row i and the vector
The documentation for this class was generated from the following file: