code: public static boolean isUpperTriangle(ZMatrixRMaj A , int hessenberg , double tol ) {
          tol *= tol;
          for( int i = hessenberg+1; i < A.numRows; i++ ) {
              int maxCol = Math.min(i-hessenberg, A.numCols);
              for( int j = 0; j < maxCol; j++ ) {
                  int index = (i*A.numCols+j)*2;
  
                  double real = A.data[index];
                  double imag = A.data[index+1];
                  double mag = real*real + imag*imag;
  
                  if( !(mag <= tol) ) {
                      return false;
                  }
              }
          }
          return true;
      }
docs: <p>
  Checks to see if a matrix is upper triangular or Hessenberg. A Hessenberg matrix of degree N
  has the following property:<br>
  <br>
  a<sub>ij</sub> &le; 0 for all i &lt; j+N<br>
  <br>
  A triangular matrix is a Hessenberg matrix of degree 0.
  </p>
  @param A Matrix being tested.  Not modified.
  @param hessenberg The degree of being hessenberg.
  @param tol How close to zero the lower left elements need to be.
  @return If it is an upper triangular/hessenberg matrix or not.