LabelledArrays.jl
LabelledArrays.jl copied to clipboard
One label for more than one contiguous entry
Sorry for asking here, feel free to close if this is not the appropriate place.
Let's say I have the vector A = [1, 2, 3, 4] but I want to put the first two entries under one label. Essentially: A1.a=A[1:2]. If I do
using LabelledArrays
ABC = @SLVector (:a, :b, :c)
A1 = ABC([1, 2], 3, 4)
I get 3-element SLArray{Tuple{3},1,(:a, :b, :c),Any}, so it's of type Any, instead of 3-element SLArray{Tuple{3},1,(:a, :b, :c),Int64}
Is that performant or is there a better way to do this? Or is it outside the scope of this package?
LabelledArray accepts AbstractArray pieces, so if you made an abstract array which handles this well then it would likely work in a LabelledArray. Off the top of my head I don't know of one which fits this though.