Condition number of sparse matrix

Hello. Early adopter (v0.4-v0.5) coming back to Julia after wrangling with other languages for too long.

I am trying to compute the condition number of a sparse matrix but cannot find a method overloaded for sparse matrices.

I found a couple of issues that claimed to be closed by

However, I simply cannot find this implementation anywhere. Is it in some module other than LinearAlgebra or SparseArrays?

Edit: I should add that I am currently using Julia version 1.2.0.

Then this might interest you.

I linked that pull request in my original post. I cannot seem to find it anywhere.

Edit: Actually, no Google lied. 1.2.0 is from 2019. So cond for sparse matrices should be in there somewhere.

OK, so the method is in there, but the only norms that you can use are L1 and Linf. Any reason why L2 isn’t there? Maybe the error message could be a bit clearer? The way it is written, I am led to believe that the only way to calculate the condition number is to convert to a dense array.

You can get a decent condition estimate for L1 and LInf with an LU facatorization. The L2 condition number needs the largest and smallest singular values, which is more expensive. Maybe ARPack has something you could use for this.

1 Like