Hi,
I’m trying to create an iterator that does the following:
vec_coord_x=[1,2,3]
vec_coord_y=[1,2,3]
vec_coord_z=[1,2,3]
[(x,y,z) for x in vec_coord_x for y in vec_coord_y for z in vec_coord_z]
Resulting in:
27-element Vector{Tuple{Int64, Int64, Int64}}:
(1, 1, 1)
(1, 1, 2)
(1, 1, 3)
(1, 2, 1)
(1, 2, 2)
(1, 2, 3)
⋮
(3, 2, 2)
(3, 2, 3)
(3, 3, 1)
(3, 3, 2)
(3, 3, 3)
I can use the for loop, but I think it would be faster with the iterator, correct?
Is there a function in the pack “IterTools” that do this?
Thank you!