public class CustomDiagonalMatrixFactory extends MatrixFactory<DiagonalMatrix>
Modifier and Type | Field and Description |
---|---|
static CustomDiagonalMatrixFactory |
INSTANCE
An instance of this class.
|
DEFAULT_DENSE_INSTANCE, DEFAULT_DIAGONAL_INSTANCE, DEFAULT_SPARSE_INSTANCE
Constructor and Description |
---|
CustomDiagonalMatrixFactory() |
Modifier and Type | Method and Description |
---|---|
DiagonalMatrix |
copyMatrix(Matrix m)
Creates a deep copy new Matrix given another, argument is unchanged
|
DiagonalMatrix |
createMatrix(int numRows,
int numColumns)
Creates an empty Matrix of the specified dimensions, all elements
must be all zeros!
|
copyArray, copyColumnVectors, copyColumnVectors, copyRowVectors, copyRowVectors, createDiagonal, createGaussianRandom, createIdentity, createIdentity, createMatrix, createUniformRandom, createUniformRandom, getDefault, getDenseDefault, getDiagonalDefault, getSparseDefault
public static CustomDiagonalMatrixFactory INSTANCE
public final DiagonalMatrix copyMatrix(Matrix m)
copyMatrix
in class MatrixFactory<DiagonalMatrix>
m
- Matrix to copyjava.lang.IllegalArgumentException
- if the input matrix isn't square
(because diagonal matrices must be) or if the input matrix has non-zero
entries on the diagonal.public final DiagonalMatrix createMatrix(int numRows, int numColumns)
createMatrix
in class MatrixFactory<DiagonalMatrix>
numRows
- number of rows in the MatrixnumColumns
- number of columns in the Matrixjava.lang.IllegalArgumentException
- if the input dimensions are not square
(because diagonal matrices must be)