MyMediaLite  3.01
Static Public Member Functions
MatrixExtensions Class Reference

Utilities to work with matrices. More...

List of all members.

Static Public Member Functions

static double ColumnAverage (this Matrix< double > matrix, int col)
 Compute the average value of the entries in a column of a matrix.
static float ColumnAverage (this Matrix< float > matrix, int col)
 Compute the average value of the entries in a column of a matrix.
static void ColumnInitNormal (this Matrix< double > matrix, int column, double mean, double stddev)
 Initializes one column of a double matrix with normal distributed (Gaussian) noise.
static void ColumnInitNormal (this Matrix< float > matrix, int column, double mean, double stddev)
 Initializes one column of a float matrix with normal distributed (Gaussian) noise.
static double FrobeniusNorm (this Matrix< double > matrix)
 Compute the Frobenius norm (square root of the sum of squared entries) of a matrix.
static float FrobeniusNorm (this Matrix< float > matrix)
 Compute the Frobenius norm (square root of the sum of squared entries) of a matrix.
static void Inc (this Matrix< double > matrix, int i, int j, double v)
 Increments the specified matrix element by a double value.
static void Inc (this Matrix< float > matrix, int i, int j, double v)
 Increments the specified matrix element by a double value.
static void Inc (this Matrix< double > matrix1, Matrix< double > matrix2)
 Increment the elements in one matrix by the ones in another.
static void Inc (this Matrix< float > matrix1, Matrix< float > matrix2)
 Increment the elements in one matrix by the ones in another.
static void Inc (this Matrix< int > matrix, int i, int j)
 Increments the specified matrix element by 1.
static void Inc (this Matrix< double > matrix, double d)
 Increment all entries of a matrix with a scalar.
static void InitNormal (this Matrix< double > matrix, double mean, double stddev)
 Initializes a double matrix with normal distributed (Gaussian) noise.
static void InitNormal (this Matrix< float > matrix, double mean, double stddev)
 Initializes a float matrix with normal distributed (Gaussian) noise.
static int Max (this Matrix< int > m)
 return the maximum value contained in a matrix
static double Max (this Matrix< double > m)
 return the maximum value contained in a matrix
static float Max (this Matrix< float > m)
 return the maximum value contained in a matrix
static void Multiply (this Matrix< double > matrix, double d)
 Multiply all entries of a matrix with a scalar.
static void Multiply (this Matrix< float > matrix, float f)
 Multiply all entries of a matrix with a scalar.
static void MultiplyColumn (this Matrix< float > matrix, int j, float scalar)
 Multiplies one column of a matrix with a scalar.
static double RowAverage (this Matrix< double > matrix, int row)
 Compute the average value of the entries in a row of a matrix.
static IList< double > RowDifference (Matrix< double > matrix1, int i, Matrix< double > matrix2, int j)
 Compute the difference vector between two rows of two matrices.
static void RowInitNormal (this Matrix< double > matrix, int row, double mean, double stddev)
 Initializes one row of a double matrix with normal distributed (Gaussian) noise.
static void RowInitNormal (this Matrix< float > matrix, int row, double mean, double stddev)
 Initializes one row of a float matrix with normal distributed (Gaussian) noise.
static double RowScalarProduct (this Matrix< double > matrix, int i, IList< double > vector)
 Compute the scalar product between a vector and a row of the matrix.
static float RowScalarProduct (this Matrix< float > matrix, int i, IList< float > vector)
 Compute the scalar product between a vector and a row of the matrix.
static double RowScalarProduct (this Matrix< float > matrix, int i, IList< double > vector)
 Compute the scalar product between a vector and a row of the matrix.
static double RowScalarProduct (this Matrix< double > matrix1, int i, Matrix< double > matrix2, int j)
 Compute the scalar product between two rows of two matrices.
static float RowScalarProduct (Matrix< float > matrix1, int i, Matrix< float > matrix2, int j)
 Compute the scalar product between two rows of two matrices.
static double RowScalarProductWithRowDifference (Matrix< double > matrix1, int i, Matrix< double > matrix2, int j, Matrix< double > matrix3, int k)
 Compute the scalar product of a matrix row with the difference vector of two other matrix rows.
static double RowScalarProductWithRowDifference (Matrix< float > matrix1, int i, Matrix< float > matrix2, int j, Matrix< float > matrix3, int k)
 Compute the scalar product of a matrix row with the difference vector of two other matrix rows.
static IList< float > SumOfRows (this Matrix< float > matrix, ICollection< int > row_ids)
 Sum up a given number of rows of a matrix.

Detailed Description

Utilities to work with matrices.


Member Function Documentation

static double ColumnAverage ( this Matrix< double >  matrix,
int  col 
) [inline, static]

Compute the average value of the entries in a column of a matrix.

Parameters:
matrixthe matrix
colthe column ID
Returns:
the average
static float ColumnAverage ( this Matrix< float >  matrix,
int  col 
) [inline, static]

Compute the average value of the entries in a column of a matrix.

Parameters:
matrixthe matrix
colthe column ID
Returns:
the average
static void ColumnInitNormal ( this Matrix< double >  matrix,
int  column,
double  mean,
double  stddev 
) [inline, static]

Initializes one column of a double matrix with normal distributed (Gaussian) noise.

Parameters:
matrixthe matrix to initialize
meanthe mean of the normal distribution drawn from
stddevthe standard deviation of the normal distribution
columnthe column to be initialized
static void ColumnInitNormal ( this Matrix< float >  matrix,
int  column,
double  mean,
double  stddev 
) [inline, static]

Initializes one column of a float matrix with normal distributed (Gaussian) noise.

Parameters:
matrixthe matrix to initialize
meanthe mean of the normal distribution drawn from
stddevthe standard deviation of the normal distribution
columnthe column to be initialized
static double FrobeniusNorm ( this Matrix< double >  matrix) [inline, static]

Compute the Frobenius norm (square root of the sum of squared entries) of a matrix.

See http://en.wikipedia.org/wiki/Matrix_norm

Parameters:
matrixthe matrix
Returns:
the Frobenius norm of the matrix
static float FrobeniusNorm ( this Matrix< float >  matrix) [inline, static]

Compute the Frobenius norm (square root of the sum of squared entries) of a matrix.

See http://en.wikipedia.org/wiki/Matrix_norm

Parameters:
matrixthe matrix
Returns:
the Frobenius norm of the matrix
static void Inc ( this Matrix< double >  matrix,
int  i,
int  j,
double  v 
) [inline, static]

Increments the specified matrix element by a double value.

Parameters:
matrixthe matrix
ithe row
jthe column
vthe value
static void Inc ( this Matrix< float >  matrix,
int  i,
int  j,
double  v 
) [inline, static]

Increments the specified matrix element by a double value.

Parameters:
matrixthe matrix
ithe row
jthe column
vthe value
static void Inc ( this Matrix< double >  matrix1,
Matrix< double >  matrix2 
) [inline, static]

Increment the elements in one matrix by the ones in another.

Parameters:
matrix1the matrix to be incremented
matrix2the other matrix
static void Inc ( this Matrix< float >  matrix1,
Matrix< float >  matrix2 
) [inline, static]

Increment the elements in one matrix by the ones in another.

Parameters:
matrix1the matrix to be incremented
matrix2the other matrix
static void Inc ( this Matrix< int >  matrix,
int  i,
int  j 
) [inline, static]

Increments the specified matrix element by 1.

Parameters:
matrixthe matrix
ithe row
jthe column
static void Inc ( this Matrix< double >  matrix,
double  d 
) [inline, static]

Increment all entries of a matrix with a scalar.

Parameters:
matrixthe matrix
dthe number to increment with
static void InitNormal ( this Matrix< double >  matrix,
double  mean,
double  stddev 
) [inline, static]

Initializes a double matrix with normal distributed (Gaussian) noise.

Parameters:
matrixthe matrix to initialize
meanthe mean of the normal distribution drawn from
stddevthe standard deviation of the normal distribution
static void InitNormal ( this Matrix< float >  matrix,
double  mean,
double  stddev 
) [inline, static]

Initializes a float matrix with normal distributed (Gaussian) noise.

Parameters:
matrixthe matrix to initialize
meanthe mean of the normal distribution drawn from
stddevthe standard deviation of the normal distribution
static int Max ( this Matrix< int >  m) [inline, static]

return the maximum value contained in a matrix

Parameters:
mthe matrix
static double Max ( this Matrix< double >  m) [inline, static]

return the maximum value contained in a matrix

Parameters:
mthe matrix
static float Max ( this Matrix< float >  m) [inline, static]

return the maximum value contained in a matrix

Parameters:
mthe matrix
static void Multiply ( this Matrix< double >  matrix,
double  d 
) [inline, static]

Multiply all entries of a matrix with a scalar.

Parameters:
matrixthe matrix
dthe number to multiply with
static void Multiply ( this Matrix< float >  matrix,
float  f 
) [inline, static]

Multiply all entries of a matrix with a scalar.

Parameters:
matrixthe matrix
fthe number to multiply with
static void MultiplyColumn ( this Matrix< float >  matrix,
int  j,
float  scalar 
) [inline, static]

Multiplies one column of a matrix with a scalar.

Parameters:
matrixthe matrix
jthe column ID
scalarthe scalar value to multiply with
static double RowAverage ( this Matrix< double >  matrix,
int  row 
) [inline, static]

Compute the average value of the entries in a row of a matrix.

Parameters:
matrixthe matrix
rowthe row ID
Returns:
the average
static IList<double> RowDifference ( Matrix< double >  matrix1,
int  i,
Matrix< double >  matrix2,
int  j 
) [inline, static]

Compute the difference vector between two rows of two matrices.

Parameters:
matrix1the first matrix
ithe first row ID
matrix2the second matrix
jthe second row ID
Returns:
the difference vector of row i of matrix1 and row j of matrix2
static void RowInitNormal ( this Matrix< double >  matrix,
int  row,
double  mean,
double  stddev 
) [inline, static]

Initializes one row of a double matrix with normal distributed (Gaussian) noise.

Parameters:
matrixthe matrix to initialize
rowthe row to be initialized
meanthe mean of the normal distribution drawn from
stddevthe standard deviation of the normal distribution
static void RowInitNormal ( this Matrix< float >  matrix,
int  row,
double  mean,
double  stddev 
) [inline, static]

Initializes one row of a float matrix with normal distributed (Gaussian) noise.

Parameters:
matrixthe matrix to initialize
rowthe row to be initialized
meanthe mean of the normal distribution drawn from
stddevthe standard deviation of the normal distribution
static double RowScalarProduct ( this Matrix< double >  matrix,
int  i,
IList< double >  vector 
) [inline, static]

Compute the scalar product between a vector and a row of the matrix.

Parameters:
matrixthe matrix
ithe row ID
vectorthe numeric vector
Returns:
the scalar product of row i and the vector
static float RowScalarProduct ( this Matrix< float >  matrix,
int  i,
IList< float >  vector 
) [inline, static]

Compute the scalar product between a vector and a row of the matrix.

Parameters:
matrixthe matrix
ithe row ID
vectorthe numeric vector
Returns:
the scalar product of row i and the vector
static double RowScalarProduct ( this Matrix< float >  matrix,
int  i,
IList< double >  vector 
) [inline, static]

Compute the scalar product between a vector and a row of the matrix.

Parameters:
matrixthe matrix
ithe row ID
vectorthe numeric vector
Returns:
the scalar product of row i and the vector
static double RowScalarProduct ( this Matrix< double >  matrix1,
int  i,
Matrix< double >  matrix2,
int  j 
) [inline, static]

Compute the scalar product between two rows of two matrices.

Parameters:
matrix1the first matrix
ithe first row ID
matrix2the second matrix
jthe second row ID
Returns:
the scalar product of row i of matrix1 and row j of matrix2
static float RowScalarProduct ( Matrix< float >  matrix1,
int  i,
Matrix< float >  matrix2,
int  j 
) [inline, static]

Compute the scalar product between two rows of two matrices.

Parameters:
matrix1the first matrix
ithe first row ID
matrix2the second matrix
jthe second row ID
Returns:
the scalar product of row i of matrix1 and row j of matrix2
static double RowScalarProductWithRowDifference ( Matrix< double >  matrix1,
int  i,
Matrix< double >  matrix2,
int  j,
Matrix< double >  matrix3,
int  k 
) [inline, static]

Compute the scalar product of a matrix row with the difference vector of two other matrix rows.

Parameters:
matrix1the first matrix
ithe first row ID
matrix2the second matrix
jthe second row ID
matrix3the third matrix
kthe third row ID

///

Returns:
see summary
static double RowScalarProductWithRowDifference ( Matrix< float >  matrix1,
int  i,
Matrix< float >  matrix2,
int  j,
Matrix< float >  matrix3,
int  k 
) [inline, static]

Compute the scalar product of a matrix row with the difference vector of two other matrix rows.

Parameters:
matrix1the first matrix
ithe first row ID
matrix2the second matrix
jthe second row ID
matrix3the third matrix
kthe third row ID

///

Returns:
see summary
static IList<float> SumOfRows ( this Matrix< float >  matrix,
ICollection< int >  row_ids 
) [inline, static]

Sum up a given number of rows of a matrix.

Returns:
The vector representing the sum of the given rows
Parameters:
matrixthe matrix
row_idsa collection of row IDs

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