I’m trying to compute the condition number for sparse (stiffness) matrices coming from finite element analyses. I’ve included a download link for one such matrix below. Here’s a script that should read the (PETSc) stiffness matrix:
import PETScBinaryIO
K = PETScBinaryIO.readpetsc( "cf_stiffness.dat" )
# 41232×41232 SparseArrays.SparseMatrixCSC{Float64, Int32} with 10362492 stored entries:
I’m trying to use KrylovKit.eigsolve()
to compute min and max eigenvalues (as condition number is the ratio of the two). The documentation for eigsolve
provides the syntax:
eigsolve(f, n::Int, [howmany = 1, which = :LM, T = Float64]; kwargs...)
But if I try the following I get an error: got unsupported keyword arguments "howmany", "which"
julia> e,v = KrylovKit.eigsolve( K, 1, howmany=1, which=:LM )
ERROR: MethodError: no method matching eigselector(::SparseArrays.SparseMatrixCSC{Float64, Int32}, ::Type{Float64}; howmany=1, which=:LM)
Closest candidates are:
eigselector(::AbstractMatrix{T} where T, ::Type; issymmetric, ishermitian, krylovdim, maxiter, tol, orth, eager, verbosity) at /home/gvernon2/.julia/packages/KrylovKit/diNbc/src/eigsolve/eigsolve.jl:237 got unsupported keyword arguments "howmany", "which"
eigselector(::Any, ::Type; issymmetric, ishermitian, krylovdim, maxiter, tol, orth, eager, verbosity) at /home/gvernon2/.julia/packages/KrylovKit/diNbc/src/eigsolve/eigsolve.jl:205 got unsupported keyword arguments "howmany", "which"
Stacktrace:
[1] kwerr(::NamedTuple{(:howmany, :which), Tuple{Int64, Symbol}}, ::Function, ::SparseArrays.SparseMatrixCSC{Float64, Int32}, ::Type)
@ Base ./error.jl:157
[2] eigsolve(f::SparseArrays.SparseMatrixCSC{Float64, Int32}, x₀::Vector{Float64}, howmany::Int64, which::Symbol; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:howmany, :which), Tuple{Int64, Symbol}}})
@ KrylovKit ~/.julia/packages/KrylovKit/diNbc/src/eigsolve/eigsolve.jl:184
[3] eigsolve(A::SparseArrays.SparseMatrixCSC{Float64, Int32}, howmany::Int64, which::Symbol, T::Type; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:howmany, :which), Tuple{Int64, Symbol}}})
@ KrylovKit ~/.julia/packages/KrylovKit/diNbc/src/eigsolve/eigsolve.jl:176
[4] top-level scope
@ REPL[31]:1
I assume I’m misinterpreting the documentation?
Download link for Matrix data (120MB )