Skip to content

svdl fails for complex matrices due to type assertion #331

@juandarias

Description

@juandarias

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

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