Alternate constructor for BlockMatrix without the input of the number of rows and columns.
Alternate constructor for BlockMatrix without the input of the number of rows and columns.
The RDD of sub-matrix blocks ((blockRowIndex, blockColIndex), sub-matrix) that form this distributed matrix. If multiple blocks with the same index exist, the results for operations like add and multiply will be unpredictable.
Number of rows that make up each block. The blocks forming the final rows are not required to have the given number of rows
Number of columns that make up each block. The blocks forming the final columns are not required to have the given number of columns
The RDD of sub-matrix blocks ((blockRowIndex, blockColIndex), sub-matrix) that form this distributed matrix. If multiple blocks with the same index exist, the results for operations like add and multiply will be unpredictable.
Number of rows that make up each block. The blocks forming the final rows are not required to have the given number of rows
Number of columns that make up each block. The blocks forming the final columns are not required to have the given number of columns
Number of rows of this matrix. If the supplied value is less than or equal to zero,
the number of rows will be calculated when numRows
is invoked.
Number of columns of this matrix. If the supplied value is less than or equal to
zero, the number of columns will be calculated when numCols
is invoked.
Adds the given block matrix other
to this
block matrix: this + other
.
Adds the given block matrix other
to this
block matrix: this + other
.
The matrices must have the same size and matching rowsPerBlock
and colsPerBlock
values. If one of the blocks that are being added are instances of SparseMatrix,
the resulting sub matrix will also be a SparseMatrix, even if it is being added
to a DenseMatrix. If two dense matrices are added, the output will also be a
DenseMatrix.
The RDD of sub-matrix blocks ((blockRowIndex, blockColIndex), sub-matrix) that form this distributed matrix.
The RDD of sub-matrix blocks ((blockRowIndex, blockColIndex), sub-matrix) that form this distributed matrix. If multiple blocks with the same index exist, the results for operations like add and multiply will be unpredictable.
Caches the underlying RDD.
Caches the underlying RDD.
Number of columns that make up each block.
Number of columns that make up each block. The blocks forming the final columns are not required to have the given number of columns
Left multiplies this BlockMatrix to other
, another BlockMatrix.
Left multiplies this BlockMatrix to other
, another BlockMatrix. The colsPerBlock
of this matrix must equal the rowsPerBlock
of other
. If other
contains
SparseMatrix, they will have to be converted to a DenseMatrix. The output
BlockMatrix will only consist of blocks of DenseMatrix. This may cause
some performance issues until support for multiplying two sparse matrices is added.
Note: The behavior of multiply has changed in 1.6.0. multiply
used to throw an error when
there were blocks with duplicate indices. Now, the blocks with duplicate indices will be added
with each other.
Gets or computes the number of columns.
Gets or computes the number of columns.
Gets or computes the number of rows.
Gets or computes the number of rows.
Persists the underlying RDD with the specified storage level.
Persists the underlying RDD with the specified storage level.
Number of rows that make up each block.
Number of rows that make up each block. The blocks forming the final rows are not required to have the given number of rows
Subtracts the given block matrix other
from this
block matrix: this - other
.
Subtracts the given block matrix other
from this
block matrix: this - other
.
The matrices must have the same size and matching rowsPerBlock
and colsPerBlock
values. If one of the blocks that are being subtracted are instances of SparseMatrix,
the resulting sub matrix will also be a SparseMatrix, even if it is being subtracted
from a DenseMatrix. If two dense matrices are subtracted, the output will also be a
DenseMatrix.
Converts to CoordinateMatrix.
Converts to CoordinateMatrix.
Converts to IndexedRowMatrix.
Converts to IndexedRowMatrix. The number of columns must be within the integer range.
Collect the distributed matrix on the driver as a DenseMatrix
.
Collect the distributed matrix on the driver as a DenseMatrix
.
Transpose this BlockMatrix
.
Transpose this BlockMatrix
. Returns a new BlockMatrix
instance sharing the
same underlying data. Is a lazy operation.
Validates the block matrix info against the matrix data (blocks
) and throws an exception if
any error is found.
Validates the block matrix info against the matrix data (blocks
) and throws an exception if
any error is found.
Represents a distributed matrix in blocks of local matrices.