Repository: spark
Updated Branches:
  refs/heads/branch-1.3 3baa82fda -> da56e64d6


[SPARK-7668] [MLLIB] Preserve isTransposed property for Matrix after calling 
map function

JIRA: https://issues.apache.org/jira/browse/SPARK-7668

Author: Liang-Chi Hsieh <[email protected]>

Closes #6188 from viirya/fix_matrix_map and squashes the following commits:

2a7cc97 [Liang-Chi Hsieh] Preserve isTransposed property for Matrix after 
calling map function.

(cherry picked from commit f96b85ab44b82736363764ea39ee62884007f4a3)
Signed-off-by: Xiangrui Meng <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/da56e64d
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/da56e64d
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/da56e64d

Branch: refs/heads/branch-1.3
Commit: da56e64d6a1dd7377370ff838901d895c6304f52
Parents: 3baa82f
Author: Liang-Chi Hsieh <[email protected]>
Authored: Fri May 15 10:03:29 2015 -0700
Committer: Xiangrui Meng <[email protected]>
Committed: Fri May 15 10:03:56 2015 -0700

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/da56e64d/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 0e4a4d0..d5cd830 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
@@ -175,7 +175,8 @@ class DenseMatrix(
 
   override def copy = new DenseMatrix(numRows, numCols, values.clone())
 
-  private[mllib] def map(f: Double => Double) = new DenseMatrix(numRows, 
numCols, values.map(f))
+  private[mllib] def map(f: Double => Double) = new DenseMatrix(numRows, 
numCols, values.map(f),
+    isTransposed)
 
   private[mllib] def update(f: Double => Double): DenseMatrix = {
     val len = values.length
@@ -434,7 +435,7 @@ class SparseMatrix(
   override def copy = new SparseMatrix(numRows, numCols, colPtrs, rowIndices, 
values.clone())
 
   private[mllib] def map(f: Double => Double) =
-    new SparseMatrix(numRows, numCols, colPtrs, rowIndices, values.map(f))
+    new SparseMatrix(numRows, numCols, colPtrs, rowIndices, values.map(f), 
isTransposed)
 
   private[mllib] def update(f: Double => Double): SparseMatrix = {
     val len = values.length


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to