in reply to Re^2: Cartesian Cross-Products
in thread Cartesian Cross-Products
sub cartesian { my @C = map { [ $_ ] } @{ shift @_ }; foreach (@_) { my @A = @$_; @C = map { my $n = $_; map { [ $n, @$_ ] } @C } @A; } return @C; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Cartesian Cross-Products
by saenns (Initiate) on Aug 09, 2010 at 17:33 UTC | |
by psini (Deacon) on Aug 09, 2010 at 17:54 UTC | |
by drt (Initiate) on Feb 15, 2012 at 21:54 UTC | |
|
Re^4: Cartesian Cross-Products
by Anonymous Monk on Jan 20, 2010 at 23:23 UTC |