15 int main(
int argc,
char **argv)
24 JParser<> zap(
"Example program to test combinatorics of pairs of indices.");
31 catch(
const exception &error) {
32 FATAL(error.what() << endl);
38 if (numberOfElements <= 0) {
39 FATAL(
"Number of elements " << numberOfElements <<
" <= 0" << endl);
43 JCombinatorics combinatorics(numberOfElements);
47 for (
int i = 0; i != (int) combinatorics.getNumberOfPairs(); ++i) {
49 STATUS(
"event: " << setw(8) << i <<
'\r');
DEBUG(endl);
53 if (i != combinatorics.getIndex(
pair.first,
pair.second)) {
58 setw(3) <<
pair.first <<
' ' <<
59 setw(3) <<
pair.second <<
' ' <<
60 setw(4) << combinatorics.getIndex(
pair.first,
pair.second) << endl);
65 NOTICE(
"Number of elements " << setw(8) << right << numberOfElements << endl);
66 NOTICE(
"Number of pairs " << setw(8) << right << combinatorics.getNumberOfPairs() << endl);
67 NOTICE(
"Number of errors " << setw(8) << right <<
n << endl);