I want to construct, given $m$ and $q$, the list of all vectors $v=(a_1,\dots,a_m)$ such that $0\leq a_1\leq \dots \leq a_m < q$. I tried to use "CartesianProducts" but I don't known how to iterate it $m$-times.
You can see this very similar question.
Thierry, is it possible that using a filter on `IntegerVector` might work as well?
Not enough space, see my answer below (by the way, is it possible to allow more characters in comments ?).
Thanks to @vdelecroix, i realize that i answered the question about iterating cartesian product and provide all vectors $v=(a_1, \dots, a_m)$ with such that $0 \leq a_i < q$, but not the first question with the condition $0\leq a_1\leq \dots \leq a_m < q$.
But note that with that solution you need to specify the sum of the elements.
How to use elements of cartesian product of two groups?
How do I find the subsets of given Set?