Open
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #477 +/- ##
==========================================
+ Coverage 89.71% 89.83% +0.12%
==========================================
Files 25 27 +2
Lines 3685 3729 +44
==========================================
+ Hits 3306 3350 +44
Misses 379 379 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Isn't this the same thing as |
Member
Author
|
Indeed, I had forgotten that the functionality already exists. This currently doesn't seem to work, though, but perhaps may be made to work: julia> B = brand(4, 4, -1, 2)
4×4 BandedMatrix{Float64} with bandwidths (-1, 2):
⋅ 0.326354 0.155544 ⋅
⋅ ⋅ 0.856614 0.63237
⋅ ⋅ ⋅ 0.483055
⋅ ⋅ ⋅ ⋅
julia> v = view(B, 1:2, 3)
2-element view(::BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}, 1:2, 3) with eltype Float64:
0.1555437647782112
0.8566140453180642
julia> BandedMatrices.bandeddata(v)
ERROR: MethodError: no method matching bandshift(::UnitRange{Int64}, ::Int64)
The function `bandshift` exists, but no method is defined for this combination of argument types.
Closest candidates are:
bandshift(::Any)
@ BandedMatrices ~/Dropbox/JuliaPackages/BandedMatrices.jl/src/banded/BandedMatrix.jl:880
bandshift(::AbstractRange, ::Base.Slice{Base.OneTo{Int64}})
@ BandedMatrices ~/Dropbox/JuliaPackages/BandedMatrices.jl/src/banded/BandedMatrix.jl:878
bandshift(::AbstractRange, ::AbstractRange)
@ BandedMatrices ~/Dropbox/JuliaPackages/BandedMatrices.jl/src/banded/BandedMatrix.jl:876
...
Stacktrace:
[1] bandshift(S::SubArray{Float64, 1, BandedMatrix{Float64, Matrix{…}, Base.OneTo{…}}, Tuple{UnitRange{…}, Int64}, false})
@ BandedMatrices ~/Dropbox/JuliaPackages/BandedMatrices.jl/src/banded/BandedMatrix.jl:880
[2] bandeddata(V::SubArray{Float64, 1, BandedMatrix{Float64, Matrix{…}, Base.OneTo{…}}, Tuple{UnitRange{…}, Int64}, false})
@ BandedMatrices ~/Dropbox/JuliaPackages/BandedMatrices.jl/src/banded/BandedMatrix.jl:917
[3] top-level scope
@ REPL[7]:1
Some type information was truncated. Use `show(err)` to see complete types. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds methods to
dataviewto forward row and column views ofBandedMatricesto the underlying data.Such methods would improve performance when indexing into the
view, especially in loops.