Set IndexStyle to IndexLinear for AbstractFill#196
Open
jishnub wants to merge 1 commit intoJuliaArrays:masterfrom
Open
Set IndexStyle to IndexLinear for AbstractFill#196jishnub wants to merge 1 commit intoJuliaArrays:masterfrom
IndexStyle to IndexLinear for AbstractFill#196jishnub wants to merge 1 commit intoJuliaArrays:masterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #196 +/- ##
=======================================
Coverage 97.87% 97.87%
=======================================
Files 4 4
Lines 660 660
=======================================
Hits 646 646
Misses 14 14 ☔ View full report in Codecov by Sentry. |
Member
|
Btw I take back my justification for julia> a = OffsetArray([1,2,3],-1)
3-element OffsetArray(::Vector{Int64}, 0:2) with eltype Int64 with indices 0:2:
1
2
3
julia> Base.IndexStyle(typeof(a))
IndexLinear()
julia> a[1]
2
julia> a = OffsetArray(randn(3,4),-1,-2)
3×4 OffsetArray(::Matrix{Float64}, 0:2, -1:2) with eltype Float64 with indices 0:2×-1:2:
1.39984 0.983014 0.74824 1.19955
1.32323 0.434697 0.68893 -1.77555
1.41984 -0.503202 -0.704223 -1.04858
julia> Base.IndexStyle(typeof(a))
IndexLinear()
julia> a[1]
1.3998366656381436 |
Member
|
Nevermind, I see the key is julia> a = OffsetArray([1,2,3],-1)
3-element OffsetArray(::Vector{Int64}, 0:2) with eltype Int64 with indices 0:2:
1
2
3
julia> firstindex(a)
0
julia> a = OffsetArray(randn(3,4),-1,-2)
3×4 OffsetArray(::Matrix{Float64}, 0:2, -1:2) with eltype Float64 with indices 0:2×-1:2:
0.817174 -0.3924 0.477989 -1.00355
-1.22104 -0.765553 -0.233384 0.965962
0.231041 -0.445986 0.781096 -0.257998
julia> firstindex(a)
1We should make sure we test this behaviour is correct for offset FillArrays.jl |
Member
Author
|
I've included tests for offset |
Member
|
Can you add |
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.
Closes #195 by setting the default
IndexStyletoIndexLinearfor allAbstractFillEdit: Oddly, this makes certain benchmarks worse, so let's hold off on merging this for a bit