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

FR: Preserve CA-ness when indexing component matrix with shaped components #257

Open
marius311 opened this issue Apr 7, 2024 · 1 comment

Comments

@marius311
Copy link

marius311 commented Apr 7, 2024

Would it be possible to make this not fall back to Array so you could more easily work with the result when slicing a subset of blocks?:

julia> c = ComponentVector(x=rand(2,2), y=rand(3), z=4);

julia> m = c * c';

julia> m[:x]
2×2×2×2 Array{Float64, 4}:
[:, :, 1, 1] = ...

Specifically I'm also interested in slicing multiple sub-blocks like m[[:x,:y]], although I'm imagining making the thing above work would be the first step. Thanks.

@jonniedie
Copy link
Collaborator

I don't think it's falling back. It's just that the m[:x, :x] block is a plain array. Just like c.x is a plain array. Or maybe I'm missing what you're saying?

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