@Override public boolean equals(Object obj){
  if (!(obj instanceof Matrix))   return false;
  return Arrays.equals(vals,((Matrix)obj).vals);
}

@ Override public boolean equals ( Object obj ) { if ( ! ( obj instanceof Matrix ) ) return false ; return Arrays . equals ( vals , ( ( Matrix ) obj ) . vals ) ; }
checks equality of matrices .
