From 10cf5d32cb71c3649a082e3cbd7027b76ca442c7 Mon Sep 17 00:00:00 2001 From: Xusen Yin Date: Thu, 10 Apr 2014 12:14:15 +0800 Subject: [PATCH] refine some return type --- .../apache/spark/mllib/linalg/distributed/RowMatrix.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala index 14796cf0ed4a8..b7d8fd90fbf8e 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala @@ -43,12 +43,12 @@ private class ColumnStatisticsAggregator(private val n: Int) private val currMean: BDV[Double] = BDV.zeros[Double](n) private val currM2n: BDV[Double] = BDV.zeros[Double](n) - private var totalCnt: Double = 0.0 + private var totalCnt = 0.0 private val nnz: BDV[Double] = BDV.zeros[Double](n) private val currMax: BDV[Double] = BDV.fill(n)(Double.MinValue) private val currMin: BDV[Double] = BDV.fill(n)(Double.MaxValue) - override def mean = { + override def mean: Vector = { val realMean = BDV.zeros[Double](n) var i = 0 while (i < n) { @@ -58,7 +58,7 @@ private class ColumnStatisticsAggregator(private val n: Int) Vectors.fromBreeze(realMean) } - override def variance = { + override def variance: Vector = { val realVariance = BDV.zeros[Double](n) val denominator = totalCnt - 1.0