MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / equals

Method equals

JSAT/src/jsat/linear/DenseVector.java:437–454  ·  view source on GitHub ↗
(Object obj)

Source from the content-addressed store, hash-verified

435 }
436
437 @Override
438 public boolean equals(Object obj)
439 {
440 if(!(obj instanceof Vec))
441 return false;
442 Vec otherVec = (Vec) obj;
443
444 if(this.length() != otherVec.length())
445 return false;
446 for(int i = startIndex; i < endIndex; i++)
447 if (this.get(i) != otherVec.get(i))
448 if (Double.isNaN(this.get(i)) && Double.isNaN(otherVec.get(i)))//NaN != NaN is always true, so check special
449 return true;
450 else
451 return false;
452
453 return true;
454 }
455
456 @Override
457 public boolean equals(Object obj, double range)

Callers 5

testMultiply_3args_1Method · 0.95
testMultiplyMethod · 0.95

Calls 4

lengthMethod · 0.95
lengthMethod · 0.95
getMethod · 0.95
getMethod · 0.95

Tested by 5

testMultiply_3args_1Method · 0.76
testMultiplyMethod · 0.76