code: public static boolean isEquals(DMatrix a, DMatrix b ) {
          if( a.getNumRows() != b.getNumRows() || a.getNumCols() != b.getNumCols() )
              return false;
  
          final int numRows = a.getNumRows();
          final int numCols = a.getNumCols();
  
          for (int row = 0; row < numRows; row++) {
              for (int col = 0; col < numCols; col++) {
                  if( !(a.unsafe_get(row,col) == b.unsafe_get(row,col)))
                      return false;
              }
          }
          return true;
      }
docs: <p>
  Checks to see if each element in the two matrices are equal:
  a<sub>ij</sub> == b<sub>ij</sub>
  <p>
  
  <p>
  NOTE: If any of the elements are NaN then false is returned.  If two corresponding
  elements are both positive or negative infinity then they are equal.
  </p>
  
  @param a A matrix. Not modified.
  @param b A matrix. Not modified.
  @return true if identical and false otherwise.