Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcat static arrays #846

Closed
rvignolo opened this issue Oct 28, 2020 · 2 comments
Closed

vcat static arrays #846

rvignolo opened this issue Oct 28, 2020 · 2 comments

Comments

@rvignolo
Copy link

rvignolo commented Oct 28, 2020

Is this the desire behaviour when performing concatenation along dimension 1, i.e. when using vcat:

julia> vcat(SVector(1,2,3), 4)
4-element Array{Int64,1}:
 1
 2
 3
 4

returns a Vector instead of a SVector. To solve this I have to convert the scalar value to a static vector:

julia> vcat(SVector(1,2,3), SVector(4))
4-element SArray{Tuple{4},Int64,1,4} with indices SOneTo(4):
 1
 2
 3
 4

Notice that, for Arrays there is no need to convert the scalar value to an Array:

julia> vcat([1,2,3], 4)
4-element Array{Int64,1}:
 1
 2
 3
 4

i.e. there is no need to:

julia> vcat([1,2,3], [4])
4-element Array{Int64,1}:
 1
 2
 3
 4

Thanks!

@mateuszbaran
Copy link
Collaborator

This has already been fixed on master: #768 , although it won't be in 0.12.5.

@rvignolo
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants