Github user dbtsai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15628#discussion_r107835326
  
    --- Diff: 
mllib-local/src/test/scala/org/apache/spark/ml/linalg/MatricesSuite.scala ---
    @@ -160,22 +160,395 @@ class MatricesSuite extends SparkMLFunSuite {
         assert(sparseMat.values(2) === 10.0)
       }
     
    -  test("toSparse, toDense") {
    -    val m = 3
    -    val n = 2
    -    val values = Array(1.0, 2.0, 4.0, 5.0)
    -    val allValues = Array(1.0, 2.0, 0.0, 0.0, 4.0, 5.0)
    -    val colPtrs = Array(0, 2, 4)
    -    val rowIndices = Array(0, 1, 1, 2)
    +  test("dense to dense") {
    +    /*
    +      dm1 =  4.0 2.0 -8.0
    +            -1.0 7.0  4.0
    +
    +      dm2 = 5.0 -9.0  4.0
    +            1.0 -3.0 -8.0
    +     */
    +    val dm1 = new DenseMatrix(2, 3, Array(4.0, -1.0, 2.0, 7.0, -8.0, 4.0))
    +    val dm2 = new DenseMatrix(2, 3, Array(5.0, -9.0, 4.0, 1.0, -3.0, 
-8.0), isTransposed = true)
    +
    +    val dm3 = dm1.toDense
    +    assert(dm3 === dm1)
    +    assert(!dm3.isTransposed)
    +    assert(dm3.values.equals(dm1.values))
    --- End diff --
    
    `val dm4 = dm1.toDenseRowMajor` and `val dm7 = dm1.toDenseRowMajor` are the 
same.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to