Skip to content

Commit 9bcc5d3

Browse files
committed
add depth for readability
1 parent 7495681 commit 9bcc5d3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class RowMatrix(
109109
seqOp = (U, v) => {
110110
RowMatrix.dspr(1.0, v, U.data)
111111
U
112-
}, combOp = (U1, U2) => U1 += U2, 2)
112+
}, combOp = (U1, U2) => U1 += U2, depth = 2)
113113

114114
RowMatrix.triuToFull(n, GU.data)
115115
}
@@ -293,7 +293,7 @@ class RowMatrix(
293293
seqOp = (s: (Long, BDV[Double]), v: Vector) => (s._1 + 1L, s._2 += v.toBreeze),
294294
combOp = (s1: (Long, BDV[Double]), s2: (Long, BDV[Double])) =>
295295
(s1._1 + s2._1, s1._2 += s2._2),
296-
2)
296+
depth = 2)
297297

298298
updateNumRows(m)
299299

mllib/src/test/scala/org/apache/spark/mllib/rdd/RDDFunctionsSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ class RDDFunctionsSuite extends FunSuite with LocalSparkContext {
5151
val rdd = sc.makeRDD(-1000 until 1000, 10)
5252
def seqOp = (c: Long, x: Int) => c + x
5353
def combOp = (c1: Long, c2: Long) => c1 + c2
54-
for (level <- 1 until 10) {
55-
val sum = rdd.treeAggregate(0L)(seqOp, combOp, level)
54+
for (depth <- 1 until 10) {
55+
val sum = rdd.treeAggregate(0L)(seqOp, combOp, depth)
5656
assert(sum === -1000L)
5757
}
5858
}
5959

6060
test("treeReduce") {
6161
val rdd = sc.makeRDD(-1000 until 1000, 10)
62-
for (level <- 1 until 10) {
63-
val sum = rdd.treeReduce(_ + _, level)
62+
for (depth <- 1 until 10) {
63+
val sum = rdd.treeReduce(_ + _, depth)
6464
assert(sum === -1000)
6565
}
6666
}

0 commit comments

Comments
 (0)