Reference
Index
FixedSizeArrays.BoundsErrorLight
FixedSizeArrays.FixedSizeArray
FixedSizeArrays.FixedSizeArrayDefault
FixedSizeArrays.FixedSizeMatrix
FixedSizeArrays.FixedSizeMatrixDefault
FixedSizeArrays.FixedSizeVector
FixedSizeArrays.FixedSizeVectorDefault
Base.parent
FixedSizeArrays.collect_as
FixedSizeArrays.collect_as_fsv
FixedSizeArrays.push!!
FixedSizeArrays.with_stripped_type_parameters
FixedSizeArrays.with_stripped_type_parameters_unchecked
Public API
FixedSizeArrays.FixedSizeArray
— TypeFixedSizeArray{T,N,Mem<:DenseVector{T}}(undef, size::NTuple{N,Int})
FixedSizeArray{T,N,Mem<:DenseVector{T}}(undef, size1::Int, size2::Int, ...)
FixedSizeArray{T,N,Mem<:DenseVector{T}}(array::AbstractArray)
Construct a fixed-size FixedSizeArray
with element type T
, number of dimensions N
, and memory backend Mem
.
Convenient aliases provided:
FixedSizeVector{T,Mem}
: for 1-dimensional fixed-size arraysFixedSizeMatrix{T,Mem}
: for 2-dimensional fixed-size arraysFixedSizeArrayDefault{T,N}
: forN
-dimensional fixed-size arrays, with default memory backendFixedSizeVectorDefault{T}
: for 1-dimensional fixed-size arrays, with default memory backendFixedSizeMatrixDefault{T}
: for 2-dimensional fixed-size arrays, with default memory backend
FixedSizeArrays.FixedSizeVector
— TypeFixedSizeVector{T,Mem<:DenseVector{T}}(undef, size::NTuple{1,Int})
FixedSizeVector{T,Mem<:DenseVector{T}}(undef, size1::Int)
FixedSizeVector{T,Mem<:DenseVector{T}}(array::AbstractVector)
Construct a fixed-size 1-dimensional FixedSizeArray
with element type T
, and memory backend Mem
.
Convenient aliases provided:
FixedSizeVectorDefault{T}
: for 1-dimensional fixed-size arrays, with default memory backend
FixedSizeArrays.FixedSizeMatrix
— TypeFixedSizeMatrix{T,Mem<:DenseMatrix{T}}(undef, size::NTuple{2,Int})
FixedSizeMatrix{T,Mem<:DenseMatrix{T}}(undef, size1::Int, size2::Int)
FixedSizeMatrix{T,Mem<:DenseMatrix{T}}(array::AbstractMatrix)
Construct a fixed-size 2-dimensional FixedSizeArray
with element type T
, and memory backend Mem
.
Convenient aliases provided:
FixedSizeMatrixDefault{T}
: for 2-dimensional fixed-size arrays, with default memory backend
FixedSizeArrays.FixedSizeArrayDefault
— TypeFixedSizeArrayDefault{T,N}(undef, size::NTuple{N,Int})
FixedSizeArrayDefault{T,N}(undef, size1::Int, size2::Int, ...)
FixedSizeArrayDefault{T,N}(array::AbstractArray)
Construct a FixedSizeArray
with element type T
, number of dimensions N
, and the default memory backend (Vector{T}
on Julia v1.10, Memory{T}
on Julia v1.11+).
FixedSizeArrays.FixedSizeVectorDefault
— TypeFixedSizeVectorDefault{T}(undef, size::NTuple{1,Int})
FixedSizeVectorDefault{T}(undef, size1::Int)
FixedSizeVectorDefault{T}(array::AbstractVector)
Construct a FixedSizeVector
with element type T
, and the default memory backend (Vector{T}
on Julia v1.10, Memory{T}
on Julia v1.11+).
FixedSizeArrays.FixedSizeMatrixDefault
— TypeFixedSizeMatrixDefault{T}(undef, size::NTuple{2,Int})
FixedSizeMatrixDefault{T}(undef, size1::Int, size2::Int)
FixedSizeMatrixDefault{T}(array::AbstractMatrix)
Construct a FixedSizeMatrix
with element type T
, and the default memory backend (Vector{T}
on Julia v1.10, Memory{T}
on Julia v1.11+).
FixedSizeArrays.collect_as
— Functioncollect_as(t::Type{<:FixedSizeArray}, iterator)
Tries to construct a value of type t
from the iterator iterator
. The type t
must either be concrete, or a UnionAll
without constraints.
Base.parent
— Functionparent(f::FixedSizeArray)
Return the underlying parent object of the fixed-size array f
. Use parentindices(f)
to get the valid indices of the parent of f
.
FixedSizeArrays.BoundsErrorLight
— TypeBoundsErrorLight <: Exception
Like BoundsError
, but doesn't store the array, to prevent clashing with escape analysis.
Stores the type of the array and the shape instead.
Internal API
This section gathers documentation of internal functionalities of FixedSizeArrays.jl
which are only of interest to the developers of and contributors to this package.
The following functionalities are not part of the public API of the package and should not be relied upon by external packages, as they can be modified or removed at any point without notice.
FixedSizeArrays.with_stripped_type_parameters
— Functionwith_stripped_type_parameters(spec, t::Type)::Val{s}
The type s
is a UnionAll
supertype of t
:
(s isa UnionAll) && (t <: s)
Furthermore, s
has type variables in place of the type parameters specified via spec
.
NB: Val{s}()
is returned instead of s
so the method would be consistent from the point of view of Julia's effect inference, enabling constant folding.
NB: this function is supposed to only have the one method. To add functionality, add methods to with_stripped_type_parameters_unchecked
.
FixedSizeArrays.with_stripped_type_parameters_unchecked
— Functionwith_stripped_type_parameters_unchecked(spec, t::Type)::Val{s}
An implementation detail of with_stripped_type_parameters
. Don't call directly.
FixedSizeArrays.collect_as_fsv
— Functioncollect_as_fsv(V::Type{<:DenseVector}, iterator)::FixedSizeVector
Collect the elements of iterator
into a FixedSizeVector
, r
. The argument V
specifies the underlying storage type parameter of r
. When possible (specified as a parameter in V
), eltype(r)
is also taken from V
, otherwise it is determined by the types of the elements of the iterator.
When V
does not provide an element type and isempty(iterator)
, the element type of the return value is:
eltype(iterator)
, when it's a concrete typeUnion{}
, otherwise
FixedSizeArrays.push!!
— Functionpush!!(t::Type{<:AbstractVector}, v::Vector, e)::Vector
Return a Vector
, r
, respecting these properties:
all(r[begin:(end - 1)] .=== v)
- if
t
specifies an element type,E
,r[end] == E(e)
, otherwiser[end] === e