public final class DenseMatrix extends Matrix
Matrix.ElementVisitorFunction, Matrix.ReadOnlyElementVisitorFunction| Constructor and Description |
|---|
DenseMatrix(int rows,
int cols)
Creates a new matrix of the specified size.
|
DenseMatrix(int rows,
int cols,
double[] values)
Creates a new matrix of the specified size and values.
|
| Modifier and Type | Method and Description |
|---|---|
protected Matrix |
create(int numRows,
int numCols)
Creates a new matrix.
|
protected void |
forEach(Matrix.ElementVisitorFunction func)
Calls the specified function for every non-zero element.
|
protected double |
getAtUnchecked(int row,
int col)
Gets the value at the specified row and column.
|
MatrixNonZeroElementRowIterator |
getNonZeroElementRowIterator(int row)
Gets the non-zero matrix row element iterator for a given row index.
|
double[] |
getRaw()
Gets the underlying, raw array.
|
protected void |
setAtUnchecked(int row,
int col,
double val)
Sets a value at the specified row and column.
|
java.lang.String |
toString() |
abs, absSum, add, addElementWise, equals, forEach, getAt, getColumnCount, getColumnSumVector, getElementCount, getRowCount, getRowSumVector, hashCode, incrementAt, isSameSize, isZeroMatrix, multiply, multiply, multiplyElementWise, normalizeColumns, removeLessThan, removeNegatives, roundTo, scale, setAt, sqrt, sum, transposepublic DenseMatrix(int rows,
int cols)
rows - The desired number of rows.cols - The desired number of columns.public DenseMatrix(int rows,
int cols,
double[] values)
rows - The desired number of rows.cols - The desired number of columns.values - The specified values.public double[] getRaw()
protected final Matrix create(int numRows, int numCols)
Matrixprotected final double getAtUnchecked(int row,
int col)
MatrixgetAtUnchecked in class Matrixrow - The row.col - The column.protected final void setAtUnchecked(int row,
int col,
double val)
MatrixsetAtUnchecked in class Matrixrow - The row.col - The column.val - The value.protected final void forEach(Matrix.ElementVisitorFunction func)
Matrixpublic MatrixNonZeroElementRowIterator getNonZeroElementRowIterator(int row)
MatrixgetNonZeroElementRowIterator in class Matrixrow - The row index.public java.lang.String toString()
toString in class java.lang.Object