Files Classes Functions Hierarchy
#include <unitdouble.h>
Public Member Functions | |
| uintc | index (doublec &x) const |
| The hash function. | |
| boolc | operator() (doublec &a, doublec &b) const |
| Compare two doubles. | |
| unitdouble (uintc bucketsize_) | |
| Construct the hash function. | |
Public Attributes | |
| uintc | bucketsize |
| Configures the number of buckets. | |
This is a hash function for a uniform distribution. It is assumend the double has been normalized: 0.0 < x < 1.0
Definition at line 12 of file unitdouble.h.
| unitdouble::unitdouble | ( | uintc | bucketsize_ | ) | [inline] |
Construct the hash function.
Definition at line 30 of file unitdouble.h.
00031 : bucketsize(bucketsize_) {}
The hash function.
Definition at line 19 of file unitdouble.h.
References bucketsize.
00020 { return (uint)((x*bucketsize)) % bucketsize; }
Configures the number of buckets.
Definition at line 17 of file unitdouble.h.
Referenced by index().
1.5.8