Created
January 19, 2014 11:51
-
-
Save Kojirion/8503800 to your computer and use it in GitHub Desktop.
Permutation API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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