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

Contents of /benchmarks/timebench2ap.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Mon Aug 28 22:07:49 2000 UTC (12 years, 8 months ago) by kreckel
Branch: MAIN
Changes since 1.1: +9 -10 lines
        * All Files have been modified for inclusion of namespace cln;
          I am too lazy for a detailed discussion of all the changes.
          Many identifiers got their `cl_' stripped off.  Ok, this is a
          clumpsy CVS log-entry.  Promise: more will soon go into the
          file ChangeLog.  I apologize for the inconvenience.   :-(

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.2 stderr << "Limit: " << limit << endl;
32     stderr << "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