Jump to content

Cartesian product of two or more lists: Difference between revisions

imported>Maxima enthusiast
imported>Maxima enthusiast
Line 3,296:
my_cartesian(lst1,lst2):=create_list([i,j],i,lst1,j,lst2);
n_ary_cartesian(singleargument):=block(lreduce(my_cartesian,singleargument),map(flatten,%%));
 
[[1776,1789],[7,12],[4,14,23],[0,1]]$
n_ary_cartesian(%);
Cookies help us deliver our services. By using our services, you agree to our use of cookies.