C# Класс MyMediaLite.DataType.MatrixUtils

Utilities to work with matrices
Показать файл Открыть проект

Открытые методы

Метод Описание
ColumnAverage ( Matrix matrix, int col ) : double

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

ColumnInitNormal ( Matrix matrix, double mean, double stdev, int column ) : void

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

FrobeniusNorm ( Matrix matrix ) : double

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

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

Inc ( Matrix matrix1, Matrix matrix2 ) : void

Increment the elements in one matrix by the ones in another

Inc ( Matrix matrix, int i, int j, double v ) : void

Increments the specified matrix element by a double value

InitNormal ( Matrix matrix, double mean, double stdev ) : void

Initializes a double matrix with normal distributed (Gaussian) noise

Multiply ( Matrix matrix, double d ) : void

Multiply all entries of a matrix with a scalar

RowAverage ( Matrix matrix, int row ) : double

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

RowDifference ( Matrix matrix1, int i, Matrix matrix2, int j ) : IList

Compute the difference vector between two rows of two matrices

RowInitNormal ( Matrix matrix, double mean, double stdev, int row ) : void

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

RowScalarProduct ( Matrix matrix, int i, IList vector ) : double

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

RowScalarProduct ( Matrix matrix1, int i, Matrix matrix2, int j ) : double

Compute the scalar product between two rows of two matrices

RowScalarProductWithRowDifference ( Matrix matrix1, int i, Matrix matrix2, int j, Matrix matrix3, int k ) : double

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

Описание методов

ColumnAverage() публичный статический Метод

Compute the average value of the entries in a column of a matrix
public static ColumnAverage ( Matrix matrix, int col ) : double
matrix Matrix the matrix
col int the column ID
Результат double

ColumnInitNormal() публичный статический Метод

Initializes one column of a double matrix with normal distributed (Gaussian) noise
public static ColumnInitNormal ( Matrix matrix, double mean, double stdev, int column ) : void
matrix Matrix the matrix to initialize
mean double the mean of the normal distribution drawn from
stdev double the standard deviation of the normal distribution
column int the column to be initialized
Результат void

FrobeniusNorm() публичный статический Метод

Compute the Frobenius norm (square root of the sum of squared entries) of a matrix
See http://en.wikipedia.org/wiki/Matrix_norm
public static FrobeniusNorm ( Matrix matrix ) : double
matrix Matrix the matrix
Результат double

Inc() публичный статический Метод

Increment the elements in one matrix by the ones in another
public static Inc ( Matrix matrix1, Matrix matrix2 ) : void
matrix1 Matrix the matrix to be incremented
matrix2 Matrix the other matrix
Результат void

Inc() публичный статический Метод

Increments the specified matrix element by a double value
public static Inc ( Matrix matrix, int i, int j, double v ) : void
matrix Matrix The matrix.
i int the row
j int the column
v double the value
Результат void

InitNormal() публичный статический Метод

Initializes a double matrix with normal distributed (Gaussian) noise
public static InitNormal ( Matrix matrix, double mean, double stdev ) : void
matrix Matrix the matrix to initialize
mean double the mean of the normal distribution drawn from
stdev double the standard deviation of the normal distribution
Результат void

Multiply() публичный статический Метод

Multiply all entries of a matrix with a scalar
public static Multiply ( Matrix matrix, double d ) : void
matrix Matrix the matrix
d double the number to multiply with
Результат void

RowAverage() публичный статический Метод

Compute the average value of the entries in a row of a matrix
public static RowAverage ( Matrix matrix, int row ) : double
matrix Matrix the matrix
row int the row ID
Результат double

RowDifference() публичный статический Метод

Compute the difference vector between two rows of two matrices
public static RowDifference ( Matrix matrix1, int i, Matrix matrix2, int j ) : IList
matrix1 Matrix the first matrix
i int the first row ID
matrix2 Matrix the second matrix
j int the second row ID
Результат IList

RowInitNormal() публичный статический Метод

Initializes one row of a double matrix with normal distributed (Gaussian) noise
public static RowInitNormal ( Matrix matrix, double mean, double stdev, int row ) : void
matrix Matrix the matrix to initialize
mean double the mean of the normal distribution drawn from
stdev double the standard deviation of the normal distribution
row int the row to be initialized
Результат void

RowScalarProduct() публичный статический Метод

Compute the scalar product between a vector and a row of the matrix
public static RowScalarProduct ( Matrix matrix, int i, IList vector ) : double
matrix Matrix the matrix
i int the row ID
vector IList the numeric vector
Результат double

RowScalarProduct() публичный статический Метод

Compute the scalar product between two rows of two matrices
public static RowScalarProduct ( Matrix matrix1, int i, Matrix matrix2, int j ) : double
matrix1 Matrix the first matrix
i int the first row ID
matrix2 Matrix the second matrix
j int the second row ID
Результат double

RowScalarProductWithRowDifference() публичный статический Метод

Compute the scalar product of a matrix row with the difference vector of two other matrix rows
public static RowScalarProductWithRowDifference ( Matrix matrix1, int i, Matrix matrix2, int j, Matrix matrix3, int k ) : double
matrix1 Matrix the first matrix
i int the first row ID
matrix2 Matrix the second matrix
j int the second row ID
matrix3 Matrix the third matrix
k int the third row ID
Результат double