#include "openhashtable.h" //#include "mathlib.h" #include "tuples.h" UINT_32 Hash(UINT_32& key) { return key; } UINT_32 Hash(const CHAR *pcKey) { UINT_32 v, t; for ( v = 0; *pcKey != '\0'; pcKey++ ) { v = (v << 1) ^ (*pcKey); } t = v >> 10; t ^= (t >> 10); return v ^ t; } // moved to point.cc /* UINT_32 Hash(Point& pt) { } */ // move somewhere? UINT_32 Hash(Pair& lidPr) { return ((31*lidPr.GetFirst()) + (17*lidPr.GetSecond())); //return ((lidPr.GetFirst()) + (lidPr.GetSecond())); //return ((3*lidPr.GetFirst()) + (7*lidPr.GetSecond())); } /* void instantiatehashtables() { UINT_32 i; COpenHashTable Table; DataKeyPair item[2]; Table.Init(); Table.Insert(&i, i); Table.InsertMulti(item, 2); Table.Display(); Table.Peek(i); COpenHashTable Table2; DataKeyPair item2[3]; Point pt; Table2.Init(); Table2.Insert(&i, pt); Table2.InsertMulti(item2, 3); Table2.Display(); Table2.Peek(pt); // Experiment to see if all this instantiation really necessary // (Maybe instantiation needed only with the pragma ?) // COpenHashTable< Pair, Pair > Table3; Pair pr1, pr2; Table3.Init(); Table3.Insert(&pr1, pr2); // Table3.InsertMulti(item2, 3); Table3.Display(); pr2 = *(Table3.Peek(pr1)); // } */