@TypeInfo(value=DenseMatrixTypeInfoFactory.class) public class DenseMatrix extends Object implements Matrix
Modifier and Type | Field and Description |
---|---|
double[] |
values
Array for internal storage of elements.
|
Constructor and Description |
---|
DenseMatrix(int numRows,
int numCols)
Constructs an m-by-n matrix of zeros.
|
DenseMatrix(int numRows,
int numCols,
double[] values)
Constructs a matrix from a 1-D array.
|
Modifier and Type | Method and Description |
---|---|
double |
get(int i,
int j)
Gets value of the (i,j) element.
|
int |
numCols()
Gets number of columns.
|
int |
numRows()
Gets number of rows.
|
public final double[] values
The matrix data is stored in column major format internally.
public DenseMatrix(int numRows, int numCols)
numRows
- Number of rows.numCols
- Number of columns.public DenseMatrix(int numRows, int numCols, double[] values)
numRows
- Number of rows.numCols
- Number of cols.values
- One-dimensional array of doubles.Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.