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

    https://github.com/apache/spark/pull/8565#discussion_r38514784
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala 
---
    @@ -278,7 +278,8 @@ class DenseMatrix @Since("1.3.0") (
       }
     
       override def hashCode: Int = {
    -    com.google.common.base.Objects.hashCode(numRows : Integer, numCols: 
Integer, toArray)
    +    val state = Seq(numRows, numCols, Arrays.hashCode(values), 
isTransposed.hashCode)
    --- End diff --
    
    To verify that, I did  this test
    'val bm1 =  new BSM[Double](values, numRows, numCols, colPtrs, rowIndices)
    val bm2 = new BSM[Double](values, numRows, numCols, colPtrs, rowIndices)
    
        if(bm1 == bm2){
          println("[==] passed")
          if( bm1.hashCode == bm2.hashCode){
            println(" [hashCode] passed")
          }
          else {
            println(" [hashCode] failed")
          }
        }
        else{
          println(" [==] failed")
        }'
    
    Got this output
    [==] passed
     [hashCode] failed
    On further investigation, I noticed , this thirdparty class has implemented 
only 'equals' method, not 'hashCode'
    In that case, shall I change 'toBreeze == m.toBreeze'  comparison in equals?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to