* Timings for exhashmap<> operations. */
/*
- * GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
template <class T>
static void run_timing(unsigned size, double &time_insert, double &time_find, double &time_erase)
unsigned result = 0;
cout << "timing hash map operations" << flush;
- clog << "-------hash map operations:" << endl;
unsigned s[] = {10000, 50000, 100000, 500000};
vector<unsigned> sizes(s, s+sizeof(s)/sizeof(*s));
cout << '.' << flush;
}
- if (!result) {
- cout << " passed ";
- clog << "(no output)" << endl;
- } else {
- cout << " failed ";
- }
-
// print the report:
cout << endl << " size:\t";
copy(sizes.begin(), sizes.end(), ostream_iterator<unsigned>(cout, "\t"));
return result;
}
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+ randomify_symbol_serials();
+ cout << setprecision(2) << showpoint;
+ return time_hashmap();
+}