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

Method equals

JSAT/src/jsat/linear/Matrix.java:790–806  ·  view source on GitHub ↗
(Object obj)

Source from the content-addressed store, hash-verified

788 }
789
790 @Override
791 public boolean equals(Object obj)
792 {
793 if(obj == null || !(obj instanceof Matrix))
794 return false;
795 Matrix that = (Matrix) obj;
796
797 if(this.rows() != that.rows() || this.cols() != that.cols())
798 return false;
799
800 for(int i = 0; i < rows(); i++)
801 for(int j = 0; j < cols(); j++)
802 if(this.get(i, j) != that.get(i, j))
803 return false;
804
805 return true;
806 }
807
808 /**
809 * Performs the same as {@link #equals(java.lang.Object) }, but allows a

Callers 3

testHess_MatrixMethod · 0.95
testCloneMethod · 0.95

Calls 3

rowsMethod · 0.95
colsMethod · 0.95
getMethod · 0.95

Tested by 3

testHess_MatrixMethod · 0.76
testCloneMethod · 0.76