llvm::CombinationGenerator

Exhaustive generator of combinations across a vector-of-vectors choice space.

Synopsis

Declared in <llvm/ADT/CombinationGenerator.h>

template<
    typename choice_type,
    typename choices_storage_type,
    int variable_smallsize>
class CombinationGenerator;

Description

Given input such as {{0, 1}, {2}, {3, 4}}, yields every tuple formed by picking one choice per variable: {0, 2, 3}, {0, 2, 4}, {1, 2, 3}, {1, 2, 4}. The outer range is the variable space; each inner range is the set of choices for that variable.

Member Functions

NameDescription
CombinationGenerator [constructor]Construct a generator over the given per-variable choice lists.
generate Invoke Callback for every combination in the choice space.
numCombinations Return the product of the sizes of all per-variable choice lists. This is the maximum number of times the generate callback may be called.