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

involuntary squeeze() with vector of vectors. #264

Open
RainerHeintzmann opened this issue Jul 26, 2024 · 1 comment
Open

involuntary squeeze() with vector of vectors. #264

RainerHeintzmann opened this issue Jul 26, 2024 · 1 comment

Comments

@RainerHeintzmann
Copy link

For many applications one-dimensional vectors that are oriented in a certain direction are essential.
However, when such vectors are wrapped in a ComponentArray, some mechanism seems to squeeze them when stored as a vector of vectors, such that they are now oriented along the first direction. This makes ComponentArray.jl unsuitable for broadcasting operations on its stored vectors.

julia> a= reshape([1,2,3],(1,3)); b=[a,a]; q = ComponentVector(;q = [1,2], qq=b, ww=[1 2;3 4]); size(q.qq[1])
(3,)
julia> size(b[1])
(1, 3)
@roflmaostc
Copy link

Seems like any Vector of n-dim array gets flattened

julia> cv = ComponentVector(; x = [ones(2,2), ones(2,2)])
ComponentVector{Float64}(x = SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]])

julia> size(cv.x[1])
(4,)
``

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