![]() |
The template parameter should be a model of the concept CombinationElement.
Each combination is uniquely represented as an increasing sequence of elements. Thus, the combinations can be lexicographically ordered. They are enumerated in that order, so that we can talk about the first or last combination.
#include <CGAL/Combination_enumerator.h>
Combination_enumerator<CombinationElement> c ( int k, CombinationElement first, CombinationElement beyond); | |||
This constructor initializes c to
enumerate the combinations of k elements from the source range
[first, beyond). The current combination is set to the first combination
of the enumeration.
| |||
Combination_enumerator<CombinationElement> c ( Combination_enumerator combi); | |||
The copy constructor.
|
CombinationElement | c [ int i ] |
Returns the i-th
element of the current combination.
|
int | c.number_of_elements () | Returns the size of the enumerated combinations (the parameter k from the class' constructor). |
CombinationElement | c.min_element () | Returns the smallest element of the source range. (the parameter first of the class' constructor). |
CombinationElement | c.beyond_element () | Returns the successor to the largest element of the source range (the parameter beyond of the class' constructor). |
bool | c.finished () | Returns true if and only if all combinations have been enumerated. |
void | c.reset () | Resets the enumerator. The current combination is set to the first one of the enumeration. |
void | ++ c | Moves c to the next combination. |
Combination_enumerator | c ++ | Post-incrementation. Same as the pre-incrementation above, but returns the original value of c. |