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

Contents of /benchmarks/timebench2ap.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Fri Jan 28 11:37:45 2000 UTC (13 years, 4 months ago) by kreckel
Branch: cln
CVS Tags: release-1_0_3
Changes since 1.1: +0 -0 lines
- CLN vanilla release 1.0.3.

1 #include <cl_number.h>
2 #include <cl_io.h>
3 #include <cl_integer.h>
4 #include <stdlib.h>
5 #include <string.h>
6 #include <cl_timing.h>
7
8 int main (int argc, char * argv[])
9 {
10 int limit = 1000;
11 int repetitions = 1;
12 while (argc >= 3) {
13 if (!strcmp(argv[1],"-r")) {
14 repetitions = atoi(argv[2]);
15 argc -= 2; argv += 2;
16 continue;
17 }
18 if (!strcmp(argv[1],"-l")) {
19 limit = atoi(argv[2]);
20 argc -= 2; argv += 2;
21 continue;
22 }
23 break;
24 }
25 if (argc < 1)
26 exit(1);
27
28 fprint(cl_stderr, "Limit: ");
29 fprintdecimal(cl_stderr, limit);
30 fprint(cl_stderr, "\n");
31 fprint(cl_stderr, "Number of repetitions: ");
32 fprintdecimal(cl_stderr, repetitions);
33 fprint(cl_stderr, "\n");
34
35 { CL_TIMING;
36 for (int rep = repetitions; rep > 0; rep--)
37 { cl_I u = 1, v = 1, p = 1, q = 1;
38 for (int k = 1; k <= limit; k++)
39 { cl_I w = u+v;
40 u = v; v = w;
41 p = p*w; q = lcm(q,w);
42 }
43 }
44 }
45
46 }

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