-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Description
Computing qr factorization on SparseMatrixCSC{Float32} causes an error with Julia 1.11:
using SparseArrays, LinearAlgebra
A = sprandn(Float32, 10, 10, 0.5)
qr(Float64.(A)) # works proprely
qr(A) # !!!Message:
ERROR: SparseArrays.CHOLMOD.CHOLMODException("dtype=0 not supported")
Stacktrace:
[1] SparseArrays.CHOLMOD.Dense{Float32}(ptr::Ptr{SparseArrays.LibSuiteSparse.cholmod_dense_struct})
@ SparseArrays.CHOLMOD ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/SparseArrays/src/solvers/cholmod.jl:276
[2] qr(A::SparseMatrixCSC{Float32, Int64}; tol::Float32, ordering::Int32)
@ SparseArrays.SPQR ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/SparseArrays/src/solvers/spqr.jl:209
[3] qr(A::SparseMatrixCSC{Float32, Int64})
@ SparseArrays.SPQR ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/SparseArrays/src/solvers/spqr.jl:195
[4] top-level scope
@ REPL[4]:1
Tested on clean Julia 1.11 setup with juliaup on Ubuntu 22.04, x86_64. Eqivalent setup with Julia 1.10 works for either element type.
It would seem that
SparseArrays.jl/src/solvers/spqr.jl
Line 200 in 1b4933c
| HTau = Ref{Ptr{CHOLMOD.cholmod_dense}}(C_NULL) |
dtype, as unsafe_load(HTau[]).dtype is 0 when run for either type. This is incidentally equal to CHOLMOD_DOUBLE, which allows the computation for Float64.Metadata
Metadata
Assignees
Labels
No labels