i need to convert
2-element Vector{Matrix{Tuple{Real, Real}}}:
[(1, 2) (1.8, 2.1) (3, 2)]
[(1, 3) (2.2, 2.9) (3, 3)]
into
(Vector{Real}[[1, 1.8, 3], [1, 2.2, 3]], Vector{Real}[[2, 2.1, 2], [3, 2.9, 3]])
For that my naive approach is
a=[[(1,2) (1.8,2.1) (3,2)],[(1,3) (2.2,2.9) (3,3)]]
b=([first.(s)|>vec for s in a],[last.(s)|>vec for s in a])
Is there a way to write expressions like this simpler (i.e. without repeating most of the
[somefunc.(s)|>vec for s in a]expression)?Is this an efficient solution for
acontaining >1e6 elements in both vectors?