permutation.h 351 B

1234567891011121314
  1. #ifndef PERMUTATION_H
  2. #define PERMUTATION_H
  3. class permutation {
  4. public:
  5. permutation(int size); // initialize to identity
  6. void transpose(int i, int j);
  7. void random();
  8. int operator[](int i); // return the image of i (i and its image 0-based)
  9. protected:
  10. int *sigma, size; // data[i] is the image of i
  11. };
  12. #endif // PERMUTATION_H