Skip to content

Instantly share code, notes, and snippets.

@Kojirion
Created January 19, 2014 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kojirion/8503800 to your computer and use it in GitHub Desktop.
Save Kojirion/8503800 to your computer and use it in GitHub Desktop.
Permutation API
typedef unsigned int Uint;
class Permutation {
public:
//construct identity of given order
explicit Permutation(Uint order);
//construct from init list
Permutation(std::initializer_list<Uint> list);
//construct from given range of Uint
template<class InputIt>
Permutation(InputIt first, InputIt last);
Uint order() const;
bool operator==(const Permutation& that) const;
Uint operator[](Uint index) const;
Permutation operator*(const Permutation& that) const;
//permute given range
template<class It>
void operator()(It first, It last) const;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment