involuntary squeeze() with vector of vectors.
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)
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,)
``
I (unfortunately) also ran into this issue. My optimization problem is defined in terms of a variable number of matrices (hence stored as a Vector{Matrix{T}}). As a workaround, I could store dimensions and then reshape manually, but it would make life quite a bit easier if this would be transparent.