X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Ftime_hashmap.cpp;h=4d065b216300bfd93ba171e0ddc4e7effb62e34b;hp=5f72c629ee6abf8b9df31130acbd4cd6ab9bc7fc;hb=5745deb8dbcee040d1012b8260ed317eb2a32f4b;hpb=6d225ee55693c0617d254e6fa283c00c71bd2919 diff --git a/check/time_hashmap.cpp b/check/time_hashmap.cpp index 5f72c629..4d065b21 100644 --- a/check/time_hashmap.cpp +++ b/check/time_hashmap.cpp @@ -3,7 +3,7 @@ * Timings for exhashmap<> operations. */ /* - * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2015 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 @@ -17,10 +17,16 @@ * * 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 "ginac.h" +#include "timer.h" +using namespace GiNaC; + +#include +#include +using namespace std; template static void run_timing(unsigned size, double &time_insert, double &time_find, double &time_erase) @@ -67,7 +73,6 @@ unsigned time_hashmap() unsigned result = 0; cout << "timing hash map operations" << flush; - clog << "-------hash map operations:" << endl; unsigned s[] = {10000, 50000, 100000, 500000}; vector sizes(s, s+sizeof(s)/sizeof(*s)); @@ -88,13 +93,6 @@ unsigned time_hashmap() 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(cout, "\t")); @@ -108,3 +106,12 @@ unsigned time_hashmap() return result; } + +extern void randomify_symbol_serials(); + +int main(int argc, char** argv) +{ + randomify_symbol_serials(); + cout << setprecision(2) << showpoint; + return time_hashmap(); +}