API
Modules
Types and constants
StaticThings.AxesLikeStaticThings.IntegerLikeStaticThings.NoTypeSizeStaticThings.OneToLikeStaticThings.RealLikeStaticThings.SizeLikeStaticThings.StaticAxesLikeStaticThings.StaticOneToStaticThings.StaticOneToLikeStaticThings.StaticSizeLikeStaticThings.StaticUnitRangeStaticThings.StaticUnitRangeLike
Functions and macros
StaticThings.asaxesStaticThings.asnonstaticStaticThings.axes2sizeStaticThings.canonical_axesStaticThings.canonical_indicesStaticThings.canonical_sizeStaticThings.maybestatic_axesStaticThings.maybestatic_eachindexStaticThings.maybestatic_fillStaticThings.maybestatic_firstStaticThings.maybestatic_lastStaticThings.maybestatic_lengthStaticThings.maybestatic_onetoStaticThings.maybestatic_reshapeStaticThings.maybestatic_sizeStaticThings.size2axesStaticThings.size2lengthStaticThings.size_from_typeStaticThings.staticarray_type
Documentation
StaticThings.StaticThings — Module
StaticThingsStaticThings provides tools to help write generic code that works with both static and non-static values and arrays.
StaticThings.AxesLike — Type
AxesLike = Union{Tuple{},Tuple{Vararg{AbstractVector{<:IntegerLike}}}}Something that can represent axes of a collection.
StaticThings.NoTypeSize — Type
StaticThings.NoTypeSize{T}()Returned by size_from_type if the size of values of type T is not fixed or not known.
StaticThings.StaticAxesLike — Type
StaticAxesLike = Tuple{Vararg{Union{StaticArrays.SOneTo,StaticArrays.SUnitRange,Static.SUnitRange}}}Something that can represent axes of a statically sized collection.
StaticThings.StaticOneTo — Type
const StaticOneTo{T} = StaticArrays.SOneTo{T}The StaticThings default type for static one-based unit ranges.
Currently an alias for StaticArrays.SOneTo.
StaticThings.StaticUnitRange — Type
StaticUnitRangeThe StaticThings default type for static unit ranges.
Currently an alias for StaticArrays.SUnitRange, if it exists, otherwise an alias for Static.SUnitRange.
StaticThings.IntegerLike — Type
IntegerLike = Union{Integer,Static.StaticInteger}A static or dynamic integer value.
StaticThings.OneToLike — Type
OneToLike = Union{Base.OneTo,StaticArrays.SOneTo,Static.SOneTo}Alias for unit ranges that start at one.
StaticThings.RealLike — Type
RealLike = Union{Real,Static.StaticInteger}A static or dynamic real value.
StaticThings.SizeLike — Type
SizeLike = Union{Tuple{},Tuple{Vararg{IntegerLike}},StaticArrays.Size}Something that can represent the size of a collection.
StaticThings.StaticOneToLike — Type
StaticOneToLike{N} = Union{StaticArrays.SOneTo{N},Static.SOneTo{N}}A static unit range from one to N.
StaticThings.StaticSizeLike — Type
StaticSizeLike = Union{Tuple{Vararg{StaticInteger}},StaticArrays.Size}Something that can represent the size of a statically sized collection.
The empty size () counts as static: a zero-dimensional size is fully known at compile time.
StaticThings.StaticUnitRangeLike — Type
StaticUnitRangeLike = Union{StaticArrays.SOneTo,StaticArrays.SUnitRange,Static.SUnitRange}A static unit range.
StaticThings.asaxes — Function
asaxes(axs::AxesLike)
asaxes(sz::SizeLike)
asaxes(len::IntegerLike)Converts axes or a size or a length of a collection to axes.
One-based indexing will be used if the indexing offset can't be inferred from the given dimensions.
StaticThings.asnonstatic — Function
asnonstatic(x)Return a non-static equivalent of x.
Defined for numbers, tuples, ranges, sizes and axes.
StaticThings.axes2size — Function
StaticThings.axes2size(x::Tuple)
StaticThings.axes2size(x::StaticArrays.Size)Get the size of a collection-like object from its axes.
StaticThings.canonical_axes — Function
canonical_axes(axs::AxesLike)Return the canonical representation of collection axes.
StaticThings.canonical_indices — Function
canonical_indices(idxs::AbstractVector{<:IntegerLike})Return the canonical representation of a collection axis indices.
StaticThings.canonical_size — Function
canonical_size(sz::SizeLike)Return the canonical representation of a collection size.
StaticThings.maybestatic_axes — Function
maybestatic_axes(x)::AxesLikeReturns the axes of x as a tuple of dynamic or static unit ranges.
StaticThings.maybestatic_eachindex — Function
maybestatic_eachindex(x)Returns the index range of x as a dynamic or static integer range.
StaticThings.maybestatic_fill — Function
maybestatic_fill(x, sz::NTuple{N,<:IntegerLike}) where NCreates an array of size sz filled with x.
The result will typically be either a FillArrays.Fill or a StaticArrays.StaticArray.
StaticThings.maybestatic_first — Function
maybestatic_first(A)Returns the first element of A as a dynamic or static value.
StaticThings.maybestatic_last — Function
maybestatic_last(A)Returns the last element of A as a dynamic or static value.
StaticThings.maybestatic_length — Function
maybestatic_length(x)Returns the length of x as a dynamic or static integer.
StaticThings.maybestatic_oneto — Function
maybestatic_oneto(n::IntegerLike)Creates a range from one to n.
Returns an instance of Base.OneTo or StaticOneTo, depending on the type of n.
StaticThings.maybestatic_reshape — Function
maybestatic_reshape(A, sz)Reshapes array A to sizes sz.
If A is a static array and sz is static, the result is a static array.
StaticThings.maybestatic_size — Function
maybestatic_size(x)::SizeLikeReturns the size of x as a tuple of dynamic or static integers or as a StaticArrays.Size.
StaticThings.size2axes — Function
size2axes(sz::Tuple)
size2axes(sz::StaticArrays.Size)Get one-based indexing axes from a size of a collection-like object.
StaticThings.size2length — Function
size2length(sz::Tuple)
size2length(sz::StaticArrays.Size)Get a length from a size (tuple).
StaticThings.size_from_type — Function
size_from_type(::Type{T})::StaticThings.SizeLikeGet the size (equivalent of StaticThings.maybestatic_size) of values of type T.
Requires values of type T to have a fixed known size, returns StaticThings.NoTypeSize{T}() otherwise.
For array types the size is determined via StaticArrayInterface.known_size.
StaticThings.staticarray_type — Function
staticarray_type(T, sz::StaticArrays.Size)Returns the type of a static array with element type T and size sz.