aboutsummaryrefslogtreecommitdiff
path: root/mllib-local
diff options
context:
space:
mode:
authorYanbo Liang <ybliang8@gmail.com>2016-09-04 05:38:47 -0700
committerYanbo Liang <ybliang8@gmail.com>2016-09-04 05:38:47 -0700
commit1b001b5203444cc8d5c4887a30e03e8fb298d17d (patch)
treec46d3e52bbba448c2fb84f47e866c56041c7cb14 /mllib-local
parentcdeb97a8cd26e3282cc2a4f126242ed2199f3898 (diff)
downloadspark-1b001b5203444cc8d5c4887a30e03e8fb298d17d.tar.gz
spark-1b001b5203444cc8d5c4887a30e03e8fb298d17d.tar.bz2
spark-1b001b5203444cc8d5c4887a30e03e8fb298d17d.zip
[MINOR][ML][MLLIB] Remove work around for breeze sparse matrix.
## What changes were proposed in this pull request? Since we have updated breeze version to 0.12, we should remove work around for bug of breeze sparse matrix in v0.11. I checked all mllib code and found this is the only work around for breeze 0.11. ## How was this patch tested? Existing tests. Author: Yanbo Liang <ybliang8@gmail.com> Closes #14953 from yanboliang/matrices.
Diffstat (limited to 'mllib-local')
-rw-r--r--mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala10
1 files changed, 1 insertions, 9 deletions
diff --git a/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala b/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala
index 98080bb71a..207f662e33 100644
--- a/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala
+++ b/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala
@@ -846,16 +846,8 @@ object Matrices {
case dm: BDM[Double] =>
new DenseMatrix(dm.rows, dm.cols, dm.data, dm.isTranspose)
case sm: BSM[Double] =>
- // Spark-11507. work around breeze issue 479.
- val mat = if (sm.colPtrs.last != sm.data.length) {
- val matCopy = sm.copy
- matCopy.compact()
- matCopy
- } else {
- sm
- }
// There is no isTranspose flag for sparse matrices in Breeze
- new SparseMatrix(mat.rows, mat.cols, mat.colPtrs, mat.rowIndices, mat.data)
+ new SparseMatrix(sm.rows, sm.cols, sm.colPtrs, sm.rowIndices, sm.data)
case _ =>
throw new UnsupportedOperationException(
s"Do not support conversion from type ${breeze.getClass.getName}.")