Repository: spark Updated Branches: refs/heads/master a052ed425 -> c17161189
[SPARK-5660][MLLIB] Make Matrix apply public This is #4447 with `override`. Closes #4447 Author: Joseph K. Bradley <jos...@databricks.com> Author: Xiangrui Meng <m...@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 Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/c1716118 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c1716118 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c1716118 Branch: refs/heads/master Commit: c17161189d57f2e3a8d3550ea59a68edf487c8b7 Parents: a052ed4 Author: Joseph K. Bradley <jos...@databricks.com> Authored: Sun Feb 8 21:07:36 2015 -0800 Committer: Xiangrui Meng <m...@databricks.com> Committed: Sun Feb 8 21:07:36 2015 -0800 ---------------------------------------------------------------------- .../main/scala/org/apache/spark/mllib/linalg/Matrices.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/c1716118/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala ---------------------------------------------------------------------- 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 84f8ac2..c8a97b8 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) } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org