cuckoo
11 years agoadd nelements method and few small fixes master
Christian Thaeter [Wed, 16 Apr 2008 20:07:40 +0000 (22:07 +0200)]
add nelements method and few small fixes

11 years agoconst correction, gives some speed improvement when optimization is on
Christian Thaeter [Thu, 27 Mar 2008 16:02:12 +0000 (17:02 +0100)]
const correction, gives some speed improvement when optimization is on

11 years agoanother small optimization
Christian Thaeter [Tue, 25 Mar 2008 20:44:16 +0000 (21:44 +0100)]
another small optimization

11 years agoSome optimizations
Christian Thaeter [Tue, 25 Mar 2008 20:12:45 +0000 (21:12 +0100)]
Some optimizations

itemsize must be a multiple of 'sizeof(int)',
this allows some big optimizations.

11 years agoreenable compacting
Christian Thaeter [Tue, 25 Mar 2008 19:10:51 +0000 (20:10 +0100)]
reenable compacting

11 years agonew API, pass only a item pointer instead key/value pairs single_item
Christian Thaeter [Tue, 25 Mar 2008 15:35:44 +0000 (16:35 +0100)]
new API, pass only a item pointer instead key/value pairs

Itemsize is now a construction parameter and not compiletime defined.

cuckoo_compact() is currently broken and WIP

11 years agoRemove autocompact control from 'cuckoo_reserve()'
Christian Thaeter [Sat, 1 Mar 2008 13:38:16 +0000 (14:38 +0100)]
Remove autocompact control from 'cuckoo_reserve()'

let a manual 'cuckoo_compact()' reenable autocompacting

11 years agochange startsize to take 2's exponent instead direct size
Christian Thaeter [Thu, 28 Feb 2008 11:59:47 +0000 (12:59 +0100)]
change startsize to take 2's exponent instead direct size

11 years agoAdded programmers documentation
Christian Thaeter [Wed, 27 Feb 2008 21:50:08 +0000 (22:50 +0100)]
Added programmers documentation

11 years agosmall fixes and cleanup
Christian Thaeter [Wed, 27 Feb 2008 21:35:45 +0000 (22:35 +0100)]
small fixes and cleanup

removed the autocompact function,
cuckoo_reserve controls autocompacting too

11 years agomove keys inside the hash, instead using references
Christian Thaeter [Wed, 27 Feb 2008 18:05:16 +0000 (19:05 +0100)]
move keys inside the hash, instead using references

11 years agoCuckoo hashing implementation
Christian Thaeter [Wed, 27 Feb 2008 17:00:17 +0000 (18:00 +0100)]
Cuckoo hashing implementation

 * amortized O(1) inserts
 * O(1) lookup
 * amortized O(1) remove (with automatic shrinking)
 * O(1) remove w/o automatic shrinking
 * automatic growing / shrinking
 * prereserve inserts to guarantee O(1) complexity
 * toggle automatic shrinking off to guarantee O(1) removes