Skip to content

Commit

Permalink
doc: fix usage of NTuple{T} (#29104)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5e4ca86)
  • Loading branch information
stev47 authored and KristofferC committed Feb 11, 2019
1 parent 6e4704d commit 37c9dba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/src/manual/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ ourselves, we can officially define it as a subtype of an [`AbstractArray`](@ref
| `length(A)` | `prod(size(A))` | Number of elements |
| `similar(A)` | `similar(A, eltype(A), size(A))` | Return a mutable array with the same shape and element type |
| `similar(A, ::Type{S})` | `similar(A, S, size(A))` | Return a mutable array with the same shape and the specified element type |
| `similar(A, dims::NTuple{Int})` | `similar(A, eltype(A), dims)` | Return a mutable array with the same element type and size *dims* |
| `similar(A, ::Type{S}, dims::NTuple{Int})` | `Array{S}(undef, dims)` | Return a mutable array with the specified element type and size |
| `similar(A, dims::Dims)` | `similar(A, eltype(A), dims)` | Return a mutable array with the same element type and size *dims* |
| `similar(A, ::Type{S}, dims::Dims)` | `Array{S}(undef, dims)` | Return a mutable array with the specified element type and size |
| **Non-traditional indices** | **Default definition** | **Brief description** |
| `axes(A)` | `map(OneTo, size(A))` | Return the `AbstractUnitRange` of valid indices |
| `Base.similar(A, ::Type{S}, inds::NTuple{Ind})` | `similar(A, S, Base.to_shape(inds))` | Return a mutable array with the specified indices `inds` (see below) |
| `Base.similar(A, ::Type{S}, inds)` | `similar(A, S, Base.to_shape(inds))` | Return a mutable array with the specified indices `inds` (see below) |
| `Base.similar(T::Union{Type,Function}, inds)` | `T(Base.to_shape(inds))` | Return an array similar to `T` with the specified indices `inds` (see below) |

If a type is defined as a subtype of `AbstractArray`, it inherits a very large set of rich behaviors
Expand Down

0 comments on commit 37c9dba

Please sign in to comment.