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

    https://github.com/apache/spark/pull/8565#discussion_r38622953
  
    --- 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 --
    
    Good to double-check that. I think we have to write a `hashCode` that is 
consistent with Breeze's `equals` for now and leave a to-do to change it to 
Breeze's later. Although it sounds brittle, it seems like equality must be 
defined in the obvious way -- equal elements everywhere. The hash code can just 
be a function of the elements since equality must be. It may need to be a 
function of non-zero elements and their positions, in order, in order to be 
efficient for sparse matrices.


---
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