def is_lower_triangular_matrix(mat):
    """
    Check that the matrix is lower triangular.
    """
    dimensions = mat.dimensions()
    # Must be a bidimensional matrix.
    if len(dimensions) != 2:
        return False
    # Must be square.
    if dimensions[0] != dimensions[1]:
        return False
    # A 1x1 matrix is lower triangular.
    if dimensions[0] == 1:
        return True
    for rowIndex in xrange(0, dimensions[0]):
        for colIndex in xrange(rowIndex + 1, dimensions[1]):
            if mat[rowIndex, colIndex] != 0:
                print mat.rows()[rowIndex]
                return False
    return True
# End is_lower_triangular_matrix

def is_diagonal_complete_matrix(mat):
    """
    Check that all the element on the diagonal are not 0.
    """
    dimensions = mat.dimensions()
    # Must be a bidimensional matrix.
    if len(dimensions) != 2:
        return False
    # Must be square.
    if dimensions[0] != dimensions[1]:
        return False
    # A 1x1 matrix is diagonal complete if it's single element is not 0.
    if dimensions[0] == 1:
        if mat[0, 0] != 0:
            return True
        else:
            return False
    # End if
    for rowIndex in xrange(0, dimensions[0]):
        if mat[rowIndex, rowIndex] == 0:
            print mat.rows()[rowIndex], rowIndex
            return False
    return True
# End is_diagonal_complete_matrix