public interface DenseMatrix extends Matrix, MatrixMultiplication<DenseMatrix,DenseMatrix>
| Modifier and Type | Method and Description |
|---|---|
DenseMatrix |
aat()
Returns A * A'
|
default DenseMatrix |
add(DenseMatrix b)
In place addition A = A + B
|
default DenseMatrix |
add(DenseMatrix b,
DenseMatrix c)
C = A + B
|
default DenseMatrix |
add(double x)
In place element-wise addition A = A + x
|
default DenseMatrix |
add(double x,
DenseMatrix c)
Element-wise addition C = A + x
|
double |
add(int i,
int j,
double x)
A[i][j] += x
|
default DenseMatrix |
apply(int i,
int j,
int k,
int l)
Returns the submatrix which top left at (i, j) and bottom right at (k, l).
|
DenseMatrix |
ata()
Returns A' * A
|
Cholesky |
cholesky()
Returns the Cholesky decomposition.
|
default Cholesky |
cholesky(boolean inPlace)
Returns the Cholesky decomposition.
|
default double[] |
colMeans()
Returns the mean of each column.
|
default double[] |
colSds()
Returns the standard deviations of each column.
|
default double[] |
colSums()
Returns the sum of each column.
|
DenseMatrix |
copy()
Returns a copy of this matrix.
|
double[] |
data()
Returns the array that backs this matrix (optional operation).
|
default DenseMatrix |
div(DenseMatrix b)
In place element-wise division A = A / B
A = A - B
|
default DenseMatrix |
div(DenseMatrix b,
DenseMatrix c)
C = A / B
|
default DenseMatrix |
div(double x)
In place element-wise division A = A / x
|
default DenseMatrix |
div(double x,
DenseMatrix c)
Element-wise addition C = A / x
|
double |
div(int i,
int j,
double x)
A[i][j] /= x
|
double[] |
eig()
Returns the eigen values in an array of size 2N.
|
default double[] |
eig(boolean inPlace)
Returns the eigen values in an array of size 2N.
|
EVD |
eigen()
Returns the eigen value decomposition.
|
default EVD |
eigen(boolean inPlace)
Returns the eigen value decomposition.
|
void |
fill(double x)
Fill the matrix with a value.
|
default DenseMatrix |
inverse()
Returns the inverse matrix.
|
default DenseMatrix |
inverse(boolean inPlace)
Returns the inverse matrix.
|
default int |
ld()
The LDA (and LDB, LDC, etc.) parameter in BLAS is effectively
the stride of the matrix as it is laid out in linear memory.
|
LU |
lu()
Returns the LU decomposition.
|
default LU |
lu(boolean inPlace)
Returns the LU decomposition.
|
default DenseMatrix |
mul(DenseMatrix b)
In place element-wise multiplication A = A * B
|
default DenseMatrix |
mul(DenseMatrix b,
DenseMatrix c)
C = A * B
|
default DenseMatrix |
mul(double x)
In place element-wise multiplication A = A * x
|
default DenseMatrix |
mul(double x,
DenseMatrix c)
Element-wise addition C = A * x
|
double |
mul(int i,
int j,
double x)
A[i][j] *= x
|
default double |
norm()
L2 matrix norm.
|
default double |
norm1()
L1 matrix norm.
|
default double |
norm2()
L2 matrix norm.
|
default double |
normFro()
Frobenius matrix norm.
|
default double |
normInf()
Infinity matrix norm.
|
QR |
qr()
Returns the QR decomposition.
|
default QR |
qr(boolean inPlace)
Returns the QR decomposition.
|
default DenseMatrix |
replaceNaN(double x)
Replaces NaN's with given value.
|
default double[] |
rowMeans()
Returns the mean of each row.
|
default double[] |
rowSds()
Returns the standard deviations of each row.
|
default double[] |
rowSums()
Returns the sum of each row.
|
default DenseMatrix |
scale()
Centers and scales the columns of matrix.
|
default DenseMatrix |
scale(double[] center,
double[] scale)
Centers and scales the columns of matrix.
|
double |
set(int i,
int j,
double x)
Set the entry value at row i and column j.
|
default DenseMatrix |
sub(DenseMatrix b)
In place subtraction A = A - B
|
default DenseMatrix |
sub(DenseMatrix b,
DenseMatrix c)
C = A - B
|
default DenseMatrix |
sub(double x)
In place element-wise subtraction A = A - x
|
default DenseMatrix |
sub(double x,
DenseMatrix c)
Element-wise addition C = A - x
|
double |
sub(int i,
int j,
double x)
A[i][j] -= x
|
default DenseMatrix |
submat(int i,
int j,
int k,
int l)
Returns the submatrix which top left at (i, j) and bottom right at (k, l).
|
default double |
sum()
Returns the sum of all elements in the matrix.
|
SVD |
svd()
Returns the singular value decomposition.
|
default SVD |
svd(boolean inPlace)
Returns the singular value decomposition.
|
default double[][] |
toArray()
Return the two-dimensional array of matrix.
|
DenseMatrix |
transpose()
Returns the matrix transpose.
|
default double |
update(int i,
int j,
double x)
Set the entry value at row i and column j.
|
default double |
xax(double[] x)
Returns x' * A * x.
|
apply, atx, atxpy, atxpy, ax, axpy, axpy, diag, diag, eigen, eigen, eye, eye, get, isSymmetric, market, ncols, nrows, of, of, of, ones, randn, randn, setSymmetric, svd, svd, toString, toString, trace, zerosabmm, abtmm, atbmm, atbtmmdouble[] data()
default int ld()
void fill(double x)
double set(int i,
int j,
double x)
default double update(int i,
int j,
double x)
default DenseMatrix apply(int i, int j, int k, int l)
i - the beginning row, inclusive.j - the beginning column, inclusive,k - the ending row, exclusive.l - the ending column, exclusive.default DenseMatrix submat(int i, int j, int k, int l)
i - the beginning row, inclusive.j - the beginning column, inclusive,k - the ending row, exclusive.l - the ending column, exclusive.LU lu()
default LU lu(boolean inPlace)
inPlace - if true, this matrix will be used for matrix decomposition.Cholesky cholesky()
java.lang.IllegalArgumentException - if the matrix is not positive definite.default Cholesky cholesky(boolean inPlace)
inPlace - if true, this matrix will be used for matrix decomposition.java.lang.IllegalArgumentException - if the matrix is not positive definite.QR qr()
default QR qr(boolean inPlace)
inPlace - if true, this matrix will be used for matrix decomposition.SVD svd()
default SVD svd(boolean inPlace)
inPlace - if true, this matrix will hold U on output.EVD eigen()
default EVD eigen(boolean inPlace)
inPlace - if true, this matrix will be overwritten U on output.double[] eig()
default double[] eig(boolean inPlace)
inPlace - if true, this matrix will be overwritten U on output.DenseMatrix transpose()
default DenseMatrix scale()
default DenseMatrix scale(double[] center, double[] scale)
center - column center. If null, no centering.scale - column scale. If null, no scaling.default DenseMatrix inverse()
default DenseMatrix inverse(boolean inPlace)
inPlace - if true, this matrix will be used for matrix decomposition.default double norm1()
default double norm2()
default double norm()
default double normInf()
default double normFro()
default double xax(double[] x)
default double[] rowSums()
default double[] rowMeans()
default double[] rowSds()
default double[] colSums()
default double[] colMeans()
default double[] colSds()
DenseMatrix copy()
DenseMatrix ata()
MatrixDenseMatrix aat()
Matrixdouble add(int i,
int j,
double x)
double sub(int i,
int j,
double x)
double mul(int i,
int j,
double x)
double div(int i,
int j,
double x)
default DenseMatrix add(DenseMatrix b, DenseMatrix c)
default DenseMatrix add(DenseMatrix b)
default DenseMatrix sub(DenseMatrix b, DenseMatrix c)
default DenseMatrix sub(DenseMatrix b)
default DenseMatrix mul(DenseMatrix b, DenseMatrix c)
default DenseMatrix mul(DenseMatrix b)
default DenseMatrix div(DenseMatrix b, DenseMatrix c)
default DenseMatrix div(DenseMatrix b)
default DenseMatrix add(double x, DenseMatrix c)
default DenseMatrix add(double x)
default DenseMatrix sub(double x, DenseMatrix c)
default DenseMatrix sub(double x)
default DenseMatrix mul(double x, DenseMatrix c)
default DenseMatrix mul(double x)
default DenseMatrix div(double x, DenseMatrix c)
default DenseMatrix div(double x)
default DenseMatrix replaceNaN(double x)
default double sum()
default double[][] toArray()