Github user brkyvz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4286#discussion_r38369650
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/BlockMatrix.scala
 ---
    @@ -246,4 +246,135 @@ class BlockMatrix(
         val localMat = toLocalMatrix()
         new BDM[Double](localMat.numRows, localMat.numCols, localMat.toArray)
       }
    +
    +  /**
    +   * Forms [[MatrixBlock]]s using `rowsPerBlock` and `colsPerBlock`, which 
were provided in
    +   * the constructor. Even if all [[MatrixBlock]]s (except the ones on the 
right and bottom edge)
    +   * have dimensions `rowsPerBlock`x`colsPerBlock`, a new [[BlockMatrix]] 
will be returned.
    +   */
    +  def repartition(): BlockMatrix = {
    +    repartition(rowsPerBlock, colsPerBlock)
    +  }
    +
    +  /**
    +   * Forms [[MatrixBlock]]s using the provided dimensions 
`newRowsPerBlock`x`newColsPerBlock`
    +   * Even if all [[MatrixBlock]]s (except the ones on the right and bottom 
edge)
    +   * have dimensions `newRowsPerBlock`x`newColsPerBlock`, a new 
[[BlockMatrix]] will be returned.
    +   * The resulting number of partitions may be different than the current 
number of partitions.
    +   *
    +   * @param newRowsPerBlock Number of rows that make up each MatrixBlock.
    +   * @param newColsPerBlock Number of columns that make up each 
MatrixBlock.
    +   * @return The repartitioned BlockMatrix
    +   */
    +  def repartition(newRowsPerBlock: Int, newColsPerBlock: Int): BlockMatrix 
= {
    +    repartition(newRowsPerBlock, newColsPerBlock, blocks.partitions.length)
    +  }
    +
    +  /**
    +   * Forms [[MatrixBlock]]s using the provided dimensions 
`newRowsPerBlock`x`newColsPerBlock`
    +   * Even if all [[MatrixBlock]]s (except the ones on the right and bottom 
edge)
    +   * have dimensions `newRowsPerBlock`x`newColsPerBlock`, a new 
[[BlockMatrix]] will be returned.
    +   * The resulting number of partitions may be different than 
`suggestedNumPartitions`. Assumes
    +   * that the offsets of each block is
    +   * (`blockRowIndex`x`rowsPerBlock`, `blockColIndex`x`colsPerBlock`).
    --- End diff --
    
    I don't think we provide default arguments for Java Compatibility.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to