/[cln]/benchmarks/timebench2ap.cc
ViewVC logotype

Contents of /benchmarks/timebench2ap.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Wed Jun 23 21:11:21 2004 UTC (8 years, 10 months ago) by kreckel
Branch: MAIN
CVS Tags: cln_1-2-2, cln_1-1-8, cln_1-2-0, cln_1-2-1, cln_1-1-9, cln_1-1-11, cln_1-1-10, cln_1-1-13, cln_1-1-12, cln_1-1_maintenance-branchpoint, HEAD
Branch point for: cln_1-1
Changes since 1.3: +2 -2 lines
* Change all C include headers to ISO style within C++ code.

1 kreckel 1.2 #include <cln/number.h>
2     #include <cln/io.h>
3     #include <cln/integer.h>
4 kreckel 1.4 #include <cstdlib>
5     #include <cstring>
6 kreckel 1.2 #include <cln/timing.h>
7    
8     using namespace std;
9     using namespace cln;
10 kreckel 1.1
11     int main (int argc, char * argv[])
12     {
13     int limit = 1000;
14     int repetitions = 1;
15     while (argc >= 3) {
16     if (!strcmp(argv[1],"-r")) {
17     repetitions = atoi(argv[2]);
18     argc -= 2; argv += 2;
19     continue;
20     }
21     if (!strcmp(argv[1],"-l")) {
22     limit = atoi(argv[2]);
23     argc -= 2; argv += 2;
24     continue;
25     }
26     break;
27     }
28     if (argc < 1)
29     exit(1);
30    
31 kreckel 1.3 cerr << "Limit: " << limit << endl;
32     cerr << "Number of repetitions: " << repetitions << endl;
33 kreckel 1.1
34     { CL_TIMING;
35     for (int rep = repetitions; rep > 0; rep--)
36     { cl_I u = 1, v = 1, p = 1, q = 1;
37     for (int k = 1; k <= limit; k++)
38     { cl_I w = u+v;
39     u = v; v = w;
40     p = p*w; q = lcm(q,w);
41     }
42     }
43     }
44    
45     }

Christian Bauer">Christian Bauer
ViewVC Help
Powered by ViewVC 1.1.15