JuliaLinearAlgebra / IterativeSolvers.jl

Iterative algorithms for solving linear systems, eigensystems, and singular value problems
MIT License
394 stars 106 forks source link

svdl fails for complex matrices due to type assertion #331

Open juandarias opened 1 year ago

juandarias commented 1 year ago

Setup

Julia 1.8.0 IterativeSolvers 0.9.2

Problem

Cannot factorize complex matrices with svdl.

MWE

using IterativeSolvers

M = rand(ComplexF64, 100, 200);    
svdl(M, nsv = 16, vecs = :both);

Error


ERROR: TypeError: in typeassert, expected LinearAlgebra.SVD{ComplexF64, Float64, Matrix{ComplexF64}, C} where C<:AbstractVector{Float64}, got a value of type LinearAlgebra.SVD{Float64, Float64, Matrix{Float64}, Vector{Float64}}
Stacktrace:
 [1] svdl_method!(log::ConvergenceHistory{false, Nothing}, A::Matrix{ComplexF64}, l::Int64; k::Int64, j::Int64, v0::Vector{ComplexF64}, maxiter::Int64, tol::Float64, reltol::Float64, verbose::Bool, method::Symbol, vecs::Symbol, dolock::Bool)
   @ IterativeSolvers ~/.julia/packages/IterativeSolvers/rhYBz/src/svdl.jl:192
 [2] svdl(A::Matrix{ComplexF64}; nsv::Int64, k::Int64, tol::Float64, maxiter::Int64, method::Symbol, log::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ IterativeSolvers ~/.julia/packages/IterativeSolvers/rhYBz/src/svdl.jl:168
 [3] svdl(A::Matrix{ComplexF64})
   @ IterativeSolvers ~/.julia/packages/IterativeSolvers/rhYBz/src/svdl.jl:157