3 * Main program that calls the individual timings. */
6 * GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 /** Generate a random amount of symbols and destroy them again immediatly.
27 * This operation effectively makes the serial numbers of all subsequent
28 * symbols unpredictable. If the serials are unpredictable, then so are
29 * their hash values. If the hash values are unpredictable, then so are
30 * the canonical orderings. If the canonical orderings are unpredictable,
31 * all subsequent times are subject to some variation. This variation,
32 * however is natural and desireable for two reasons: First, we cannot know
33 * how many symbols have been generated before in real world computations.
34 * Second, the following timings are subject to some semi-random variation
35 * anyways because short timings need to be repeated until enough time has
36 * gone by for the measurement to be reliable. During this process the serial
37 * numbers will be shifted anyways in a semi-random way. It is better not
38 * to lull the user in a false sense of reproducibility and instead confront
39 * her with the normal variation to be expected.
41 void randomify_symbol_serials()
44 const int m = rand() % 666;
45 for (int s=0; s<m; ++s ) {
52 randomify_symbol_serials();
57 cout << setprecision(2) << showpoint;
61 result += time_ ## which (); \
62 } catch (const exception &e) { \
63 cout << "Error: caught exception " << e.what() << endl; \
93 cout << "Error: something went wrong. ";
95 cout << "(one failure)" << endl;
97 cout << "(" << result << " individual failures)" << endl;
99 cout << "please check times.out against times.ref for more details."
100 << endl << "happy debugging!" << endl;