-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from mbauman/ohpointfive
Support for 0.5
- Loading branch information
Showing
6 changed files
with
67 additions
and
98 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Eventually, we may want to support true Ragged views, but this | ||
# hack allows us to get 95% of the functionality without much work. | ||
# | ||
# Simply avoid checking bounds upon construction. TODO: check the rectangular extents | ||
import Base: sub, slice | ||
if VERSION >= v"0.5.0-dev+2663" | ||
slice(A::AbstractRaggedArray, I::Union{AbstractVector, Real, Colon}...) = SubArray(A, I, map(maximum, index_shape(A, I...))) | ||
sub(A::AbstractRaggedArray, I::Union{AbstractVector, Real, Colon}...) = SubArray(A, I, map(maximum, index_shape(A, Base.keep_leading_scalars(I)...))) | ||
else | ||
sub(A::AbstractRaggedArray, I::Union{AbstractVector, Int, Colon}...) = Base.sub_unsafe(A, I) | ||
slice(A::AbstractRaggedArray, I::Union{AbstractVector, Int, Colon}...) = Base.slice_unsafe(A, I) | ||
#TODO: I really don't like this... but it's needed for SubArrays | ||
import Base: * | ||
*(i::Int, d::RaggedDimension) = i*maximum(d) | ||
end |
This file contains 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