public interface Matrix
extends scala.Serializable
Modifier and Type | Method and Description |
---|---|
double |
apply(int i,
int j)
Gets the (i, j)-th element.
|
Matrix |
copy()
Get a deep copy of the matrix.
|
void |
foreachActive(scala.Function3<java.lang.Object,java.lang.Object,java.lang.Object,scala.runtime.BoxedUnit> f)
Applies a function
f to all the active elements of dense and sparse matrix. |
int |
index(int i,
int j)
Return the index for the (i, j)-th element in the backing array.
|
boolean |
isTransposed()
Flag that keeps track whether the matrix is transposed or not.
|
Matrix |
map(scala.Function1<java.lang.Object,java.lang.Object> f)
Map the values of this matrix using a function.
|
DenseMatrix |
multiply(DenseMatrix y)
Convenience method for `Matrix`-`DenseMatrix` multiplication.
|
DenseVector |
multiply(DenseVector y)
Convenience method for `Matrix`-`DenseVector` multiplication.
|
DenseVector |
multiply(Vector y)
Convenience method for `Matrix`-`Vector` multiplication.
|
int |
numActives()
Find the number of values stored explicitly.
|
int |
numCols()
Number of columns.
|
int |
numNonzeros()
Find the number of non-zero active values.
|
int |
numRows()
Number of rows.
|
double[] |
toArray()
Converts to a dense array in column major.
|
breeze.linalg.Matrix<java.lang.Object> |
toBreeze()
Converts to a breeze matrix.
|
java.lang.String |
toString()
A human readable representation of the matrix
|
java.lang.String |
toString(int maxLines,
int maxLineWidth)
A human readable representation of the matrix with maximum lines and width
|
Matrix |
transpose()
Transpose the Matrix.
|
Matrix |
update(scala.Function1<java.lang.Object,java.lang.Object> f)
Update all the values of this matrix using the function f.
|
void |
update(int i,
int j,
double v)
Update element at (i, j)
|
int numRows()
int numCols()
boolean isTransposed()
double[] toArray()
breeze.linalg.Matrix<java.lang.Object> toBreeze()
double apply(int i, int j)
int index(int i, int j)
void update(int i, int j, double v)
Matrix copy()
Matrix transpose()
DenseMatrix multiply(DenseMatrix y)
DenseVector multiply(DenseVector y)
DenseVector multiply(Vector y)
java.lang.String toString()
toString
in class java.lang.Object
java.lang.String toString(int maxLines, int maxLineWidth)
Matrix map(scala.Function1<java.lang.Object,java.lang.Object> f)
f
- (undocumented)SparseMatrix
.Matrix update(scala.Function1<java.lang.Object,java.lang.Object> f)
f
- (undocumented)SparseMatrix
.void foreachActive(scala.Function3<java.lang.Object,java.lang.Object,java.lang.Object,scala.runtime.BoxedUnit> f)
f
to all the active elements of dense and sparse matrix. The ordering
of the elements are not defined.
f
- the function takes three parameters where the first two parameters are the row
and column indices respectively with the type Int
, and the final parameter is the
corresponding value in the matrix with type Double
.int numNonzeros()
int numActives()