I would like to take a matrix, A, and iterate over the Cartesian product of its entries. I can easily do this by
for (a,b,c) in Iterators.product(A[:,1], A[:,2], A[:,3])
println("$a, $b, $c")
end
But what I would ideally like is something along the lines of
for (a,b,c,...) in Iterators.product(for col in eachcol(A))
println("$a, $b, $c,...")
end
(which obviously doesn’t work but you get the idea I hope) for an N by N matrix. I don’t know if this is even possible. If anyone can provide some advice I would be very grateful.