- unsigned result = 0;
-
- cout << "timing commutative expansion and substitution" << flush;
- clog << "-------commutative expansion and substitution:" << endl;
-
- vector<unsigned> sizes;
- vector<double> times;
- timer breitling;
-
- sizes.push_back(25);
- sizes.push_back(50);
- sizes.push_back(100);
- sizes.push_back(200);
-
- for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
- breitling.start();
- result += expand_subs(*i);
- times.push_back(breitling.read());
- cout << '.' << flush;
- }
-
- 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' << int(1000*(*i))*0.001;
- cout << endl;
-
- return result;
+ unsigned result = 0;
+
+ cout << "timing commutative expansion and substitution" << flush;
+ clog << "-------commutative expansion and substitution:" << endl;
+
+ vector<unsigned> sizes;
+ vector<double> times;
+ timer breitling;
+
+ sizes.push_back(50);
+ sizes.push_back(100);
+ sizes.push_back(200);
+ sizes.push_back(400);
+
+ for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
+ breitling.start();
+ result += expand_subs(*i);
+ times.push_back(breitling.read());
+ cout << '.' << flush;
+ }
+
+ 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' << int(1000*(*i))*0.001;
+ cout << endl;
+
+ return result;