Skip to content

Matrix components #11

@arlk

Description

@arlk

Thanks for the awesome package! It's been very helpful in putting together some complicated models. One of my simulations has a matrix of ODEs and I tried using ComponentArrays to handle it, but it seems to flatten it into a vector. MWE:

julia> c = ComponentArray(a = 1, b = rand(2,2))
ComponentArray{Float64}(a = 1.0, b = [0.24410936846253284, 0.7216454349529038, 0.7719341762466598, 0.5748953546713345])

julia> c[:b]
4-element view(::Array{Float64,1}, 2:5) with eltype Float64:
 0.24410936846253284
 0.7216454349529038
 0.7719341762466598
 0.5748953546713345

Instead I was expecting something like this:

julia> c[:b]
4-element view(::Array{Float64,2}, 2:5, 2:5) with eltype Float64:
 0.244109  0.771934
 0.721645  0.574895

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions