print out all combinations of index
I set a vector list, for example : vector<VectorXi> Test; Test.push_back(VectorXi(0,1)); Test.push_back(VectorXi(0,1,2)); Test.push_back(VectorXi(0)); Test.push_back(VectorXi(0,1)); Test.push_back(VectorXi(0,1,2,3)); PrintAllCombins(Test) And now I want to get all combinations of indexes : 0, 0, 0, 0, 0 0, 0, 0, 0, 1 0, 0, 0, 0, 2 0, 0, 0, 0, 3 0, 0, 0, 1, 0 0, 0, 0, 1, 1 0, 0, 0, 1, 2 0, 0, 0, 1, 3 0, 0, 1, 0, 0 0, 0, 1, 0, 1 0, 0, 1, 0, 2 0, 0, 1, 0, 3 ... and so on If i use for or while loop suitably, then it works I guess, but I encounter limitation. Is there any idea? I'm writing code in