-
-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
I could really use something like a namedtuple that can do vector operations (immutable, indexable by name and no allocations when doing operations). My idea was to try out ComponentArrays with StaticArrays. But it didn't work
using ComponentArrays
using StaticArrays
comp = ComponentArray((a=5.,b=(c=7.,d=8.)))
scomp = ComponentArray(SVector(getdata(comp)...),getaxes(comp))
getdata(scomp)*2 #works
scomp*2 # ErrorThe error is:
ERROR: Dimension is not static. Please file a bug.
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] copy
@ C:\Users\x\.julia\packages\StaticArrays\jA1zK\src\broadcast.jl:61 [inlined]
[3] materialize
@ .\broadcast.jl:860 [inlined]
[4] broadcast_preserving_zero_d
@ .\broadcast.jl:849 [inlined]
[5] *(A::ComponentVector{Float64, SVector{3, Float64}, Tuple{Axis{(a = 1, b = ViewAxis(2:3, Axis(c = 1, d = 2)))}}}, B::Int64)
@ Base .\arraymath.jl:24
[6] top-level scope
@ c:\Users\x\Documents\julia3\test.jl:71 Metadata
Metadata
Assignees
Labels
No labels