Skip to content

Commit

Permalink
Document DenseArrays and Dims
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Jul 12, 2018
1 parent bec7827 commit e215eb9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,27 @@ Union type of [`Vector{T}`](@ref) and [`Matrix{T}`](@ref).
"""
const VecOrMat{T} = Union{Vector{T}, Matrix{T}}

"""
DenseVector{T}
One-dimensional dense array with elements of type `T`, often used to represent
a mathematical vector. Alias for `DenseArray{T,1}`. The elements of a dense array
are stored contiguously in memory, with no striding.
"""
const DenseVector{T} = DenseArray{T,1}
"""
DenseMatrix{T}
Two-dimensional dense array with elements of type `T`, often used to represent
a mathematical vector. Alias for `DenseArray{T,2}`. The elements of a dense array
are stored contiguously in memory, with no striding.
"""
const DenseMatrix{T} = DenseArray{T,2}
"""
DenseVecOrMat{T}
Union type of [`DenseVector{T}`](@ref) and [`DenseMatrix{T}`](@ref).
"""
const DenseVecOrMat{T} = Union{DenseVector{T}, DenseMatrix{T}}

## Basic functions ##
Expand Down
6 changes: 6 additions & 0 deletions base/indices.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

"""
Dims{N}
An [`NTuple`](@ref) of `N` [`Int`](@ref)s used to represent the dimensions
of an [`AbstractArray`](@ref).
"""
Dims{N} = NTuple{N,Int}
DimsInteger{N} = NTuple{N,Integer}
Indices{N} = NTuple{N,AbstractUnitRange}
Expand Down

0 comments on commit e215eb9

Please sign in to comment.