public class DenseMatrix extends Object implements Matrix
1.0 2.0
3.0 4.0
5.0 6.0
is stored as [1.0, 3.0, 5.0, 2.0, 4.0, 6.0].
| Constructor and Description |
|---|
DenseMatrix(int numRows,
int numCols,
double[] values) |
| Modifier and Type | Method and Description |
|---|---|
double |
apply(int i) |
double |
apply(int i,
int j)
Gets the (i, j)-th element.
|
DenseMatrix |
copy()
Get a deep copy of the matrix.
|
boolean |
equals(Object o) |
int |
index(int i,
int j)
Return the index for the (i, j)-th element in the backing array.
|
int |
numCols()
Number of columns.
|
int |
numRows()
Number of rows.
|
double[] |
toArray()
Converts to a dense array in column major.
|
breeze.linalg.Matrix<Object> |
toBreeze()
Converts to a breeze matrix.
|
void |
update(int i,
int j,
double v)
Update element at (i, j)
|
double[] |
values() |
getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmultiply, multiply, toString, transposeMultiply, transposeMultiplypublic int numRows()
Matrixpublic int numCols()
Matrixpublic double[] values()
public double[] toArray()
Matrixpublic boolean equals(Object o)
equals in class Objectpublic breeze.linalg.Matrix<Object> toBreeze()
Matrixpublic double apply(int i)
public double apply(int i,
int j)
Matrixpublic int index(int i,
int j)
Matrixpublic void update(int i,
int j,
double v)
Matrixpublic DenseMatrix copy()
Matrix