Skip to content

Commit 83dfe37

Browse files
committed
[SPARK-4409] Scalastyle error fixed
1 parent a14c0da commit 83dfe37

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,12 @@ object SparseMatrix {
352352

353353
/** Generates a SparseMatrix given an Array[Double] of size numRows * numCols. The number of
354354
* non-zeros in `raw` is provided for efficiency. */
355-
private def genRand(numRows: Int, numCols: Int, raw: Array[Double], nonZero: Int): SparseMatrix = {
355+
private def genRand(
356+
numRows: Int,
357+
numCols: Int,
358+
raw: Array[Double],
359+
nonZero: Int): SparseMatrix = {
356360
val sparseA: ArrayBuffer[Double] = new ArrayBuffer(nonZero)
357-
358361
val sCols: ArrayBuffer[Int] = new ArrayBuffer(numCols + 1)
359362
val sRows: ArrayBuffer[Int] = new ArrayBuffer(nonZero)
360363

@@ -393,7 +396,6 @@ object SparseMatrix {
393396
numCols: Int,
394397
density: Double,
395398
seed: Long): SparseMatrix = {
396-
397399
require(density > 0.0 && density < 1.0, "density must be a double in the range " +
398400
s"0.0 < d < 1.0. Currently, density: $density")
399401
val rand = new XORShiftRandom(seed)
@@ -434,7 +436,6 @@ object SparseMatrix {
434436
numCols: Int,
435437
density: Double,
436438
seed: Long): SparseMatrix = {
437-
438439
require(density > 0.0 && density < 1.0, "density must be a double in the range " +
439440
s"0.0 < d < 1.0. Currently, density: $density")
440441
val rand = new XORShiftRandom(seed)
@@ -465,8 +466,8 @@ object SparseMatrix {
465466
/**
466467
* Generate a diagonal matrix in `DenseMatrix` format from the supplied values.
467468
* @param vector a `Vector` that will form the values on the diagonal of the matrix
468-
* @return Square `SparseMatrix` with size `values.length` x `values.length` and non-zero `values`
469-
* on the diagonal
469+
* @return Square `SparseMatrix` with size `values.length` x `values.length` and non-zero
470+
* `values` on the diagonal
470471
*/
471472
def diag(vector: Vector): SparseMatrix = {
472473
val n = vector.size

0 commit comments

Comments
 (0)