Hello,
I have some Vectors of StaticArrays and I use them in functions like this:
fun(vec[1],vec[2],vec[3])
where each position of vec
is a StaticArray.
It would be helpful to do something like this:
fun(vec[1:3])
fun(vec[1:3]...,)
because I’m declaring these functions with 3 or 4 inputs. I notice a performance penalty from turning the vectors into a tuple (...
) and from passing the 3 StaticArrays as a single vector.
Is there a way to do this that is as fast as fun(vec[1],vec[2],vec[3])
, but would let me pass 3 or 4 inputs to fun
?
The positions 1:3
are placeholders here. In reality, they are never consecutive and come from another vector of StaticArrays (vec[indices[n][1]], vec[indices[n][2]], vec[indices[n][3]]
or vec[indices[n]]
, to have them grouped).
Thanks a lot!