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

ReshapedArrays support #770

Open
gdalle opened this issue Aug 9, 2023 · 0 comments · May be fixed by #771
Open

ReshapedArrays support #770

gdalle opened this issue Aug 9, 2023 · 0 comments · May be fixed by #771

Comments

@gdalle
Copy link

gdalle commented Aug 9, 2023

You're gonna love me, this one is in Base so it's an easy fix

julia> using Krylov, SparseArrays

julia> A = rand(4, 4);

julia> b = reshape(sparse(rand(2, 2)), 4);

julia> A \ b
4-element Vector{Float64}:
  1.2848205878872323
  1.3981946106958438
 -1.5218841143490067
 -0.7467704138939663

julia> gmres(A, b)
ERROR: MethodError: no method matching Base.ReshapedArray{Float64, 1, SparseMatrixCSC{Float64, Int64}, Tuple{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64}}}(::UndefInitializer, ::Int64)

Closest candidates are:
  (::Type{Base.ReshapedArray{T, N, P, MI}} where {T, N, P<:AbstractArray, MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64}}}})(::Any, ::Any, ::Any)
   @ Base reshapedarray.jl:6

Stacktrace:
 [1] GmresSolver(m::Int64, n::Int64, memory::Int64, S::Type{Base.ReshapedArray{Float64, 1, SparseMatrixCSC{Float64, Int64}, Tuple{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64}}}})
   @ Krylov ~/Work/GitHub/Julia/Krylov.jl/src/krylov_solvers.jl:1549
 [2] GmresSolver(A::Matrix{Float64}, b::Base.ReshapedArray{Float64, 1, SparseMatrixCSC{Float64, Int64}, Tuple{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64}}}, memory::Int64)
   @ Krylov ~/Work/GitHub/Julia/Krylov.jl/src/krylov_solvers.jl:1567
 [3] gmres(A::Matrix{Float64}, b::Base.ReshapedArray{Float64, 1, SparseMatrixCSC{Float64, Int64}, Tuple{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64}}}; memory::Int64, M::LinearAlgebra.UniformScaling{Bool}, N::LinearAlgebra.UniformScaling{Bool}, ldiv::Bool, restart::Bool, reorthogonalization::Bool, atol::Float64, rtol::Float64, itmax::Int64, timemax::Float64, verbose::Int64, history::Bool, callback::Krylov.var"#164#171", iostream::Core.CoreSTDOUT)
   @ Krylov ~/Work/GitHub/Julia/Krylov.jl/src/gmres.jl:121
 [4] gmres(A::Matrix{Float64}, b::Base.ReshapedArray{Float64, 1, SparseMatrixCSC{Float64, Int64}, Tuple{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64}}})
   @ Krylov ~/Work/GitHub/Julia/Krylov.jl/src/gmres.jl:119
 [5] top-level scope
   @ REPL[6]:1
@gdalle gdalle linked a pull request Aug 9, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant