|
numeric
|
Create permutation on a list of given types. More...
#include <Combinatorics.hpp>
Public Types | |
| typedef std::vector< T > | ItemList |
Public Member Functions | |
| Permutation (const std::vector< T > items) | |
| bool | next () |
| const ItemList & | current () const |
| uint64_t | numberOfPermutations () const |
Create permutation on a list of given types.
#include <numeric/Combinatorics.hpp>
...
std::string content = "abcd";
std::vector<char> characterList(content.begin(), content.end());
numeric::Permutation<char> permutation(characterList);
do {
std::vector<char> current = permutation.current();
std::string s(current.begin(), current.end());
std::cout << "Current permutation: " << s << std::endl;
} while(permutation.next());
| typedef std::vector<T> numeric::Permutation< T >::ItemList |
|
inline |
Default constructor for permutation of a given list of items
| items | List of items to compute all permutations for |
|
inline |
Retrieve the current permutated list of items
|
inline |
Retrieve the next permutation
|
inline |
Get the total number of permutations
1.8.13