|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.datatype.MatrixExtensions
public class MatrixExtensions
Utilities to work with matrices * @version 2.03
Constructor Summary | |
---|---|
MatrixExtensions()
|
Method Summary | |
---|---|
static double |
columnAverage(Matrix<java.lang.Double> matrix,
int col)
Compute the average value of the entries in a column of a matrix. |
static void |
columnInitNormal(Matrix<java.lang.Double> matrix,
int column,
double mean,
double stdev)
Initializes one column of a double matrix with normal distributed (Gaussian) noise. |
static double |
frobeniusNorm(Matrix<java.lang.Double> matrix)
Compute the Frobenius norm (square root of the sum of squared entries) of a matrix. |
static void |
inc(Matrix<java.lang.Double> matrix,
double d)
Increment all entries of a matrix with a scalar. |
static void |
inc(Matrix<java.lang.Double> matrix,
int i,
int j,
double v)
Increments the specified matrix element by a double value. |
static void |
inc(Matrix<java.lang.Double> matrix1,
Matrix<java.lang.Double> matrix2)
Increment the elements in one matrix by the ones in another |
static void |
inc(Matrix<java.lang.Integer> matrix,
int i,
int j)
Increments the specified matrix element by 1. |
static void |
initNormal(Matrix<java.lang.Double> matrix,
double mean,
double stdev)
Initializes a double matrix with normal distributed (Gaussian) noise. |
static double |
maxDouble(Matrix<java.lang.Double> m)
Return the maximum value contained in a matrix. |
static float |
maxFloat(Matrix<java.lang.Float> m)
return the maximum value contained in a matrix. |
static int |
maxInteger(Matrix<java.lang.Integer> m)
Return the maximum value contained in a matrix. |
static void |
multiply(Matrix<java.lang.Double> matrix,
double d)
Multiply all entries of a matrix with a scalar. |
static double |
rowAverage(Matrix<java.lang.Double> matrix,
int row)
Compute the average value of the entries in a row of a matrix. |
static java.util.List<java.lang.Double> |
rowDifference(Matrix<java.lang.Double> matrix1,
int i,
Matrix<java.lang.Double> matrix2,
int j)
Compute the difference vector between two rows of two matrices. |
static void |
rowInitNormal(Matrix<java.lang.Double> matrix,
int row,
double mean,
double stdev)
Initializes one row of a double matrix with normal distributed (Gaussian) noise. |
static double |
rowScalarProduct(Matrix<java.lang.Double> matrix,
int i,
java.util.List<java.lang.Double> vector)
Compute the scalar product between a vector and a row of the matrix. |
static java.lang.Double |
rowScalarProduct(Matrix<java.lang.Double> matrix1,
int i,
Matrix<java.lang.Double> matrix2,
int j)
Compute the scalar product between two rows of two matrices. |
static double |
rowScalarProductWithRowDifference(Matrix<java.lang.Double> matrix1,
int i,
Matrix<java.lang.Double> matrix2,
int j,
Matrix<java.lang.Double> matrix3,
int k)
Compute the scalar product of a matrix row with the difference vector of two other matrix rows. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MatrixExtensions()
Method Detail |
---|
public static void rowInitNormal(Matrix<java.lang.Double> matrix, int row, double mean, double stdev)
matrix
- the matrix to initializemean
- the mean of the normal distribution drawn fromstdev
- the standard deviation of the normal distributionrow
- the row to be initializedpublic static void columnInitNormal(Matrix<java.lang.Double> matrix, int column, double mean, double stdev)
matrix
- the matrix to initializemean
- the mean of the normal distribution drawn fromstdev
- the standard deviation of the normal distributioncolumn
- the column to be initializedpublic static void initNormal(Matrix<java.lang.Double> matrix, double mean, double stdev)
matrix
- the matrix to initializemean
- the mean of the normal distribution drawn fromstdev
- the standard deviation of the normal distributionpublic static void inc(Matrix<java.lang.Double> matrix, int i, int j, double v)
matrix
- The matrixi
- the rowj
- the columnv
- the valuepublic static void inc(Matrix<java.lang.Double> matrix1, Matrix<java.lang.Double> matrix2)
matrix1
- the matrix to be incrementedmatrix2
- the other matrixpublic static void inc(Matrix<java.lang.Integer> matrix, int i, int j)
matrix
- the matrixi
- the rowj
- the columnpublic static void inc(Matrix<java.lang.Double> matrix, double d)
matrix
- the matrixd
- the number to increment withpublic static double columnAverage(Matrix<java.lang.Double> matrix, int col)
matrix
- the matrixcol
- the column ID
public static double rowAverage(Matrix<java.lang.Double> matrix, int row)
matrix
- the matrixrow
- the row ID
public static void multiply(Matrix<java.lang.Double> matrix, double d)
matrix
- the matrixd
- the number to multiply withpublic static double frobeniusNorm(Matrix<java.lang.Double> matrix)
matrix
- the matrix
public static double rowScalarProduct(Matrix<java.lang.Double> matrix, int i, java.util.List<java.lang.Double> vector)
matrix
- the matrixi
- the row IDvector
- the numeric vector
public static java.lang.Double rowScalarProduct(Matrix<java.lang.Double> matrix1, int i, Matrix<java.lang.Double> matrix2, int j)
matrix1
- the first matrixi
- the first row IDmatrix2
- the second matrixj
- the second row ID
public static java.util.List<java.lang.Double> rowDifference(Matrix<java.lang.Double> matrix1, int i, Matrix<java.lang.Double> matrix2, int j)
matrix1
- the first matrixi
- the first row IDmatrix2
- the second matrixj
- the second row ID
public static double rowScalarProductWithRowDifference(Matrix<java.lang.Double> matrix1, int i, Matrix<java.lang.Double> matrix2, int j, Matrix<java.lang.Double> matrix3, int k)
matrix1
- the first matrixi
- the first row IDmatrix2
- the second matrixj
- the second row IDmatrix3
- the third matrixk
- the third row ID
public static int maxInteger(Matrix<java.lang.Integer> m)
m
- the matrixpublic static double maxDouble(Matrix<java.lang.Double> m)
m
- the matrixpublic static float maxFloat(Matrix<java.lang.Float> m)
m
- the matrix
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |