Matrix (original) (raw)
Modifier and Type
Method and Description
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[arrayLeftDivide](../../../weka/core/matrix/Matrix.html#arrayLeftDivide-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
Element-by-element left division, C = A.\B
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[arrayLeftDivideEquals](../../../weka/core/matrix/Matrix.html#arrayLeftDivideEquals-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
Element-by-element left division in place, A = A.\B
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[arrayRightDivide](../../../weka/core/matrix/Matrix.html#arrayRightDivide-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
Element-by-element right division, C = A./B
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[arrayRightDivideEquals](../../../weka/core/matrix/Matrix.html#arrayRightDivideEquals-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
Element-by-element right division in place, A = A./B
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[arrayTimes](../../../weka/core/matrix/Matrix.html#arrayTimes-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
Element-by-element multiplication, C = A.*B
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[arrayTimesEquals](../../../weka/core/matrix/Matrix.html#arrayTimesEquals-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
Element-by-element multiplication in place, A = A.*B
[CholeskyDecomposition](../../../weka/core/matrix/CholeskyDecomposition.html "class in weka.core.matrix")
[chol](../../../weka/core/matrix/Matrix.html#chol--)()
Cholesky Decomposition
java.lang.Object
[clone](../../../weka/core/matrix/Matrix.html#clone--)()
Clone the Matrix object.
double
[cond](../../../weka/core/matrix/Matrix.html#cond--)()
Matrix condition (2 norm)
static [Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[constructWithCopy](../../../weka/core/matrix/Matrix.html#constructWithCopy-double:A:A-)(double[][] A)
Construct a matrix from a copy of a 2-D array.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[copy](../../../weka/core/matrix/Matrix.html#copy--)()
Make a deep copy of a matrix
double
[det](../../../weka/core/matrix/Matrix.html#det--)()
Matrix determinant
[EigenvalueDecomposition](../../../weka/core/matrix/EigenvalueDecomposition.html "class in weka.core.matrix")
[eig](../../../weka/core/matrix/Matrix.html#eig--)()
Eigenvalue Decomposition
double
[get](../../../weka/core/matrix/Matrix.html#get-int-int-)(int i, int j)
Get a single element.
double[][]
[getArray](../../../weka/core/matrix/Matrix.html#getArray--)()
Access the internal two-dimensional array.
double[][]
[getArrayCopy](../../../weka/core/matrix/Matrix.html#getArrayCopy--)()
Copy the internal two-dimensional array.
int
[getColumnDimension](../../../weka/core/matrix/Matrix.html#getColumnDimension--)()
Get column dimension.
double[]
[getColumnPackedCopy](../../../weka/core/matrix/Matrix.html#getColumnPackedCopy--)()
Make a one-dimensional column packed copy of the internal array.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[getMatrix](../../../weka/core/matrix/Matrix.html#getMatrix-int:A-int:A-)(int[] r, int[] c)
Get a submatrix.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[getMatrix](../../../weka/core/matrix/Matrix.html#getMatrix-int:A-int-int-)(int[] r, int j0, int j1)
Get a submatrix.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[getMatrix](../../../weka/core/matrix/Matrix.html#getMatrix-int-int-int:A-)(int i0, int i1, int[] c)
Get a submatrix.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[getMatrix](../../../weka/core/matrix/Matrix.html#getMatrix-int-int-int-int-)(int i0, int i1, int j0, int j1)
Get a submatrix.
java.lang.String
[getRevision](../../../weka/core/matrix/Matrix.html#getRevision--)()
Returns the revision string.
int
[getRowDimension](../../../weka/core/matrix/Matrix.html#getRowDimension--)()
Get row dimension.
double[]
[getRowPackedCopy](../../../weka/core/matrix/Matrix.html#getRowPackedCopy--)()
Make a one-dimensional row packed copy of the internal array.
static [Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[identity](../../../weka/core/matrix/Matrix.html#identity-int-int-)(int m, int n)
Generate identity matrix
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[inverse](../../../weka/core/matrix/Matrix.html#inverse--)()
Matrix inverse or pseudoinverse
boolean
[isSquare](../../../weka/core/matrix/Matrix.html#isSquare--)()
returns whether the matrix is a square matrix or not.
boolean
[isSymmetric](../../../weka/core/matrix/Matrix.html#isSymmetric--)()
Returns true if the matrix is symmetric.
[LUDecomposition](../../../weka/core/matrix/LUDecomposition.html "class in weka.core.matrix")
[lu](../../../weka/core/matrix/Matrix.html#lu--)()
LU Decomposition
static void
[main](../../../weka/core/matrix/Matrix.html#main-java.lang.String:A-)(java.lang.String[] args)
Main method for testing this class.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[minus](../../../weka/core/matrix/Matrix.html#minus-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
C = A - B
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[minusEquals](../../../weka/core/matrix/Matrix.html#minusEquals-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
A = A - B
double
[norm1](../../../weka/core/matrix/Matrix.html#norm1--)()
One norm
double
[norm2](../../../weka/core/matrix/Matrix.html#norm2--)()
Two norm
double
[normF](../../../weka/core/matrix/Matrix.html#normF--)()
Frobenius norm
double
[normInf](../../../weka/core/matrix/Matrix.html#normInf--)()
Infinity norm
static [Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[parseMatlab](../../../weka/core/matrix/Matrix.html#parseMatlab-java.lang.String-)(java.lang.String matlab)
creates a matrix from the given Matlab string.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[plus](../../../weka/core/matrix/Matrix.html#plus-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
C = A + B
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[plusEquals](../../../weka/core/matrix/Matrix.html#plusEquals-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
A = A + B
void
[print](../../../weka/core/matrix/Matrix.html#print-int-int-)(int w, int d)
Print the matrix to stdout.
void
[print](../../../weka/core/matrix/Matrix.html#print-java.text.NumberFormat-int-)(java.text.NumberFormat format, int width)
Print the matrix to stdout.
void
[print](../../../weka/core/matrix/Matrix.html#print-java.io.PrintWriter-int-int-)(java.io.PrintWriter output, int w, int d)
Print the matrix to the output stream.
void
[print](../../../weka/core/matrix/Matrix.html#print-java.io.PrintWriter-java.text.NumberFormat-int-)(java.io.PrintWriter output, java.text.NumberFormat format, int width)
Print the matrix to the output stream.
[QRDecomposition](../../../weka/core/matrix/QRDecomposition.html "class in weka.core.matrix")
[qr](../../../weka/core/matrix/Matrix.html#qr--)()
QR Decomposition
static [Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[random](../../../weka/core/matrix/Matrix.html#random-int-int-)(int m, int n)
Generate matrix with random elements
int
[rank](../../../weka/core/matrix/Matrix.html#rank--)()
Matrix rank
static [Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[read](../../../weka/core/matrix/Matrix.html#read-java.io.BufferedReader-)(java.io.BufferedReader input)
Read a matrix from a stream.
[LinearRegression](../../../weka/core/matrix/LinearRegression.html "class in weka.core.matrix")
[regression](../../../weka/core/matrix/Matrix.html#regression-weka.core.matrix.Matrix-double-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") y, double ridge)
Performs a (ridged) linear regression.
[LinearRegression](../../../weka/core/matrix/LinearRegression.html "class in weka.core.matrix")
[regression](../../../weka/core/matrix/Matrix.html#regression-weka.core.matrix.Matrix-double:A-double-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") y, double[] w, double ridge)
Performs a weighted (ridged) linear regression.
void
[set](../../../weka/core/matrix/Matrix.html#set-int-int-double-)(int i, int j, double s)
Set a single element.
void
[setMatrix](../../../weka/core/matrix/Matrix.html#setMatrix-int:A-int:A-weka.core.matrix.Matrix-)(int[] r, int[] c,[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") X)
Set a submatrix.
void
[setMatrix](../../../weka/core/matrix/Matrix.html#setMatrix-int:A-int-int-weka.core.matrix.Matrix-)(int[] r, int j0, int j1,[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") X)
Set a submatrix.
void
[setMatrix](../../../weka/core/matrix/Matrix.html#setMatrix-int-int-int:A-weka.core.matrix.Matrix-)(int i0, int i1, int[] c,[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") X)
Set a submatrix.
void
[setMatrix](../../../weka/core/matrix/Matrix.html#setMatrix-int-int-int-int-weka.core.matrix.Matrix-)(int i0, int i1, int j0, int j1,[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") X)
Set a submatrix.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[solve](../../../weka/core/matrix/Matrix.html#solve-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
Solve A*X = B
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[solveTranspose](../../../weka/core/matrix/Matrix.html#solveTranspose-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
Solve X*A = B, which is also A'*X' = B'
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[sqrt](../../../weka/core/matrix/Matrix.html#sqrt--)()
returns the square root of the matrix, i.e., X from the equation X*X = A.
Steps in the Calculation (see sqrtm in Matlab):
perform eigenvalue decomposition
[V,D]=eig(A) take the square root of all elements in D (only the ones with positive sign are considered for further computation)
S=sqrt(D) calculate the root
X=V*S/V, which can be also written as X=(V'\(V*S)')'
Note: since this method uses other high-level methods, it generates several instances of matrices.
[SingularValueDecomposition](../../../weka/core/matrix/SingularValueDecomposition.html "class in weka.core.matrix")
[svd](../../../weka/core/matrix/Matrix.html#svd--)()
Singular Value Decomposition
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[times](../../../weka/core/matrix/Matrix.html#times-double-)(double s)
Multiply a matrix by a scalar, C = s*A
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[times](../../../weka/core/matrix/Matrix.html#times-weka.core.matrix.Matrix-)([Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix") B)
Linear algebraic matrix multiplication, A * B
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[timesEquals](../../../weka/core/matrix/Matrix.html#timesEquals-double-)(double s)
Multiply a matrix by a scalar in place, A = s*A
java.lang.String
[toMatlab](../../../weka/core/matrix/Matrix.html#toMatlab--)()
converts the Matrix into a single line Matlab string: matrix is enclosed by parentheses, rows are separated by semicolon and single cells by blanks, e.g., [1 2; 3 4].
java.lang.String
[toString](../../../weka/core/matrix/Matrix.html#toString--)()
Converts a matrix to a string.
double
[trace](../../../weka/core/matrix/Matrix.html#trace--)()
Matrix trace.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[transpose](../../../weka/core/matrix/Matrix.html#transpose--)()
Matrix transpose.
[Matrix](../../../weka/core/matrix/Matrix.html "class in weka.core.matrix")
[uminus](../../../weka/core/matrix/Matrix.html#uminus--)()
Unary minus
void
[write](../../../weka/core/matrix/Matrix.html#write-java.io.Writer-)(java.io.Writer w)
Writes out a matrix.