32 #include "chomp/system/config.h" 33 #include "chomp/system/textfile.h" 34 #include "chomp/system/timeused.h" 35 #include "chomp/system/arg.h" 47 Test Shuffles. August 12, 2013. (C) 1997-2014 by Pawel Pilarczyk.\n\ 48 This is free software. No warranty. Consult 'license.txt' for details.";
52 This program shows all the shuffles of required size.\n\ 54 p q - the two positive integer numbers that define the shuffles.\n\ 55 Switches and additional arguments:\n\ 56 --log filename - save the output to a file (without progress indicators),\n\ 57 --quiet - suppress data output to the screen (whcih can be still logged),\n\ 58 --help - display this brief help information only and exit.\n\ 59 For more information please consult the accompanying documentation\n\ 60 or ask the program's author at http://www.PawelPilarczyk.com/.";
69 int main (
int argc,
char *argv [])
71 using namespace chomp::homology;
74 program_time =
"Aborted after";
87 int argresult = a. analyze (argc, argv);
92 sout <<
title <<
'\n';
97 sout <<
"Call with '--help' for help.\n";
102 if ((argresult > 0) || (p < 0) || (q < 0))
112 std::vector<int> alpha (p);
113 std::vector<int> beta (q);
118 bool moreAvailable = s.
get (alpha, beta, sig);
119 sout <<
"Shuffle " << count <<
": (";
120 for (
int i = 0; i < p; ++ i)
121 sout << (i ?
" " :
"") << alpha [i];
123 for (
int i = 0; i < q; ++ i)
124 sout << (i ?
" " :
"") << beta [i];
125 sout <<
"); sig = " << sig <<
".\n";
133 for (
int i = p + 1; i <= p + q; ++ i)
135 for (
int i = 2; i <= q; ++ i)
139 sout <<
"Wrong number of shuffles: " << count <<
140 " instead of " << all <<
".\n";
143 program_time =
"Total time used:";
147 catch (
const char *msg)
149 sout <<
"ERROR: " << msg <<
'\n';
152 catch (
const std::exception &e)
154 sout <<
"ERROR: " << e. what () <<
'\n';
159 sout <<
"ABORT: An unknown error occurred.\n";
const char * helpinfo
Brief help information on the program's usage.
An iterator of all the (p,q)-shuffles.
int main(int argc, char *argv [])
The main procedure of the program.
const char * title
The title of the program and licensing information.