Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/5697#discussion_r29111498
--- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala
---
@@ -63,20 +63,27 @@ sealed trait Vector extends Serializable {
Vectors.equals(0 until d1.size, d1.values, s1.indices,
s1.values)
case (_, _) => util.Arrays.equals(this.toArray, v2.toArray)
}
- }
case _ => false
}
}
+ /**
+ * Returns a hash code value for the vector. The hash code is based on
its size and its nonzeros
+ * in the first 16 entries, using a hash algorithm similar to
[[java.util.Arrays.hashCode]].
+ */
override def hashCode(): Int = {
--- End diff --
This is just a reference implementation for subclasses to optimize.
---
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]