|
numeric
|
Combination of a unique item map Binomialcoefficient (n k) More...
#include <Combinatorics.hpp>
Public Types | |
| typedef std::vector< T > | ItemList |
Public Member Functions | |
| Combination (const std::vector< T > &uniqueItems, size_t sizeOfDraw, Mode mode=EXACT) | |
| Combination of a unique item map Binomialcoefficient (n k) More... | |
| void | createStartDraw (uint32_t n, uint32_t k) |
| bool | next () |
| ItemList | current () const |
| uint64_t | numberOfCombinations () const |
Combination of a unique item map Binomialcoefficient (n k)
| Type | of items that should be combined |
A code example
#include <vector>
#include <string>
#include <numeric/Combinatorics.hpp>
using namespace numerics;
...
std::vector<std::string> items;
items.push_back("A");
items.push_back("B");
items.push_back("C");
Combination<std::string> combinations(items, EXACT);
do {
std::vector<std::string> combination = combinations.current();
...
} while(combinations.next());
| typedef std::vector<T> numeric::Combination< T >::ItemList |
|
inline |
Combination of a unique item map Binomialcoefficient (n k)
| uniqueItems | Map of unique items |
| sizeOfDraw | Size of the draw (k) |
| mode | One of Mode to get the exact type of combination all up to (MAX) or from to maximum use (MIN) |
|
inline |
|
inline |
|
inline |
|
inline |
1.8.13