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

rand with an SArray as eltype #14

Closed
KristofferC opened this issue Aug 11, 2016 · 5 comments
Closed

rand with an SArray as eltype #14

KristofferC opened this issue Aug 11, 2016 · 5 comments

Comments

@KristofferC
Copy link
Contributor

Sorry for spamming issues.

It would be nice if this could work rand(SVector{5, Float64}, 5)

I guess it should be enough to implement rand(::RNG, ::SArray).

@andyferris
Copy link
Member

Hmmm.... there is a certain logic to that. Perhaps changing my rand() signatures will be sufficient.

@andyferris
Copy link
Member

Just to clarify, you want a Vector of 5 SVector{5, Float64}'s, right?

@andyferris
Copy link
Member

Now we have this:

julia> rand(SVector{3}, 6)
6-element Array{StaticArrays.SVector{3,T},1}:
 [0.458227,0.344626,0.396484]
 [0.809879,0.267388,0.335738]
 [0.993943,0.613799,0.743661]
 [0.943414,0.998016,0.881938]
 [0.531196,0.720806,0.440227]
 [0.565579,0.389288,0.264825]

@KristofferC
Copy link
Contributor Author

Exactly, thanks.

@andyferris
Copy link
Member

No worries. It is also tagged, now.

On 12 August 2016 at 15:03, Kristoffer Carlsson [email protected]
wrote:

Exactly, thanks.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#14 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC1jPlduDv1BisGLgUaIQZe54SdUozBLks5qe_63gaJpZM4JiCcI
.

oschulz pushed a commit to oschulz/StaticArrays.jl that referenced this issue Apr 4, 2023
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