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

MVector*MVector' returns an SMatrix #331

Closed
dmbates opened this issue Nov 1, 2017 · 1 comment
Closed

MVector*MVector' returns an SMatrix #331

dmbates opened this issue Nov 1, 2017 · 1 comment

Comments

@dmbates
Copy link

dmbates commented Nov 1, 2017

I have noticed that some operations on MArrays return SArrays. Is this intentional?

julia> Pkg.status("StaticArrays")
 - StaticArrays                  0.6.4

julia> using StaticArrays

julia> v = @MVector ones(2)
2-element MVector{2,Float64}:
 1.0
 1.0

julia> v*v'
2×2 StaticArrays.SArray{Tuple{2,2},Float64,2,4}:
 1.0  1.0
 1.0  1.0
@andyferris
Copy link
Member

Is this intentional?

Yes (because SArray is faster and typically you don't need to mutate individual elements of results of computations). This is controlled by similar_type (which is possible to overload). However, we are currently revisiting that decision over at #327 for v1.0 of Julia.

I'll close this issue and you may contribute over at #327.

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