22 int main(
int argc,
char **argv)
32 JParser<> zap(
"Example program to test permutations.");
40 catch(
const exception &error) {
41 FATAL(error.what() << endl);
48 if (N > buffer.size()) {
49 FATAL(
"Number of elements " << N <<
" > " << buffer.size() << endl);
52 sort(buffer.begin(), buffer.end(), less<int>());
66 DEBUG(
'[' << setw(3) <<
n <<
']');
69 DEBUG(
' ' << setw(3) << *i);
75 data.rbegin()->insert(*i);
81 DEBUG(
' ' << setw(3) << *i);
96 NOTICE(
"number of permutations " <<
n <<
' ' <<
factorial(buffer.size(), N) << endl);
General purpose messaging.
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
Utility class to parse command line options.
long long int factorial(const long long int n)
Determine factorial.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.