Let us take the following two toy lists:
{{a,b},{c,d}}
and {{e,f},{g,h}}
And let's say that I want to combine them such that I get the following:
{{a -> e, b -> f}, {a -> g, b -> h}, {c -> e, d -> f}, {c -> g, d -> h}}
This can obviously be done with Table, MapThread and who knows how many ways. The question is, what is the fastest way in terms of computational time?
EDIT
The lists need not to be of the same dimensions. Fore example, one could have:
{a,b}
and {{c,d},{e,f}}
to get {{a -> c, b -> d}, {a -> e, b -> f}}
.
Only the last levels of the lists need to have the same number of elements in order to combine them into Rules.
AbsoluteTiming
for each of your solutions. Best performance gets accepted answer, obivously. Stay tuned :D $\endgroup$AssociationThread
, at least in my code (which has way longer lists). $\endgroup$