We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fb7d74 commit 2abc86dCopy full SHA for 2abc86d
mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala
@@ -73,10 +73,11 @@ sealed trait Vector extends Serializable {
73
*/
74
override def hashCode(): Int = {
75
// This is a reference implementation. It calls return in foreachActive, which is slow.
76
+ // Subclasses should override it with optimized implementation.
77
var result: Int = 31 + size
78
this.foreachActive { (index, value) =>
79
if (index < 16) {
- // ignore explict 0 for comparison between sparse and dense
80
+ // ignore explicit 0 for comparison between sparse and dense
81
if (value != 0) {
82
result = 31 * result + index
83
val bits = java.lang.Double.doubleToLongBits(value)
0 commit comments