-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]
Description
Currently, concatenation passes the sizes of the components to determine the type of the container. It might be possible to use the axes instead, thereby preserving static sizes. As an example:
julia> using StaticArrays, FillArrays
julia> a = SMatrix{2,2}(1:4)
2×2 SMatrix{2, 2, Int64, 4} with indices SOneTo(2)×SOneTo(2):
1 3
2 4
julia> row = Ones(SOneTo(1), axes(a,2))
1×2 Ones{Float64, 2, Tuple{SOneTo{1}, SOneTo{2}}} with indices SOneTo(1)×SOneTo(2)
julia> [a; row]
3×2 Matrix{Float64}:
1.0 3.0
2.0 4.0
1.0 1.0
Since all components have their sizes statically known, it should be possible to preserve that information in the container. This will perhaps require some function that accepts SOneTo(2)
and SOneTo(1)
as arguments and returns SOneTo(3)
. I'm uncertain if there is an existing function that does this. However, once this is available, one may pass the result to similar
to generate the container.
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]