#include "CGAL/Combination_enumerator.h"
#include <iostream>
int main()
{
unsigned int n(0);
const int k(3), first(10), last(15);
cout << "Taking " << k << " distinct integers in the range [" <<
first << ", " << last << "]:";
cout << " {";
for(int i = 0; i < k; ++i) {
cout << combi[i];
if( i < k - 1 )
cout << ' ';
}
cout << '}';
++n;
++combi;
}
cout << endl << "Enumerated " << n << " combinations." << endl;
return EXIT_SUCCESS;
}
The class Combination_enumerator is used to enumerate all fixed-size combinations (subsets) of a sour...
Definition: Combination_enumerator.h:21
bool finished()
Returns true if and only if all combinations have been enumerated.