Problem Float32 sparse matrix solver

Hi,
The following code fails (MethodError: no method matching lu!(::SparseMatrixCSC{Float32,Int64}, ::Val{true}; check=true)) with julia 1.0.3.

using SparseArrays
const MyFloat=Float32

n=40
d3=zeros(MyFloat,(n,n))
for i=1:n
    d3[i,i]=MyFloat(-4)
    if i>1 d3[i,i-1]=MyFloat(1) end
    if i<n d3[i,i+1]=MyFloat(1) end
end

sp3=sparse(d3)
b=[MyFloat(i) for i=1:40]
x=zeros(MyFloat,40)
x=sp3\b

Note that it is OK if I use MyFloat=Float64.

Any hints ?

Similar to https://github.com/JuliaLang/julia/issues/25986.

3 Likes

Thanks,
reading the issue comments, there is no clear hint indicating if it will be corrected… The error message could be a bit more explicit: would have save me a little time :wink:

1 Like