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

One label for more than one contiguous entry #31

Open
BenjaminBorn opened this issue Nov 13, 2018 · 1 comment
Open

One label for more than one contiguous entry #31

BenjaminBorn opened this issue Nov 13, 2018 · 1 comment

Comments

@BenjaminBorn
Copy link

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?

@ChrisRackauckas
Copy link
Member

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.

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