You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using LinearAlgebra, SparseArrays
julia> A =cholesky(sparse(Matrix(I,10,10))); # sparse cholesky factorization with real elements
julia> z =rand(ComplexF64, 10); # complex RHS vector
julia> A\@views(z[:])
ERROR: InexactError:Float64(0.868342583034311+0.07242770884885896im)
Stacktrace:
[1] Type at ./complex.jl:37 [inlined]
[2] convert at ./number.jl:7 [inlined]
[3] unsafe_store! at ./pointer.jl:118 [inlined]
[4] SuiteSparse.CHOLMOD.Dense{Float64}(::SubArray{Complex{Float64},1,Array{Complex{Float64},1},Tuple{Base.Slice{Base.OneTo{Int64}}},true}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/SuiteSparse/src/cholmod.jl:802
[5] \(::SuiteSparse.CHOLMOD.Factor{Float64}, ::SubArray{Complex{Float64},1,Array{Complex{Float64},1},Tuple{Base.Slice{Base.OneTo{Int64}}},true}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/SuiteSparse/src/cholmod.jl:1682
[6] top-level scope at none:0
while the same operation works without the view:
julia>isapprox(A\z, z)
true
I've chased the issue down to being a simple missing definition in SuiteSparse, where we have the following (in cholmod.jl):
(\)(L::Factor{T}, B::Vector{Complex{T}}) where {T<:Float64} = complex.(L\real(B), L\imag(B))
(\)(L::Factor{T}, B::Matrix{Complex{T}}) where {T<:Float64} = complex.(L\real(B), L\imag(B))
(\)(L::Factor{T}, b::StridedVector) where {T<:VTypes} = Vector(L\Dense{T}(b))
(\)(L::Factor{T}, B::StridedMatrix) where {T<:VTypes} = Matrix(L\Dense{T}(B))
So, the analogous definitions for complex StridedVectors and StridedMatrixs are missing. I can submit the PR to base myself, but I wanted to open an issue first in case there is a reason they aren't defined.
The text was updated successfully, but these errors were encountered:
The following errors for
cholesky
factorizations:while the same operation works without the view:
I've chased the issue down to being a simple missing definition in
SuiteSparse
, where we have the following (incholmod.jl
):So, the analogous definitions for complex
StridedVector
s andStridedMatrix
s are missing. I can submit the PR to base myself, but I wanted to open an issue first in case there is a reason they aren't defined.The text was updated successfully, but these errors were encountered: