public class Matrix extends Object
Constructor and Description |
---|
Matrix(int n)
Construct a square matrix object.
|
Matrix(int row,
int col)
Construct a rectangle matrix object.
|
Modifier and Type | Method and Description |
---|---|
Matrix |
copy()
Copy the matrix.
|
Matrix |
crossSqDistance(Matrix Y)
Cross squared Euclidean distance Matrix: Z_{ij} = ||X_i - Y_j||^2
|
Matrix |
diagonal()
If the matrix is a row or column vector, make a diagonal matrix from it.
|
Matrix |
dividedBy(Matrix Y)
Matrix division: X\Y.
|
Matrix |
dividedBy(Matrix Y,
int bw)
Matrix division with bandwidth: X\Y.
|
Matrix |
eigenvalues(double eps,
int lmax)
Make a row vector including the eigenvalues of the matrix.
|
Matrix |
horizontalSum()
Make a horizontal-summation vector.
|
static Matrix |
identity(int n)
Make an identity matrix.
|
Matrix |
linearConv(double a,
double b,
Matrix Y)
Linear conversion: a*X + b*Y.
|
Matrix |
mulipliedEntriesWith(Matrix Y)
Multiply entries.
|
Matrix |
multipliedBy(double a)
Scalar product: aX.
|
Matrix |
multipliedBy(Matrix Y)
Matrix multiplication: X*Y.
|
static Matrix |
random(int row,
int col)
Same as random(row, col, 1).
|
static Matrix |
random(int row,
int col,
int seed)
Make a standard Gaussian random Matrix.
|
double |
sumEntries()
Summation of all entries.
|
double |
sumSqrEntries()
Summation of squared entries.
|
Matrix |
transpose()
Transpose: X'.
|
void |
updateDivideByRowVector(Matrix vec)
X_{ij} = X_{ij}/v_{j}.
|
void |
updateExp()
Update by exponential : exp(X_{ij})
|
void |
updateLinearConv(double a,
double b,
Matrix Y)
Update by Linear conversion: X = a*X + b*Y.
|
Matrix |
verticalSum()
Make a vertical-summation vector.
|
public Matrix(int n)
n
- sizepublic Matrix(int row, int col)
row
- number of rowcol
- number of columnpublic static Matrix identity(int n)
n
- sizepublic static Matrix random(int row, int col, int seed)
row
- number of rowcol
- number of columnseed
- random seedpublic static Matrix random(int row, int col)
public Matrix copy()
public Matrix transpose()
public void updateLinearConv(double a, double b, Matrix Y)
public Matrix multipliedBy(double a)
public Matrix crossSqDistance(Matrix Y)
public void updateExp()
public Matrix horizontalSum()
public Matrix verticalSum()
public double sumEntries()
public double sumSqrEntries()
public void updateDivideByRowVector(Matrix vec)
public Matrix diagonal()
public Matrix eigenvalues(double eps, int lmax)
eps
- allowable absolute value of off-diagonal entriesSCaVis 1.0 ©