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

Flattening heterogeneous arrays into single vector #67

Open
colinxs opened this issue Jul 22, 2019 · 0 comments
Open

Flattening heterogeneous arrays into single vector #67

colinxs opened this issue Jul 22, 2019 · 0 comments

Comments

@colinxs
Copy link

colinxs commented Jul 22, 2019

I'm looking for a way to store tuples of same-typed but differently-sized data as in:

x=1;
y=[2 4; 3 5];
vec = LVector(x=x, y=y);
vec[:] == [1,2,3,4,5] # true
vec.x == 1 # true
vec.y == [2 4; 3 5];

So that under the hood vec is a contiguous array of Int. It seems like this could be done be storing not just the indices in the type, but the underlying shape as well. vec.y in the above example would return a ReshapedArray of the underlying view.

Thoughts?

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

1 participant