* Reworked timing output and increased some timing sizes.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 18 Nov 2005 01:14:21 +0000 (01:14 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 18 Nov 2005 01:14:21 +0000 (01:14 +0000)
25 files changed:
check/time_antipode.cpp
check/time_dennyfliegner.cpp
check/time_fateman_expand.cpp
check/time_gammaseries.cpp
check/time_lw_A.cpp
check/time_lw_B.cpp
check/time_lw_C.cpp
check/time_lw_D.cpp
check/time_lw_E.cpp
check/time_lw_F.cpp
check/time_lw_G.cpp
check/time_lw_H.cpp
check/time_lw_IJKL.cpp
check/time_lw_M1.cpp
check/time_lw_M2.cpp
check/time_lw_N.cpp
check/time_lw_O.cpp
check/time_lw_P.cpp
check/time_lw_Pprime.cpp
check/time_lw_Q.cpp
check/time_lw_Qprime.cpp
check/time_toeplitz.cpp
check/time_vandermonde.cpp
check/timer.cpp
check/times.cpp

index 670e6c2e3d93a82b005b59f7677d262892f92368..50d43be4502aa0d7e28917de4c4184c8eefb542a 100644 (file)
@@ -496,7 +496,7 @@ unsigned time_antipode()
                } else {
                        cout << " failed ";
                }
-               cout << int(1000*jaeger_le_coultre.read())*0.001 << "s (total)" << endl;
+               cout << jaeger_le_coultre.read() << "s (total)" << endl;
        } else {
                cout << " disabled" << endl;
                clog << "(no output)" << endl;
index 8f558a25f1b10485ed4af936e4a1bc2e57827483..b14d1b49be410e51bfa9f4231e3cc9d9c69b245c 100644 (file)
@@ -64,10 +64,10 @@ unsigned time_dennyfliegner()
        vector<double> times;
        timer breitling;
        
-       sizes.push_back(50);
        sizes.push_back(100);
        sizes.push_back(200);
        sizes.push_back(400);
+       sizes.push_back(800);
        
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
                breitling.start();
@@ -85,10 +85,10 @@ unsigned time_dennyfliegner()
        // print the report:
        cout << endl << "       size:  ";
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i)
-               cout << '\t' << (*i);
+               cout << '\t' << *i;
        cout << endl << "       time/s:";
        for (vector<double>::iterator i=times.begin(); i!=times.end(); ++i)
-               cout << '\t' << int(1000*(*i))*0.001;
+               cout << '\t' << *i;
        cout << endl;
        
        return result;
index b0a88e22337758df53e56a170531f4a05d664ef4..f78e8215013c292fff02ca2341a51af15218e88d 100644 (file)
@@ -66,7 +66,7 @@ unsigned time_fateman_expand()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
 
        return result;
 }
index dd049762c99639f4c308354666c3331ab754dc01..3715f836bb334544ca9608e11ce8460e22f51acf 100644 (file)
@@ -54,10 +54,10 @@ unsigned time_gammaseries()
        vector<double> times;
        timer omega;
 
-       sizes.push_back(10);
-       sizes.push_back(15);
        sizes.push_back(20);
        sizes.push_back(25);
+       sizes.push_back(30);
+       sizes.push_back(35);
 
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
                omega.start();
@@ -75,10 +75,10 @@ unsigned time_gammaseries()
        // print the report:
        cout << endl << "       order: ";
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i)
-               cout << '\t' << (*i);
+               cout << '\t' << *i;
        cout << endl << "       time/s:";
        for (vector<double>::iterator i=times.begin(); i!=times.end(); ++i)
-               cout << '\t' << int(1000*(*i))*0.001;
+               cout << '\t' << *i;
        cout << endl;
        
        return result;
index 5df8ac6e50f93c8dafccf51afe2cd5778f823c3f..813145520ceb5bf370465172aa65fefc21b93f96 100644 (file)
@@ -60,7 +60,7 @@ unsigned time_lw_A()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index eb83bda08fea21dd1f41cdf8c2ce50c4699053a7..6fe6138ca3b99ad49236e38cc384991bcca5143a 100644 (file)
@@ -61,7 +61,7 @@ unsigned time_lw_B()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index c64343f5488f5f7e8d7b3019edecf499dc0de181..e6de1717b49c122bb0f50b1fb2b6a15d09590240 100644 (file)
@@ -65,7 +65,7 @@ unsigned time_lw_C()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index 60e2eb6ca782914d6248ffbb4ab6770f8bb99777..55e25069edd8d8d056a3adad0dadacca5c30388d 100644 (file)
@@ -65,7 +65,7 @@ unsigned time_lw_D()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index c2a6a8116df71e9537eddd2d1c93763655c6a2f7..5a4973004997b42abad77bd2f90df18a9efbfa69 100644 (file)
@@ -65,7 +65,7 @@ unsigned time_lw_E()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index ad6be8b3ff74203b2562afea845e8475bc891352..8d8a893454b449dff993593242cd26aa033d9f69 100644 (file)
@@ -62,7 +62,7 @@ unsigned time_lw_F()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index 3b6483a313c7ac22305d2c156adf281987651196..d0578b61a6737acc1cff8a06a65dc08b0ebc5f93 100644 (file)
@@ -65,7 +65,7 @@ unsigned time_lw_G()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index 1750616e55e6ae0c6027c912ac4b4493f8361fe8..efea5761aa313b37489df7a6747621f7eabc4b9f 100644 (file)
@@ -77,7 +77,7 @@ unsigned time_lw_H()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
 
        return result;
 }
index 3572d1f72ce7bd2b1916f04884497e2fd98261d5..4d62fedfcc4d0771995636786864683c18ac6ee5 100644 (file)
@@ -45,7 +45,7 @@ static unsigned test(unsigned n)
        Hinv = H.inverse();
        cout << ". passed ";
        clog << "(no output)" << endl;
-       cout << int(1000*cartier.read())*0.001 << 's' << endl;
+       cout << cartier.read() << 's' << endl;
        
        // check result:
        name = (n==40?'J':(n==70?'L':'?'));
@@ -75,7 +75,7 @@ static unsigned test(unsigned n)
                cout << ". failed ";
                ++result;
        }
-       cout << int(1000*cartier.read())*0.001 << 's' << endl;
+       cout << cartier.read() << 's' << endl;
        return result;
 }
 
index 597a4a72916583bcd67b7430afd992a8c34e4305..8ac2c25beffc78f9ac6dbe3b3ad9192508a6d526 100644 (file)
@@ -97,7 +97,7 @@ unsigned time_lw_M1()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index aa1178a37015ab9247e239257ad34f9d8a2c3986..04218b726be5044926cb144a97665f39ff0221e5 100644 (file)
@@ -174,7 +174,7 @@ unsigned time_lw_M2()
                } else {
                        cout << " failed ";
                }
-               cout << int(1000*(time/count))*0.001 << 's' << endl;
+               cout << time/count << 's' << endl;
        } else {
                cout << " disabled" << endl;
                clog << "(no output)" << endl;
index 77e91a72283321c605b6e463f69587e2b056ecca..36f219d5b888fe1388fe88d34489bf5cec89b27b 100644 (file)
@@ -77,7 +77,7 @@ unsigned time_lw_N()
                } else {
                        cout << " failed ";
                }
-               cout << int(1000*(time/count))*0.001 << 's' << endl;
+               cout << time/count << 's' << endl;
        } else {
                cout << " disabled" << endl;
                clog << "(no output)" << endl;
index 254b39b025084d51ca0ea00bdc1c72c07e7e0f01..5ae917a5a066de1fdcfa9c7bcac8eef862223032 100644 (file)
@@ -148,7 +148,7 @@ unsigned time_lw_O()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/(3*count)))*0.001 << "s (average)" << endl;
+       cout << time/(3*count) << "s (average)" << endl;
 
        cout << "timing Lewis-Wester test O2 (Resultant)" << flush;
        clog << "-------Lewis-Wester test O2 (Resultant):" << endl;
@@ -163,7 +163,7 @@ unsigned time_lw_O()
                } else {
                        cout << " failed ";
                }
-               cout << int(1000*rolex.read())*0.001 << "s (combined)" << endl;
+               cout << rolex.read() << "s (combined)" << endl;
        } else {
                cout << " disabled" << endl;
                clog << "(no output)" << endl;
index 52a430d85e50a4626ac7691b1cce850cbc4f4ac5..e0270d29d4ca20f4b52fbf16d306fc6536fb3056 100644 (file)
@@ -75,7 +75,7 @@ unsigned time_lw_P()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index 19b05591c46d53021ba297f1eb5eaf9ec2d3b1ab..9a5a04b016ae1f13185e80511099fb7ec8929ffe 100644 (file)
@@ -88,7 +88,7 @@ unsigned time_lw_Pprime()
        } else {
                cout << " failed ";
        }
-       cout << int(1000*(time/count))*0.001 << 's' << endl;
+       cout << time/count << 's' << endl;
        
        return result;
 }
index 2a0676930158b7bdc21fc20ec9023fc393e20d92..7fb54f919621a236869c741ee3735afae079a123 100644 (file)
@@ -79,7 +79,7 @@ unsigned time_lw_Q()
                } else {
                        cout << " failed ";
                }
-               cout << int(1000*(time/count))*0.001 << 's' << endl;
+               cout << time/count << 's' << endl;
        } else {
                cout << " disabled" << endl;
                clog << "(no output)" << endl;
index 4abedd1a3880ab9bebf53fdd3971fdff31839ab2..28b30ca9356ac10e65bd40e3a81076b763cf15d8 100644 (file)
@@ -91,7 +91,7 @@ unsigned time_lw_Qprime()
                } else {
                        cout << " failed ";
                }
-               cout << int(1000*(time/count))*0.001 << 's' << endl;
+               cout << time/count << 's' << endl;
        } else {
                cout << " disabled" << endl;
                clog << "(no output)" << endl;
index 20c9a13a2b0899c144ab47204021eba6684ccffe..8c2008ab36976bbead0c24771288347734fd28d4 100644 (file)
@@ -29,7 +29,7 @@ static unsigned toeplitz_det(unsigned size)
 {
        unsigned result = 0;
        const symbol a("a"), b("b");
-       ex p[9] = {ex("a",lst(a,b)),
+       ex p[10] = {ex("a",lst(a,b)),
                   ex("b",lst(a,b)),
                   ex("a+b",lst(a,b)),
                   ex("a^2+a*b+b^2",lst(a,b)),
@@ -37,7 +37,8 @@ static unsigned toeplitz_det(unsigned size)
                   ex("a^4+a^3*b+a^2*b^2+a*b^3+b^4",lst(a,b)),
                   ex("a^5+a^4*b+a^3*b^2-a^2*b^3+a*b^4+b^5",lst(a,b)),
                   ex("a^6+a^5*b+a^4*b^2+a^3*b^3+a^2*b^4+a*b^5+b^6",lst(a,b)),
-                  ex("a^7+a^6*b+a^5*b^2+a^4*b^3-a^3*b^4+a^2*b^5+a*b^6+b^7",lst(a,b))
+                  ex("a^7+a^6*b+a^5*b^2+a^4*b^3-a^3*b^4+a^2*b^5+a*b^6+b^7",lst(a,b)),
+                  ex("a^8+a^7*b+a^6*b^2+a^5*b^3+a^4*b^4+a^3*b^5+a^2*b^6+a*b^7+b^8",lst(a,b))
        };
 
        // construct Toeplitz matrix (diagonal structure: [[x,y,z],[y,x,y],[z,y,x]]):
@@ -74,10 +75,10 @@ unsigned time_toeplitz()
        vector<double> times;
        timer longines;
 
-       sizes.push_back(6);
        sizes.push_back(7);
        sizes.push_back(8);
        sizes.push_back(9);
+       sizes.push_back(10);
 
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
                int count = 1;
@@ -104,7 +105,7 @@ unsigned time_toeplitz()
                cout << '\t' << *i << 'x' << *i;
        cout << endl << "       time/s:";
        for (vector<double>::iterator i=times.begin(); i!=times.end(); ++i)
-               cout << '\t' << int(1000*(*i))*0.001;
+               cout << '\t' << *i;
        cout << endl;
 
        return result;
index 3516ef6de87e72b9a0c4229e787dbf46722eed01..d4f949219ee803c399ee67a8a87455a5b9d1a7c7 100644 (file)
@@ -72,10 +72,10 @@ unsigned time_vandermonde()
        vector<double> times;
        timer swatch;
        
-       sizes.push_back(6);
        sizes.push_back(8);
        sizes.push_back(10);
        sizes.push_back(12);
+       sizes.push_back(14);
        
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
                int count = 1;
@@ -102,7 +102,7 @@ unsigned time_vandermonde()
                cout << '\t' << *i << 'x' << *i;
        cout << endl << "       time/s:";
        for (vector<double>::iterator i=times.begin(); i!=times.end(); ++i)
-               cout << '\t' << int(1000*(*i))*0.001;
+               cout << '\t' << *i;
        cout << endl;
        
        return result;
index b6c3a6b81487dcb34789e6552cf94315cba0d922..0723b8a909c9624805c99832c5deb3fa2db0b710 100644 (file)
@@ -86,18 +86,15 @@ double timer::read()
 #ifdef HAVE_RUSAGE
        if (running())
                getrusage(RUSAGE_SELF, &used2);
-       elapsed = ((used2.ru_utime.tv_sec - used1.ru_utime.tv_sec) +
-                  (used2.ru_stime.tv_sec - used1.ru_stime.tv_sec) +
-                  (used2.ru_utime.tv_usec - used1.ru_utime.tv_usec) * 1e-6 +
-                  (used2.ru_stime.tv_usec - used1.ru_stime.tv_usec) * 1e-6);
+       return ((used2.ru_utime.tv_sec - used1.ru_utime.tv_sec) +
+               (used2.ru_stime.tv_sec - used1.ru_stime.tv_sec) +
+               (used2.ru_utime.tv_usec - used1.ru_utime.tv_usec) * 1e-6 +
+               (used2.ru_stime.tv_usec - used1.ru_stime.tv_usec) * 1e-6);
 #else
        if (running())
                used2 = clock();
-       elapsed = double(used2 - used1)/CLOCKS_PER_SEC;
+       return double(used2 - used1)/CLOCKS_PER_SEC;
 #endif
-       // Results more accurate than 10ms are pointless:
-       return elapsed;
-       return 0.01*int(elapsed*100+0.5);
 }
 
 bool timer::running()
index 8db2c0c642c4989ad1d7d8a4613677b76fa655a9..93d0e131a75872f143315e1326ed75e9a183b1da 100644 (file)
  */
 void randomify_symbol_serials()
 {
-       srand((unsigned)time(NULL));
+       srand(time(NULL));
        const int m = rand() % 666;
        for (int s=0; s<m; ++s ) {
-               symbol* tmp = new symbol;
-               delete tmp;
+               symbol("dummy");
        }
 }
 
@@ -53,6 +52,9 @@ int main()
        randomify_symbol_serials();
 
        unsigned result = 0;
+
+       // For all timings:
+       cout << setprecision(2) << showpoint;
        
 #define TIME(which) \
 try { \