Skip to content

FR: View sub-arrays as Complex with Real underlying array #344

@Ouroboros42

Description

@Ouroboros42

It would be nice to be able to include complex variables/arrays in a ComponentArray that still behaves as an array of Reals. This is necessary when some other components are real, or for use in solvers that only take Real arrays.

This would look something like:

julia> arr = ComponentArray(a = 0, b = ComplexView([ 1+ 2im, 3 + 4im ]);

julia> collect(arr)
[ 0, 1, 2, 3, 4 ]

julia> arr.b[1]
1 + 2im

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