diff options
author | Joseph K. Bradley <joseph@databricks.com> | 2015-02-08 21:07:36 -0800 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-02-08 21:07:36 -0800 |
commit | c17161189d57f2e3a8d3550ea59a68edf487c8b7 (patch) | |
tree | 394b88fae0b7229becaf88002279b4761d024654 | |
parent | a052ed42501fee3641348337505b6176426653c4 (diff) | |
download | spark-c17161189d57f2e3a8d3550ea59a68edf487c8b7.tar.gz spark-c17161189d57f2e3a8d3550ea59a68edf487c8b7.tar.bz2 spark-c17161189d57f2e3a8d3550ea59a68edf487c8b7.zip |
[SPARK-5660][MLLIB] Make Matrix apply public
This is #4447 with `override`.
Closes #4447
Author: Joseph K. Bradley <joseph@databricks.com>
Author: Xiangrui Meng <meng@databricks.com>
Closes #4462 from mengxr/SPARK-5660 and squashes the following commits:
f82c8d6 [Xiangrui Meng] add override to matrix.apply
91cedde [Joseph K. Bradley] made matrix apply public
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala index 84f8ac2e0d..c8a97b8c53 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala @@ -50,7 +50,7 @@ sealed trait Matrix extends Serializable { private[mllib] def toBreeze: BM[Double] /** Gets the (i, j)-th element. */ - private[mllib] def apply(i: Int, j: Int): Double + def apply(i: Int, j: Int): Double /** Return the index for the (i, j)-th element in the backing array. */ private[mllib] def index(i: Int, j: Int): Int @@ -163,7 +163,7 @@ class DenseMatrix( private[mllib] def apply(i: Int): Double = values(i) - private[mllib] def apply(i: Int, j: Int): Double = values(index(i, j)) + override def apply(i: Int, j: Int): Double = values(index(i, j)) private[mllib] def index(i: Int, j: Int): Int = { if (!isTransposed) i + numRows * j else j + numCols * i @@ -398,7 +398,7 @@ class SparseMatrix( } } - private[mllib] def apply(i: Int, j: Int): Double = { + override def apply(i: Int, j: Int): Double = { val ind = index(i, j) if (ind < 0) 0.0 else values(ind) } |