I imagine I have a set of n objects. I know k1 many of them are of type 0, k2 many of type 1 and k3 many of type 2 such that n=k1+k2+k3.
I am looking for a loop that takes me through all possible permutations of these n objects, i.e. in each iteration I want a vector of length n such that each entries specifies a number 0,1,2, specifying the type of the i-th element.
What is an elegant way to implement this?