- unsigned result = 0;
-
- cout << "timing commutative expansion and substitution" << flush;
- clog << "-------commutative expansion and substitution:" << endl;
-
- vector<unsigned> sizes;
- vector<double> times;
- timer rolex;
-
- sizes.push_back(40);
- sizes.push_back(60);
- sizes.push_back(100);
- sizes.push_back(150);
-
- for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
- rolex.start();
- result += expand_subs(*i); cout << '.' << flush;
- times.push_back(rolex.read());
- }
-
- if (!result) {
- cout << " passed ";
- clog << "(no output)" << endl;
- } else {
- cout << " failed ";
- }
- // print the report:
- cout << endl << " size: ";
- for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
- cout << '\t' << (*i);
- }
- cout << endl << " time/s:";
- for (vector<double>::iterator i=times.begin(); i!=times.end(); ++i) {
- cout << '\t' << (*i);
- }
- cout << endl;
-
- return result;
+ unsigned result = 0;
+
+ cout << "timing commutative expansion and substitution" << flush;
+
+ vector<unsigned> sizes = {100, 200, 400, 800};
+ vector<double> times;
+ timer breitling;
+
+ for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
+ breitling.start();
+ result += expand_subs(*i);
+ times.push_back(breitling.read());
+ cout << '.' << flush;
+ }
+
+ // print the report:
+ cout << endl << " size: ";
+ for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i)
+ cout << '\t' << *i;
+ cout << endl << " time/s:";
+ for (vector<double>::iterator i=times.begin(); i!=times.end(); ++i)
+ cout << '\t' << *i;
+ cout << endl;
+
+ return result;
+}
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+ randomify_symbol_serials();
+ cout << setprecision(2) << showpoint;
+ return time_dennyfliegner();