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

Contents of /benchmarks/timebench2ap.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Fri Nov 24 20:51:06 2000 UTC (12 years, 6 months ago) by kreckel
Branch: MAIN
CVS Tags: cln_1-1-1, cln_1-1-0, cln_1-1-3, cln_1-1-2, cln_1-1-5, cln_1-1-4, cln_1-1-7, cln_1-1-6
Changes since 1.2: +2 -2 lines
        * */*: Removed problematic stdin, stdout and stderr definitions.
          Use std::cin, std::cout, std::cerr instead (obsoletes 2000-10-29).

1 kreckel 1.2 #include <cln/number.h>
2     #include <cln/io.h>
3     #include <cln/integer.h>
4 kreckel 1.1 #include <stdlib.h>
5     #include <string.h>
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