Compute combinatorics on a given set of limited but typed resources, e.g. for available resource A:2, B:1, C:1 the following combinations are possible: max size 1: A,B,C max size 2: AA, AB, AC, BC max size 3: AAB, AAC, ABC.
More...
template<typename AtomType>
class numeric::LimitedCombination< AtomType >
Compute combinatorics on a given set of limited but typed resources, e.g. for available resource A:2, B:1, C:1 the following combinations are possible: max size 1: A,B,C max size 2: AA, AB, AC, BC max size 3: AAB, AAC, ABC.
Use integers to compute the core combinatorics, i.e. avoiding the computational effort for comparison of custom objects
using namespace numeric;
std::map<std::string, size_t> items;
items["A"] = 2;
items["B"] = 1;
items["C"] = 1;
LimitedCombination<std::string> combinations(items, LimitedCombination<std::string>::totalNumberOfAtoms(items), MAX);
do {
std::vector<std::string> currentCombination = combinations.current();
} while(combinations.next());