00001
00002
00003 #ifndef _HASHRANDOM_H
00004 #define _HASHRANDOM_H
00005
00006 #include "osl/hash/hashKey.h"
00007
00008 namespace osl
00009 {
00010 namespace hash
00011 {
00012 class HashRandom
00013 {
00014 public:
00015 static const size_t Length = 0x1000;
00016 private:
00017 static int table[Length];
00018 public:
00019 static void setUp(double sigma);
00020 static int value(size_t key)
00021 {
00022 return table[key % Length];
00023 }
00024 static int value(const HashKey& key)
00025 {
00026 return value(key.signature());
00027 }
00028 };
00029 }
00030 using hash::HashRandom;
00031 }
00032
00033 #endif
00034
00035
00036
00037