Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodError: no method matching mul! with lsqr on julia 1.1 #243

Closed
davidhien opened this issue Apr 1, 2019 · 2 comments
Closed

MethodError: no method matching mul! with lsqr on julia 1.1 #243

davidhien opened this issue Apr 1, 2019 · 2 comments

Comments

@davidhien
Copy link

davidhien commented Apr 1, 2019

After updating to Julia 1.1.0 i get the following error when calling lsqr:

ERROR: MethodError: no method matching mul!(::SparseVector{Float64,Int64}, ::LinearAlgebra.Adjoint{Float64,SparseMatrixCSC{Float64,Int64}}, ::SparseMatrixCSC{Float64,Int64})
Closest candidates are:
  mul!(::AbstractArray, ::Number, ::AbstractArray) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\LinearAlgebra\src\generic.jl:26
  mul!(::AbstractArray, ::AbstractArray, ::Number) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\LinearAlgebra\src\generic.jl:27
  mul!(::AbstractArray{Ty,1}, ::LinearAlgebra.Adjoint{#s623,#s622} where #s622<:SparseMatrixCSC where #s623, ::AbstractSparseArray{Tx,Ti,1} where Ti) where {Tx, Ty} at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\SparseArrays\src\sparsevector.jl:1631
  ...
Stacktrace:
 [1] #lsqr_method!#68(::Int64, ::Float64, ::Float64, ::Float64, ::Int64, ::Bool, ::Function, ::ConvergenceHistory{false,Nothing}, ::SparseVector{Float64,Int64}, ::SparseMatrixCSC{Float64,Int64}, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\david\.julia\packages\IterativeSolvers\QuajJ\src\lsqr.jl:129
 [2] (::getfield(IterativeSolvers, Symbol("#kw##lsqr_method!")))(::NamedTuple{(:maxiter,),Tuple{Int64}}, ::typeof(IterativeSolvers.lsqr_method!), ::ConvergenceHistory{false,Nothing}, ::SparseVector{Float64,Int64}, ::SparseMatrixCSC{Float64,Int64}, ::SparseMatrixCSC{Float64,Int64}) at .\none:0
 [3] #lsqr!#67(::Int64, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::SparseVector{Float64,Int64}, ::SparseMatrixCSC{Float64,Int64}, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\david\.julia\packages\IterativeSolvers\QuajJ\src\lsqr.jl:74
 [4] lsqr! at C:\Users\david\.julia\packages\IterativeSolvers\QuajJ\src\lsqr.jl:70 [inlined]
 [5] #lsqr#66(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::SparseMatrixCSC{Float64,Int64}, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\david\.julia\packages\IterativeSolvers\QuajJ\src\lsqr.jl:8
 [6] lsqr(::SparseMatrixCSC{Float64,Int64}, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\david\.julia\packages\IterativeSolvers\QuajJ\src\lsqr.jl:8
 [7] top-level scope at none:0

This was the output from running

using IterativeSolvers

A = sprand(100, 20, 0.2)
b = sprand(100,1,0.2)

lsqr(A,b)

To me it seems that Julia 1.1.0 does not allow SparseVector to be the type of the first argument in mul!(a,b,c).
Any fix or hint on how to fix this would be appreciated.

@davidhien davidhien changed the title MethodError: no method matching mul! with lsqr! on julia 1.1 MethodError: no method matching mul! with lsqr on julia 1.1 Apr 1, 2019
@dkarrasch
Copy link
Member

It seems to work if you make b dense.

@davidhien
Copy link
Author

Works for me, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants