code: public static boolean isNegative(ZMatrixD1 a, ZMatrixD1 b, double tol) {
          if( a.numRows != b.numRows || a.numCols != b.numCols )
              throw new IllegalArgumentException("Matrix dimensions must match");
  
          int length = a.getNumElements()*2;
  
          for( int i = 0; i < length; i++ ) {
              if( !(Math.abs(a.data[i]+b.data[i]) <= tol) )
                  return false;
          }
  
          return true;
      }
docs: <p>
  Checks to see if the two matrices are the negative of each other:<br>
  <br>
  a<sub>ij</sub> = -b<sub>ij</sub>
  </p>
  
  @param a First matrix.  Not modified.
  @param b Second matrix.  Not modified.
  @param tol Numerical tolerance.
  @return True if they are the negative of each other within tolerance.