From c366868eb54d79cd21eeb27e99ed3d4e5c146a2c Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 3 Apr 2016 22:19:08 +0300 Subject: [PATCH] Improved docs --- cds/container/cuckoo_map.h | 10 +++++----- cds/container/cuckoo_set.h | 8 ++++---- cds/intrusive/cuckoo_set.h | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cds/container/cuckoo_map.h b/cds/container/cuckoo_map.h index 6423e161..fd7df5dc 100644 --- a/cds/container/cuckoo_map.h +++ b/cds/container/cuckoo_map.h @@ -122,7 +122,7 @@ namespace cds { namespace container { About Cuckoo hashing [From "The Art of Multiprocessor Programming"] - Cuckoo hashing is a hashing algorithm in which a newly added item displaces any earlier item + Cuckoo hashing is a hashing algorithm in which a newly added item displaces any earlier item occupying the same slot. For brevity, a table is a k-entry array of items. For a hash set f size N = 2k we use a two-entry array of tables, and two independent hash functions, h0, h1: KeyRange -> 0,...,k-1 @@ -160,14 +160,14 @@ namespace cds { namespace container { the average search complexity is O(PROBE_SET/2). However, the overhead of sorting can eliminate a gain of ordered search. - The probe set is ordered if opt::compare or opt::less is specified in \p %CuckooSet - declaration. Otherwise, the probe set is unordered and \p %CuckooSet must contain - opt::equal_to option. + The probe set is ordered if \p compare or \p less is specified in \p Traits + template parameter. Otherwise, the probe set is unordered and \p Traits must contain + \p equal_to predicate. Template arguments: - \p Key - key type - \p T - the type stored in the map. - - \p Traits - map traits., default is \p cuckoo::traits. + - \p Traits - map traits, default is \p cuckoo::traits. It is possible to declare option-based set with \p cuckoo::make_traits metafunction result as \p Traits template argument. diff --git a/cds/container/cuckoo_set.h b/cds/container/cuckoo_set.h index fdea6781..49a131b3 100644 --- a/cds/container/cuckoo_set.h +++ b/cds/container/cuckoo_set.h @@ -117,7 +117,7 @@ namespace cds { namespace container { About Cuckoo hashing [From "The Art of Multiprocessor Programming"] - Cuckoo hashing is a hashing algorithm in which a newly added item displaces any earlier item + Cuckoo hashing is a hashing algorithm in which a newly added item displaces any earlier item occupying the same slot. For brevity, a table is a k-entry array of items. For a hash set f size N = 2k we use a two-entry array of tables, and two independent hash functions, h0, h1: KeyRange -> 0,...,k-1 @@ -155,9 +155,9 @@ namespace cds { namespace container { the average search complexity is O(PROBE_SET/2). However, the overhead of sorting can eliminate a gain of ordered search. - The probe set is ordered if opt::compare or opt::less is specified in \p %CuckooSet - declaration. Otherwise, the probe set is unordered and \p %CuckooSet must contain - opt::equal_to option. + The probe set is ordered if \p compare or \p less is specified in \p Traits + template parameter. Otherwise, the probe set is unordered and \p Traits must contain + \p equal_to predicate. Template arguments: - \p T - the type stored in the set. diff --git a/cds/intrusive/cuckoo_set.h b/cds/intrusive/cuckoo_set.h index 09b3cb40..09c16590 100644 --- a/cds/intrusive/cuckoo_set.h +++ b/cds/intrusive/cuckoo_set.h @@ -1613,7 +1613,7 @@ namespace cds { namespace intrusive { About Cuckoo hashing [From "The Art of Multiprocessor Programming"] - Cuckoo hashing is a hashing algorithm in which a newly added item displaces any earlier item + Cuckoo hashing is a hashing algorithm in which a newly added item displaces any earlier item occupying the same slot. For brevity, a table is a k-entry array of items. For a hash set f size N = 2k we use a two-entry array of tables, and two independent hash functions, h0, h1: KeyRange -> 0,...,k-1 @@ -1651,9 +1651,9 @@ namespace cds { namespace intrusive { the average search complexity is O(PROBE_SET/2). However, the overhead of sorting can eliminate a gain of ordered search. - The probe set is ordered if \p opt::compare or \p opt::less is specified in \p Traits template + The probe set is ordered if \p compare or \p less is specified in \p Traits template parameter. Otherwise, the probe set is unordered and \p Traits should provide - \p opt::equal_to option. + \p equal_to predicate. The \p cds::intrusive::cuckoo namespace contains \p %CuckooSet-related declarations. -- 2.34.1