I am not sure if this is a duplicate. Spent some time looking over list-manip questions.
I’d like to know the Quickest Way to achieve the following Mapping of a function over multiple lists.
Suppose we have multiple lists of unequal length:
l1 = {a, b, c, d};
l2 = {x, y, z};
l3 = {u, v};
Q1 What is the quickest way to generate another list as follows (where f is a function):
{{f[a, x, u], f[b, x, u], f[c, x, u], f[d, x, u]},
{f[a, y, u], f[b, y, u], f[c, y, u], f[d, y, u]},
...
{f[a, z, v], f[b, z, v], f[c, z, v], f[d, z, v]}}
Now suppose you have a list of functions:
{f,g,h,i}
Q2 What is the quickest way to generate a list as follows:
{{f[a, x, u], g[b, x, u], h[c, x, u], i[d, x, u]},
{f[a, y, u], g[b, y, u], h[c, y, u], i[d, y, u]},
...
{f[a, z, v], g[b, z, v], h[c, z, v], i[d, z, v]}}