Skip to content
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

[DOC] Fix small typo in subarray docs #23298

Merged
merged 4 commits into from
Aug 23, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/src/devdocs/subarrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ a `Tuple` of the types of the indices for each dimension. The final one, `L`, is
as a convenience for dispatch; it's a boolean that represents whether the index types support
fast linear indexing. More on that later.

If in our example above `A` is a `Array{Float64, 3}`, our `S1` case above would be a `SubArray{Int64,2,Array{Int64,3},Tuple{Colon,Int64,UnitRange{Int64}},false}`.
If in our example above `A` is a `Array{Float64, 3}`, our `S1` case above would be a `SubArray{Float64,2,Array{Float64,3},Tuple{Colon,Int64,UnitRange{Int64}},false}`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like Colon has changed to Base.OneTo{Int64} also.

julia> A = rand(10,10,10);

julia> S1 = view(A, :, 5, 2:6);

julia> typeof(S1)
SubArray{Float64,2,Array{Float64,3},Tuple{Base.Slice{Base.OneTo{Int64}},Int64,UnitRange{Int64}},false}

And on line 80 below (if you feel like updating it):

julia> S1.indexes
(Base.Slice(Base.OneTo(10)), 5, 2:6)

This is why doctests are important :)

Note in particular the tuple parameter, which stores the types of the indices used to create
`S1`. Likewise,

Expand Down