Question: What is equivalient to replicateM ?

ma := allstructs(Permutation([1, 1, 1, 2, 2, 2, 3, 3, 3]), size = 3);

above is fast

but below is very slow.
ma2 := allstructs(Permutation(ma), size = 3);

just for all combinations of matrix , replicateM in haskell is the fastest.

in maple, ma2 := allstructs(Permutation(ma), size = 3); is very slow

 

Please Wait...