proj home

Files   Classes   Functions   Hierarchy  

hashfunction01.cpp

Go to the documentation of this file.
00001 #include <hashfunction01.h>
00002 
00003 
00004 hashfunction01::hashfunction01()
00005   : nloops(0) {}
00006 
00007 hashfunction01::hashfunction01(uintc loops_)
00008   : nloops(loops_) {}
00009 
00010 
00011 uintc hashfunction01::operator()( uintc key) const 
00012 {
00013   uint h = key;
00014   uint i;
00015 
00016   assert(nloops!=0);
00017 
00018   for (i=0; i<nloops; ++i)
00019   {
00020     h += ~(h << 15);
00021     h ^=  (h >> 10);
00022     h +=  (h << 3);
00023     h ^=  (h >> 6);
00024     h += ~(h << 11);
00025     h ^=  (h >> 10);
00026   }
00027 
00028   return h;
00029 }
00030 
00031 

Generated on Fri Mar 4 00:49:26 2011 for Chelton Evans Source by  doxygen 1.5.8