Class CoordinateMatrix
Object
org.apache.spark.mllib.linalg.distributed.CoordinateMatrix
- All Implemented Interfaces:
- Serializable,- DistributedMatrix
Represents a matrix in coordinate format.
 
param: entries matrix entries param: nRows number of rows. A non-positive value means unknown, and then the number of rows will be determined by the max row index plus one. param: nCols number of columns. A non-positive value means unknown, and then the number of columns will be determined by the max column index plus one.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCoordinateMatrix(RDD<MatrixEntry> entries) Alternative constructor leaving matrix dimensions to be determined automatically.CoordinateMatrix(RDD<MatrixEntry> entries, long nRows, long nCols) 
- 
Method SummaryModifier and TypeMethodDescriptionentries()longnumCols()Gets or computes the number of columns.longnumRows()Gets or computes the number of rows.Converts to BlockMatrix.toBlockMatrix(int rowsPerBlock, int colsPerBlock) Converts to BlockMatrix.Converts to IndexedRowMatrix.Converts to RowMatrix, dropping row indices after grouping by row index.Transposes this CoordinateMatrix.
- 
Constructor Details- 
CoordinateMatrix
- 
CoordinateMatrixAlternative constructor leaving matrix dimensions to be determined automatically.
 
- 
- 
Method Details- 
entries
- 
numColspublic long numCols()Gets or computes the number of columns.- Specified by:
- numColsin interface- DistributedMatrix
 
- 
numRowspublic long numRows()Gets or computes the number of rows.- Specified by:
- numRowsin interface- DistributedMatrix
 
- 
toBlockMatrixConverts to BlockMatrix. Creates blocks ofSparseMatrixwith size 1024 x 1024.- Returns:
- (undocumented)
 
- 
toBlockMatrixConverts to BlockMatrix. Creates blocks ofSparseMatrix.- Parameters:
- rowsPerBlock- The number of rows of each block. The blocks at the bottom edge may have a smaller value. Must be an integer value greater than 0.
- colsPerBlock- The number of columns of each block. The blocks at the right edge may have a smaller value. Must be an integer value greater than 0.
- Returns:
- a BlockMatrix
 
- 
toIndexedRowMatrixConverts to IndexedRowMatrix. The number of columns must be within the integer range.
- 
toRowMatrixConverts to RowMatrix, dropping row indices after grouping by row index. The number of columns must be within the integer range.- Returns:
- (undocumented)
 
- 
transposeTransposes this CoordinateMatrix.
 
-