Skip to content

Possibly unreachable line in lapack.jl #1201

@ajinkya-k

Description

@ajinkya-k

Is the following line in lapack.jl even reachable?

error("failed to converge eigenvectors:\n$(findall(!iszero, ifail))")

The call to chklapackerror(info[]) on line 4138

chklapackerror(info[])

should throw an error if any of the eigenvectors failed to converge and therefore its unlikely the if block would ever be reached.

can someone suggest a test for this? I tried a bunch of matrices from the MatrixDepot.jl packages but none of them threw any errors when running eigen.

The relevant code for context (comments with <-- mine)

# .... # 
# lapack.jl lines 4138 - 4142
            chklapackerror(info[]) 
            if any(ifail .!= 0) # <-- should be unreachable because of the line above
                # TODO: better error message / type
                error("failed to converge eigenvectors:\n$(findall(!iszero, ifail))") # <-- this line here
            end

# ... # 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions