public class DenseMatrix extends AbstractMatrix
DenseMatrix is a matrix implementation suitable for
matrices with primarily non-zero values. The dimensionality of a
dense matrix is set at construction time and immutable afterwards.
Values may be specified at construction time or given default
values; they are mutable and may be reset after construction.
Implementation Note: A dense matrix represents the values with a two-dimensional array of primitive double values.
| Constructor and Description |
|---|
DenseMatrix(double[][] values)
Construct a dense matrix with the specified values.
|
DenseMatrix(int numRows,
int numColumns)
Construct a dense matrix with the specified positive number of
rows and columns.
|
| Modifier and Type | Method and Description |
|---|---|
int |
numColumns()
Returns the number of columns in the matrix.
|
int |
numRows()
Returns the number of rows in the matrix.
|
void |
setValue(int row,
int column,
double value)
Throw an unsupported operation exception.
|
double |
value(int row,
int column)
Returns the value in the matrix at the specified row and
column.
|
columnVector, equals, hashCode, rowVectorpublic DenseMatrix(int numRows,
int numColumns)
0.0.numRows - Number of rows for this matrix.numColumns - Number of columns for this matrix.IllegalArgumentException - If either the number of rows or
columns is not positive.public DenseMatrix(double[][] values)
0.0.
All labels are initialized to null.values - Two-dimensional array of values on which to base
this matrix.IllegalArgumentException - If the either dimension of
the values array is 0.public final int numRows()
MatrixnumRows in interface MatrixnumRows in class AbstractMatrixpublic final int numColumns()
MatrixnumColumns in interface MatrixnumColumns in class AbstractMatrixpublic double value(int row,
int column)
Matrixvalue in interface Matrixvalue in class AbstractMatrixrow - The specified row.column - The specified column.public void setValue(int row,
int column,
double value)
AbstractMatrixsetValue in interface MatrixsetValue in class AbstractMatrixrow - Ignored.column - Ignored.value - Ignored.Copyright © 2016 Alias-i, Inc.. All rights reserved.