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
julia> a =1:21:2
julia>conv(a, a)
3-element Vector{Int64}:144
julia>conv(OffsetArray(a), OffsetArray(a))
3-element OffsetArray(::Vector{Int64}, 2:4) with eltype Int64 with indices 2:4:144
julia> a ==OffsetArray(a)
true
julia>conv(a, a) ==conv(OffsetArray(a), OffsetArray(a))
false
I'm unsure what's the axis logic here, but it'll be good for this to be consistent.
The text was updated successfully, but these errors were encountered:
Yeah, the issue is that convolution is naturally defined with zero-based indexing, i.e.
y[n] = sum(a[n-i] * b[i] for i in ...)
And that's what you get for OffsetArray. But as plain Arrays are one-based, this would always give a leading zero in the result, which would be highly undesirable. So whatever one does, it will always be inconsistent in some way.
Maybe we'd need a keyword argument zero_based or the like to opt into the behavior currently adopted automatically for OffsetArrays? Introducing it would be breaking if not done carefully, though.
I'm unsure what's the axis logic here, but it'll be good for this to be consistent.
The text was updated successfully, but these errors were encountered: