Skip to content

Commit fef6d02

Browse files
authored
Merge pull request #28144 from JuliaLang/ksh/docsparse
Added docs for the StridedArrays and fixed a doctest fail
2 parents 25a8c95 + baa5edd commit fef6d02

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

base/docs/basedocs.jl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,4 +1893,39 @@ The syntax `a.b = c` calls `setproperty!(a, :b, c)`.
18931893
"""
18941894
Base.setproperty!
18951895

1896+
"""
1897+
StridedArray{T, N}
1898+
1899+
An `N` dimensional *strided* array with elements of type `T`. These arrays follow
1900+
the [strided array interface](@ref man-interface-strided-arrays). If `A` is a
1901+
`StridedArray`, then its elements are stored in memory with offsets, which may
1902+
vary between dimensions but are constant within a dimension. For example, `A` could
1903+
have stride 2 in dimension 1, and stride 3 in dimension 2. Incrementing `A` along
1904+
dimension `d` jumps in memory by [`strides(A, d)`] slots. Strided arrays are
1905+
particularly important and useful because they can sometimes be passed directly
1906+
as pointers to foreign language libraries like BLAS.
1907+
"""
1908+
StridedArray
1909+
1910+
"""
1911+
StridedVector{T}
1912+
1913+
One dimensional [`StridedArray`](@ref) with elements of type `T`.
1914+
"""
1915+
StridedVector
1916+
1917+
"""
1918+
StridedMatrix{T}
1919+
1920+
Two dimensional [`StridedArray`](@ref) with elements of type `T`.
1921+
"""
1922+
StridedMatrix
1923+
1924+
"""
1925+
StridedVecOrMat{T}
1926+
1927+
Union type of [`StridedVector`](@ref) and [`StridedMatrix`](@ref) with elements of type `T`.
1928+
"""
1929+
StridedVecOrMat
1930+
18961931
end

base/file.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ Stacktrace:
383383
julia> mv("hello.txt", "goodbye.txt", force=true)
384384
"goodbye.txt"
385385
386+
julia> rm("goodbye.txt");
387+
386388
```
387389
"""
388390
function mv(src::AbstractString, dst::AbstractString; force::Bool=false,

doc/src/base/arrays.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Core.DenseArray
2626
Base.DenseVector
2727
Base.DenseMatrix
2828
Base.DenseVecOrMat
29+
Base.StridedArray
30+
Base.StridedVector
31+
Base.StridedMatrix
32+
Base.StridedVecOrMat
2933
Base.getindex(::Type, ::Any...)
3034
Base.zeros
3135
Base.ones

doc/src/manual/arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ provided, the memory layout must correspond in the same way to these strides. `D
835835
very specific example of a strided array where the elements are arranged contiguously, thus it
836836
provides its subtypes with the approporiate definition of `strides`. More concrete examples
837837
can be found within the [interface guide for strided arrays](@ref man-interface-strided-arrays).
838-
`StridedVector` and `StridedMatrix` are convenient aliases for many of the builtin array types that
838+
[`StridedVector`](@ref) and [`StridedMatrix`](@ref) are convenient aliases for many of the builtin array types that
839839
are considered strided arrays, allowing them to dispatch to select specialized implementations that
840840
call highly tuned and optimized BLAS and LAPACK functions using just the pointer and strides.
841841

0 commit comments

Comments
 (0)