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

hcat and vcat don't behave like arrays #164

Open
stevengj opened this issue Nov 1, 2016 · 7 comments
Open

hcat and vcat don't behave like arrays #164

stevengj opened this issue Nov 1, 2016 · 7 comments

Comments

@stevengj
Copy link

stevengj commented Nov 1, 2016

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}.

@andyferris
Copy link
Contributor

@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.

@stevengj
Copy link
Author

stevengj commented Nov 1, 2016

@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.

@andyferris
Copy link
Contributor

No worries. There was a suggestion to add note to the READMEs of these packages which might help with this.

@SimonDanisch
Copy link
Owner

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!

@andyferris
Copy link
Contributor

Lets get this done this week and have an announcement on the user list etc!

Sounds good. 😃 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?

@stevengj
Copy link
Author

stevengj commented Nov 1, 2016

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. 😄

@andyferris
Copy link
Contributor

you'll notice me filing a slew of issues

I look forward to it! 😄

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

3 participants