How to overload Base.Complex?

Maybe a good way to achieve this is to create a new AbstractArray type (say, ComplexArray) and overload it, which is more standard Julia practice.

To get the simd tricks going, overloading broadcast and direct it to a new set of arithmetic operations.

This idea is still needs development.

3 Likes

And even more on-point, is to look at Images package and how it handles images stored by pixels vs. by color-channel planes. This is highly analogous to the real/imaginary part of complex variables, and Images package has had a lot of effort put into it.

3 Likes

But… can’t you use StructArrays as they are? What’s missing there?

What I want is tuple, not array.