Made Matrix equality comparison deep.

Solution to the issue #719
This commit is contained in:
Egoscio
2019-03-21 14:19:16 -07:00
committed by GitHub
parent 5a934c17c4
commit 067e39dbf5

View File

@ -211,7 +211,12 @@ public class Matrix {
* @return boolean
*/
public boolean equals(Matrix other) {
return this == other;
for (int i = 0; i < this.data.length; i++)
for (int j = 0; j < this.data[0].length; j++)
if (this.data[i][j] != other.data[i][j])
return false;
return true;
}
/**