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

Pull request/d4fc7c24 #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

damiendr
Copy link

@damiendr damiendr commented Oct 6, 2015

Added a method to get/set arrays by field name:

immutable Foo
    x::Float64
    a::Int32
end

soa = StructOfArrays(Foo, 10)
> soa[:a]
10-element Array{Int32,1}
> soa[:x] = linspace(0, 1, 10)
> soa[:x]
10-element Array{Float64,1}:
 0.0     
 0.111111
 0.222222
 0.333333
 0.444444
 0.555556
 0.666667
 0.777778
 0.888889
 1.0

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

Successfully merging this pull request may close these issues.

1 participant