Skip to content

Commit e85e646

Browse files
provide docs for SizedVector and SizedMatrix (#27)
* provide docs for `SizedVector` and `SizedMatrix` These are exported, so they should have some docs. This gives a brief explaination of the alias and refers the user to the docs in `SizedArray`. * Update src/StaticArraysCore.jl Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com> * Update src/StaticArraysCore.jl Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com> --------- Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
1 parent c39daee commit e85e646

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/StaticArraysCore.jl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ require_one_based_indexing(A...) = !Base.has_offset_axes(A...) ||
247247
SizedArray{Tuple{dims...}}(array)
248248
249249
Wraps an `AbstractArray` with a static size, so to take advantage of the (faster)
250-
methods defined by the static array package. The size is checked once upon
250+
methods defined by StaticArrays.jl. The size is checked once upon
251251
construction to determine if the number of elements (`length`) match, but the
252252
array may be reshaped.
253253
@@ -274,8 +274,25 @@ struct SizedArray{S<:Tuple,T,N,M,TData<:AbstractArray{T,M}} <: StaticArray{S,T,N
274274
end
275275
end
276276

277+
278+
"""
279+
SizedVector{S, T} = SizedArray{Tuple{S}, T, 1, 1}
280+
281+
Wraps a one-dimensional `AbstractArray` with static length `S` and element type `T`,
282+
leveraging the performance optimizations of StaticArrays.jl.
283+
284+
For detailed usage and functionality, refer to the documentation of `SizedArray`.
285+
"""
277286
const SizedVector{S,T} = SizedArray{Tuple{S},T,1,1}
278287

288+
"""
289+
SizedMatrix{S1,S2,T} = SizedArray{Tuple{S1,S2},T,2}
290+
291+
Wraps a two-dimensional `AbstractArray` with static dimensions `S1` by `S2` and element type `T`,
292+
leveraging the performance optimizations of StaticArrays.jl.
293+
294+
For detailed usage and functionality, refer to the documentation of `SizedArray`.
295+
"""
279296
const SizedMatrix{S1,S2,T} = SizedArray{Tuple{S1,S2},T,2}
280297

281298
# FieldArray

0 commit comments

Comments
 (0)