c++ class for generation and coding of permutations