diff options
author | Nakul Jindal <njindal@us.ibm.com> | 2015-10-30 17:12:24 -0700 |
---|---|---|
committer | DB Tsai <dbt@netflix.com> | 2015-10-30 17:12:24 -0700 |
commit | 69b9e4b3c2f929e3df55f5e71875c03bb9712948 (patch) | |
tree | e41d337ca21d9f24737a801f69f680eba904181e /mllib/src/main/scala | |
parent | e8ec2a7b01cc86329a6fbafc3d371bdfd79fc1d6 (diff) | |
download | spark-69b9e4b3c2f929e3df55f5e71875c03bb9712948.tar.gz spark-69b9e4b3c2f929e3df55f5e71875c03bb9712948.tar.bz2 spark-69b9e4b3c2f929e3df55f5e71875c03bb9712948.zip |
[SPARK-11385] [ML] foreachActive made public in MLLib's vector API
Made foreachActive public in MLLib's vector API
Author: Nakul Jindal <njindal@us.ibm.com>
Closes #9362 from nakul02/SPARK-11385_foreach_for_mllib_linalg_vector.
Diffstat (limited to 'mllib/src/main/scala')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala index dcdc614455..bd9badc03c 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala @@ -123,7 +123,8 @@ sealed trait Vector extends Serializable { * the vector with type `Int`, and the second parameter is the corresponding value * with type `Double`. */ - private[spark] def foreachActive(f: (Int, Double) => Unit) + @Since("1.6.0") + def foreachActive(f: (Int, Double) => Unit): Unit /** * Number of active entries. An "active entry" is an element which is explicitly stored, @@ -570,7 +571,8 @@ class DenseVector @Since("1.0.0") ( new DenseVector(values.clone()) } - private[spark] override def foreachActive(f: (Int, Double) => Unit) = { + @Since("1.6.0") + override def foreachActive(f: (Int, Double) => Unit): Unit = { var i = 0 val localValuesSize = values.length val localValues = values @@ -700,7 +702,8 @@ class SparseVector @Since("1.0.0") ( private[spark] override def toBreeze: BV[Double] = new BSV[Double](indices, values, size) - private[spark] override def foreachActive(f: (Int, Double) => Unit) = { + @Since("1.6.0") + override def foreachActive(f: (Int, Double) => Unit): Unit = { var i = 0 val localValuesSize = values.length val localIndices = indices |