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

SizedArray changes to SArray #755

Closed
jwscook opened this issue Mar 22, 2020 · 2 comments
Closed

SizedArray changes to SArray #755

jwscook opened this issue Mar 22, 2020 · 2 comments

Comments

@jwscook
Copy link

jwscook commented Mar 22, 2020

Possibly related to #734, #537.

Hi All,

I've encountered a problem where adding two SizedArrays creates an SArray, when I'd have thought the outcome would be a SizedArray:

julia> a = SizedVector{1}([1])
1-element SizedArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 1

julia> b = SizedVector{1}([1])
1-element SizedArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 1

julia> a + b
1-element SArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 2

julia> a .+ b
1-element SArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 3

Is this intended?

Cheers,
James

Version info:

Version 1.3.2-pre.0 (2019-12-31)
release-1.3/2e6715c045 (fork: 118 commits, 217 days)
(v1.3) pkg> st StaticArrays
    Status `~/.julia/environments/v1.3/Project.toml`
  [90137ffa] StaticArrays v0.12.0 [`~/.julia/dev/StaticArrays`]
  [37e2e46d] LinearAlgebra 
@c42f
Copy link
Member

c42f commented Mar 22, 2020

Thanks for bringing this up. I think this is already changed in latest master to do what you expect — see #719.

@jwscook
Copy link
Author

jwscook commented Mar 22, 2020

Yep - that did the trick:

julia> a + b
1-element SizedArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 2

julia> a .+ b
1-element SizedArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 2

and

(v1.3) pkg> st StaticArrays
    Status `~/.julia/environments/v1.3/Project.toml`
  [90137ffa] StaticArrays v0.12.1 #master (https://github.com/JuliaArrays/StaticArrays.jl.git)
  [37e2e46d] LinearAlgebra 

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