Skip to content

Commit 10cf5d3

Browse files
committed
refine some return type
1 parent b064714 commit 10cf5d3

File tree

1 file changed

+3
-3
lines changed
  • mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ private class ColumnStatisticsAggregator(private val n: Int)
4343

4444
private val currMean: BDV[Double] = BDV.zeros[Double](n)
4545
private val currM2n: BDV[Double] = BDV.zeros[Double](n)
46-
private var totalCnt: Double = 0.0
46+
private var totalCnt = 0.0
4747
private val nnz: BDV[Double] = BDV.zeros[Double](n)
4848
private val currMax: BDV[Double] = BDV.fill(n)(Double.MinValue)
4949
private val currMin: BDV[Double] = BDV.fill(n)(Double.MaxValue)
5050

51-
override def mean = {
51+
override def mean: Vector = {
5252
val realMean = BDV.zeros[Double](n)
5353
var i = 0
5454
while (i < n) {
@@ -58,7 +58,7 @@ private class ColumnStatisticsAggregator(private val n: Int)
5858
Vectors.fromBreeze(realMean)
5959
}
6060

61-
override def variance = {
61+
override def variance: Vector = {
6262
val realVariance = BDV.zeros[Double](n)
6363

6464
val denominator = totalCnt - 1.0

0 commit comments

Comments
 (0)