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

Method ambiguity for getindex(::AbstractCacheMatrix, ::Band) #325

Closed
DanielVandH opened this issue Jul 2, 2024 · 0 comments · Fixed by #326
Closed

Method ambiguity for getindex(::AbstractCacheMatrix, ::Band) #325

DanielVandH opened this issue Jul 2, 2024 · 0 comments · Fixed by #326

Comments

@DanielVandH
Copy link
Contributor

julia> using LazyArrays, BandedMatrices

julia> A = cache(reshape(1:25,5,5))
5×5 LazyArrays.CachedArray{Int64, 2, Matrix{Int64}, Base.ReshapedArray{Int64, 2, UnitRange{Int64}, Tuple{}}}:
 1   6  11  16  21
 2   7  12  17  22
 3   8  13  18  23
 4   9  14  19  24
 5  10  15  20  25

julia> A[band(0)]
ERROR: MethodError: getindex(::LazyArrays.CachedArray{Int64, 2, Matrix{Int64}, Base.ReshapedArray{Int64, 2, UnitRange{Int64}, Tuple{}}}, ::Band) is ambiguous.

Candidates:
  getindex(A::LazyArrays.AbstractCachedArray, I...)
    @ LazyArrays C:\Users\djv23\.julia\packages\LazyArrays\44w6E\src\cache.jl:90
  getindex(A::AbstractMatrix, b::Band)
    @ BandedMatrices C:\Users\djv23\.julia\packages\BandedMatrices\d4g9c\src\generic\indexing.jl:32

Possible fix, define
  getindex(::LazyArrays.AbstractCachedArray{T, 2} where T, ::Band)

Stacktrace:
 [1] top-level scope
   @ REPL[8]:1
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