Skip to content

Dealing with (near) rank deficiency efficiently? #215

@NicolasL-S

Description

@NicolasL-S

Maybe this issue should be directed towards LinearAlgebra.jl.

Iterative solvers require lots of linear solves Ax=b, but these are often quite useless when A is ill-conditioned. Looking at some packages, I have seen some people handling the problem by checking the condition number doing something like:

if cond(A) < threshold
    solve Ax = b
else
    do something else
end

The problem is that computing cond(A) is often much longer than doing the actual solve. Is there a faster way of doing this? Also, LAPACK will still spend time checking whether A is full-rank. Could this be avoided?

An alternative could be

try
    solve Ax = b
catch
    do something else
end

Here, the problem is that a near rank-deficient A will not error (and we have no control over the tolerance used to assess whether solve Ax = b has failed or not). (also, try catch takes time and should generally be avoided as I've heard).

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