Skip to content

Commit

Permalink
Make tables on Interfaces manual page more consistent (#29703)
Browse files Browse the repository at this point in the history
(cherry picked from commit be4b5c9)
  • Loading branch information
oxinabox authored and KristofferC committed Nov 2, 2018
1 parent 307f920 commit 8ace044
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 @@ -235,8 +235,8 @@ ourselves, we can officially define it as a subtype of an [`AbstractArray`](@ref
| `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)` | `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) |
| `similar(A, ::Type{S}, inds)` | `similar(A, S, Base.to_shape(inds))` | Return a mutable array with the specified indices `inds` (see below) |
| `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
including iteration and multidimensional indexing built on top of single-element access. See
Expand Down Expand Up @@ -406,7 +406,7 @@ perhaps range-types `Ind` of your own design. For more information, see
| Methods to implement |   | Brief description |
|:----------------------------------------------- |:-------------------------------------- |:------------------------------------------------------------------------------------- |
| `strides(A)` |   | Return the distance in memory (in number of elements) between adjacent elements in each dimension as a tuple. If `A` is an `AbstractArray{T,0}`, this should return an empty tuple. |
| `Base.unsafe_convert(::Type{Ptr{T}}, A)` |   | Return the native address of an array. |
| `Base.unsafe_convert(::Type{Ptr{T}}, A)` |   | Return the native address of an array. |
| **Optional methods** | **Default definition** | **Brief description** |
| `stride(A, i::Int)` |   `strides(A)[i]` | Return the distance in memory (in number of elements) between adjacent elements in dimension k. |

Expand Down

0 comments on commit 8ace044

Please sign in to comment.