public static boolean equals(double[][] ma,double[][] mb){
  if (ma.length != mb.length)   return false;
  for (int i=0; i < ma.length; i++) {
    double[] _ma=ma[i];
    double[] _mb=mb[i];
    if (!Arrays.equals(_ma,_mb))     return false;
  }
  return true;
}

public static boolean equals ( double [ ] [ ] ma , double [ ] [ ] mb ) { if ( ma . length != mb . length ) return false ; for ( int i = 0 ; i < ma . length ; i ++ ) { double [ ] _ma = ma [ i ] ; double [ ] _mb = mb [ i ] ; if ( ! Arrays . equals ( _ma , _mb ) ) return false ; } return true ; }
tests two matrices for equality .
