We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi @baggepinnen , we've talked before about StructArrays...
I haven't used this package much before, but I did get this going and it seems to work well:
julia> using StructArrays, MonteCarloMeasurements, NamedTupleTools, BenchmarkTools julia> function structarray(nt::NamedTuple) return StructArray(prototype(nt)(getproperty.(values(nt), :particles))) end structarray (generic function with 1 method) julia> nt = (x=Particles(5), y=Particles(5)) (x = -4.44e-17 ± 0.98, y = -4.44e-17 ± 0.98) julia> @btime structarray($nt) 2.063 ns (0 allocations: 0 bytes) 5-element StructArray(::Array{Float64,1}, ::Array{Float64,1}) with eltype NamedTuple{(:x, :y),Tuple{Float64,Float64}}: (x = -1.2815515655446004, y = -1.2815515655446004) (x = -0.5244005127080408, y = -0.5244005127080408) (x = 0.5244005127080407, y = 0.5244005127080407) (x = 1.2815515655446004, y = 0.0) (x = 0.0, y = 1.2815515655446004)
Not sure how this might fit in with your manipulations in the package, just passing it along in case it's helpful :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi @baggepinnen , we've talked before about StructArrays...
I haven't used this package much before, but I did get this going and it seems to work well:
Not sure how this might fit in with your manipulations in the package, just passing it along in case it's helpful :)
The text was updated successfully, but these errors were encountered: