public class DiagonalMatrix extends Matrix
Constructor and Description |
---|
DiagonalMatrix(double[][] arr)
Diagonal version of the matrix handed
|
DiagonalMatrix(int rowcol)
New empty matrix with 0s down the diagonals
|
DiagonalMatrix(int rowcol,
double val)
New empty matrix with val down the diagonals
|
DiagonalMatrix(Matrix mat) |
Modifier and Type | Method and Description |
---|---|
int |
columnCount()
Get the number of columns
|
static DiagonalMatrix |
fill(int rowcol,
double d) |
double |
get(int row,
int column) |
double[] |
getVals() |
Vector |
mult(Vector x)
Returns
y = Ax . |
Matrix |
newInstance(int rows,
int cols) |
static DiagonalMatrix |
ones(int rowcol) |
double |
put(int row,
int column,
double value)
Set the value at the given row/column
|
int |
rowCount() |
Vector |
transposeMultiply(Vector x)
Returns
y = (A^T)x . |
Vector |
transposeNonTransposeMultiply(Vector x)
Returns
y = (A^T)Ax . |
int |
used() |
static DiagonalMatrix |
zeros(int rowcol) |
add, asArray, asColumnMajorArray, column, columns, dense, density, elementCount, from, getHistogram, indexOf, isSquare, max, mean, min, newInstance, row, rows, rowwiseMean, sparse, storeSparseOn, storeSparseOn, toString, unwrap
public DiagonalMatrix(int rowcol)
rowcol
- public DiagonalMatrix(int rowcol, double val)
rowcol
- val
- public DiagonalMatrix(double[][] arr)
arr
- public DiagonalMatrix(Matrix mat)
mat
- public Vector transposeMultiply(Vector x)
Matrix
y = (A^T)x
.transposeMultiply
in class Matrix
public Vector transposeNonTransposeMultiply(Vector x)
Matrix
y = (A^T)Ax
.
Useful for doing singular decomposition using ARPACK's dsaupd routine.
transposeNonTransposeMultiply
in class Matrix
public int columnCount()
Matrix
columnCount
in class Matrix
public double get(int row, int column)
public double put(int row, int column, double value)
Matrix
public static DiagonalMatrix zeros(int rowcol)
rowcol
- public static DiagonalMatrix ones(int rowcol)
rowcol
- public static DiagonalMatrix fill(int rowcol, double d)
rowcol
- d
- public double[] getVals()
public Matrix newInstance(int rows, int cols)
newInstance
in class Matrix