FixedSizeArrays.jl
FixedSizeArrays.jl copied to clipboard
hcat and vcat don't behave like arrays
julia> hcat(Vec(3,4),Vec(5,6))
1×2 Array{FixedSizeArrays.Vec{2,Int64},2}:
Vec(3,4) Vec(5,6)
julia> vcat(Vec(3,4),Vec(5,6))
2-element Array{FixedSizeArrays.Vec{2,Int64},1}:
Vec(3,4)
Vec(5,6)
I was expecting that Vec would behave like an Array here, i.e. that hcat would produce a Mat{2,2} and vcat would produce a Vec{4}.
@stevengj Not sure if you saw #159? I realize there are good reasons for using FIxedSizeArrays (including backward compatibility, integration into other packages, etc), and don't want to steal thunder from @SimonDanisch for this awesome package, but I wanted to mention that the issues you raised today are not present in StaticArrays.jl.
@andyferris, thanks for the tip. I have to admit that the variety of packages for fixed-size arrays (FixedSizeArrays, ImmutableArrays, StaticArrays) confuses me, and I was unclear on which one I should use. I'll take a look at StaticArrays.
No worries. There was a suggestion to add note to the READMEs of these packages which might help with this.
Sorry about this, that's my fault. I just don't feel comfortable about spreading the deprecation of FixedSizeArrays before I haven't actually moved away my own packages! Lets get this done this week and have an announcement on the user list etc!
Lets get this done this week and have an announcement on the user list etc!
Sounds good. :smiley: I'm currently making a few architectural changes to StaticArrays and will tag a new minor release when that is in reasonable shape (a couple of days) so we can time it with that.
On a related note, how are you finding using StaticArrays for geometry? Did you get a Point type working the way you like?
I don't actually care much about the distinction between Point and Vec in my application (I don't need to dispatch on the difference, anyway), so I'm not planning defining a Point type. If I have any problems with StaticArrays, you'll notice me filing a slew of issues. 😄
you'll notice me filing a slew of issues
I look forward to it! :smile: