public static boolean isLowerTriangle(DMatrixRMaj A , int hessenberg , double tol ) {
        for( int i = 0; i < A.numRows-hessenberg-1; i++ ) {
            for( int j = i+hessenberg+1; j < A.numCols; j++ ) {
                if( !(Math.abs(A.unsafe_get(i,j)) <= tol) ) {
                    return false;
                }
            }
        }
        return true;
    }
public static boolean isLowerTriangle ( DMatrixRMaj A , int hessenberg , double tol ) { for ( int i = 0 ; i < A . numRows - hessenberg - 1 ; i ++ ) { for ( int j = i + hessenberg + 1 ; j < A . numCols ; j ++ ) { if ( ! ( Math . abs ( A . unsafe_get ( i , j ) ) <= tol ) ) { return false ; } } } return true ; }
<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.
</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.