(Object obj)
| 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 |