-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support arbitrarily offset tiling #25
Comments
Could you clarify what's the expected results with offset? Currently, there are two strategies after #23: julia> A = rand(8);
julia> TileIterator(axes(A), RelaxLastTile((3, )))
3-element TileIterator{1,Tuple{TiledIteration.CoveredRange{StepRange{Int64,Int64},TiledIteration.LengthAtMost}}}:
(1:3,)
(4:6,)
(7:8,)
julia> TileIterator(axes(A), RelaxStride((3, )))
3-element TileIterator{1,Tuple{TiledIteration.CoveredRange{TiledIteration.RoundedRange{LinRange{Float64}},TiledIteration.FixedLength}}}:
(1:3,)
(3:5,)
(6:8,) |
Ah yes, the idea is to return (1:1,) # offset of 1
(2:4,)
(5:7,)
(8:8,) For my purposes I’d only be interested in relaxing the last tile, but in principle this offset is independent of which if the two other strategies are used. |
Yes, the following almost gives the expected result. julia> A = rand(8);
julia> offset = 1
1
julia> R1 = TileIterator(map(r->r[begin:begin+1-offset], axes(A)), (3, ))
1-element TileIterator{1,Tuple{TiledIteration.CoveredRange{StepRange{Int64,Int64},TiledIteration.LengthAtMost}}}:
(1:1,)
julia> R2 = TileIterator(map(r->r[begin+offset:end], axes(A)), (3, ))
3-element TileIterator{1,Tuple{TiledIteration.CoveredRange{StepRange{Int64,Int64},TiledIteration.LengthAtMost}}}:
(2:4,)
(5:7,)
(8:8,) But the logic seems a little bit more complicated for higher-dimensional cases; I guess recursion is needed. Also, it's not very clear to me where is the best place to add this functionality while still keep tiles lazily calculated. |
Currently only the last tile can be relaxed. What about adding a strategy
RelaxEdgeTile
, that allows offsetting the tile grid by an arbitrary offset?The text was updated successfully, but these errors were encountered: