public interface Matrix
extends scala.Serializable
Modifier and Type | Method and Description |
---|---|
double |
apply(int i,
int j)
Gets the (i, j)-th element.
|
breeze.linalg.Matrix<Object> |
asBreeze()
Converts to a breeze matrix.
|
Matrix |
asML()
Convert this matrix to the new mllib-local representation.
|
scala.collection.Iterator<Vector> |
colIter()
Returns an iterator of column vectors.
|
Matrix |
copy()
Get a deep copy of the matrix.
|
void |
foreachActive(scala.Function3<Object,Object,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<Object,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.
|
scala.collection.Iterator<Vector> |
rowIter()
Returns an iterator of row vectors.
|
double[] |
toArray()
Converts to a dense array in column major.
|
String |
toString()
A human readable representation of the matrix
|
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<Object,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()
scala.collection.Iterator<Vector> colIter()
scala.collection.Iterator<Vector> rowIter()
breeze.linalg.Matrix<Object> asBreeze()
double apply(int i, int j)
int index(int i, int j)
void update(int i, int j, double v)
Matrix copy()
Matrix transpose()
Matrix
instance sharing the same underlying data.DenseMatrix multiply(DenseMatrix y)
Matrix
-DenseMatrix
multiplication.y
- (undocumented)DenseVector multiply(DenseVector y)
Matrix
-DenseVector
multiplication. For binary compatibility.y
- (undocumented)DenseVector multiply(Vector y)
Matrix
-Vector
multiplication.y
- (undocumented)String toString()
toString
in class Object
String toString(int maxLines, int maxLineWidth)
Matrix map(scala.Function1<Object,Object> f)
SparseMatrix
.f
- (undocumented)Matrix update(scala.Function1<Object,Object> f)
SparseMatrix
.f
- (undocumented)void foreachActive(scala.Function3<Object,Object,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()
Matrix asML()