You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a big discussion (https://discourse.julialang.org/t/offsetarrays-inbounds-and-confusion/81295) on discourse about why it is a bad idea to iterate over an AbstractVector, say a, using for i=1:length(a) (because this will fail if a is an OffsetArray). I checked the src file for DataStructures and found this style of code in fenwick.jl.
Update: this issue is also present in: append! for circular buffer and nextreme in heaps.jl,
The text was updated successfully, but these errors were encountered:
As much as I don't think that Fenwick is suitable in DataStructures.jl, part of the mechanism that makes Fenwick Trees fast is to exploit the contiguous small indexing range of 1...N or 0...N depending on the implementation. Hence, this is not really a suitable change for Fenwick Trees.
OK, so then maybe the offending constructor in Fenwick should take a Vector instead of an AbstractVector?
Btw, should I split this issue into three separate issues, one for fenwick, one for circular buffer, and one for heaps? I'm not sure who is maintaining those codes.
There is a big discussion (https://discourse.julialang.org/t/offsetarrays-inbounds-and-confusion/81295) on discourse about why it is a bad idea to iterate over an
AbstractVector
, saya
, usingfor i=1:length(a)
(because this will fail ifa
is an OffsetArray). I checked the src file for DataStructures and found this style of code in fenwick.jl.Update: this issue is also present in:
append!
for circular buffer andnextreme
inheaps.jl
,The text was updated successfully, but these errors were encountered: