Column-major sparse matrix.
Column-major sparse matrix. The entry values are stored in Compressed Sparse Column (CSC) format. For example, the following matrix
1.0 0.0 4.0 0.0 3.0 5.0 2.0 0.0 6.0
is stored as values: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
,
rowIndices=[0, 2, 1, 0, 1, 2]
, colPointers=[0, 2, 3, 6]
.
number of rows
number of columns
the index corresponding to the start of a new column
the row index of the entry. They must be in strictly increasing order for each column
non-zero matrix entries in column major
number of rows
number of columns
the index corresponding to the start of a new column (if not transposed)
the row index of the entry (if not transposed). They must be in strictly increasing order for each column
nonzero matrix entries in column major (if not transposed)
whether the matrix is transposed. If true, the matrix can be considered
Compressed Sparse Row (CSR) format, where colPtrs
behaves as rowPtrs,
and rowIndices
behave as colIndices, and values
are stored in row major.
Gets the (i, j)-th element.
Gets the (i, j)-th element.
Convert this matrix to the new mllib-local representation.
Convert this matrix to the new mllib-local representation. This does NOT copy the data; it copies references.
Returns an iterator of column vectors.
Returns an iterator of column vectors. This operation could be expensive, depending on the underlying storage.
the index corresponding to the start of a new column (if not transposed)
the index corresponding to the start of a new column (if not transposed)
Get a deep copy of the matrix.
Get a deep copy of the matrix.
whether the matrix is transposed.
whether the matrix is transposed. If true, the matrix can be considered
Compressed Sparse Row (CSR) format, where colPtrs
behaves as rowPtrs,
and rowIndices
behave as colIndices, and values
are stored in row major.
Convenience method for Matrix
-Vector
multiplication.
Convenience method for Matrix
-Vector
multiplication.
Convenience method for Matrix
-DenseVector
multiplication.
Convenience method for Matrix
-DenseVector
multiplication. For binary compatibility.
Convenience method for Matrix
-DenseMatrix
multiplication.
Convenience method for Matrix
-DenseMatrix
multiplication.
Find the number of values stored explicitly.
Find the number of values stored explicitly. These values can be zero as well.
number of columns
number of columns
Find the number of non-zero active values.
Find the number of non-zero active values.
number of rows
number of rows
the row index of the entry (if not transposed).
the row index of the entry (if not transposed). They must be in strictly increasing order for each column
Returns an iterator of row vectors.
Returns an iterator of row vectors. This operation could be expensive, depending on the underlying storage.
Converts to a dense array in column major.
Converts to a dense array in column major.
Generate a DenseMatrix
from the given SparseMatrix
.
Generate a DenseMatrix
from the given SparseMatrix
. The new matrix will have isTransposed
set to false.
A human readable representation of the matrix with maximum lines and width
A human readable representation of the matrix with maximum lines and width
A human readable representation of the matrix
A human readable representation of the matrix
Transpose the Matrix.
Transpose the Matrix. Returns a new Matrix
instance sharing the same underlying data.
nonzero matrix entries in column major (if not transposed)
nonzero matrix entries in column major (if not transposed)
Column-major sparse matrix. The entry values are stored in Compressed Sparse Column (CSC) format. For example, the following matrix
is stored as
values: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
,rowIndices=[0, 2, 1, 0, 1, 2]
,colPointers=[0, 2, 3, 6]
.