JuliaArrays / JuliaArrays/StaticArrays.jl
Make `hvcat` for StaticArray and UniformScaling inputs produce a StaticArray
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 844
- Forks
- 159
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 3
Description
hcat and vcat seem to be specialized for StaticArray blocks, but hvcat does not seem to be specialized. Examples
julia> using StaticArrays
julia> A, B = @SMatrix(randn(2, 2)), @SMatrix(randn(2, 2));
julia> [A B] # fine
2×4 SMatrix{2, 4, Float64, 8} with indices SOneTo(2)×SOneTo(4):
1.26449 0.426149 -1.15767 0.218855
-0.816403 -0.241287 -0.663465 -0.367645
julia> [A; B] # fine
4×2 SMatrix{4, 2, Float64, 8} with indices SOneTo(4)×SOneTo(2):
1.26449 0.426149
-0.816403 -0.241287
-1.15767 0.218855
-0.663465 -0.367645
julia> [A B; A B] # Matrix
4×4 Matrix{Float64}:
1.26449 0.426149 -1.15767 0.218855
-0.816403 -0.241287 -0.663465 -0.367645
1.26449 0.426149 -1.15767 0.218855
-0.816403 -0.241287 -0.663465 -0.367645
julia> [A B; I] # Matrix
6×4 Matrix{Float64}:
1.26449 0.426149 -1.15767 0.218855
-0.816403 -0.241287 -0.663465 -0.367645
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the hcat and vcat specializations for StaticArray blocks and the corresponding hvcat entry point, then reproduce the examples in the issue. Done means hvcat cases involving StaticArray blocks and UniformScaling inputs produce a StaticArray rather than a Matrix, with coverage for the shown combinations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100