code: public static boolean isLowerTriangle(DMatrixSparseCSC A , int hessenberg , double tol )
      {
          if( A.numCols != A.numRows )
              return false;
  
          // diagonal elements must be non-zero
          if( A.nz_length < A.numCols-hessenberg )
              return false;
  
          for (int col = 0; col < A.numCols; col++) {
              int idx0 = A.col_idx[col];
              int idx1 = A.col_idx[col+1];
  
              // at least one element in each column
              if( col >= hessenberg ) {
                  if (idx0 == idx1)
                      return false;
  
                  // first element must be (i,i)
                  if (A.nz_rows[idx0] != Math.max(0, col - hessenberg))
                      return false;
              }
  
              // diagonal elements must not be zero
              if( col-hessenberg >= 0 && Math.abs(A.nz_values[idx0]) <= tol )
                  return false;
          }
  
          return true;
      }
docs: <p>
  Checks to see if a matrix is lower 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.  Only the upper most diagonal elements are
  explicitly checked to see if they are non-zero
  </p>
  @param A Matrix being tested.  Not modified.
  @param hessenberg The degree of being hessenberg.
  @param tol How not zero diagonal elements must be.
  @return If it is an upper triangular/hessenberg matrix or not.