n-dim permutation matrix/generator?

guenter.jantzen at prodv.de guenter.jantzen at prodv.de
Mon Nov 20 18:13:11 CET 2006

If your products are not too big you may use the following approach

def cross(*L):
    for i in range(len(L)):
        for p in P:
            for el in L[i]:
        P = P_
    return P

if __name__ == '__main__':
    for x in cross((0,1,2), (0,1), (0,1)):
        print x

More information about the Python-list mailing list