OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
tsl::mod_growth_policy< GrowthFactor > Class Template Reference

Detailed Description

template<class GrowthFactor = std::ratio<3, 2>>
class tsl::mod_growth_policy< GrowthFactor >

Grow the map by GrowthFactor::num/GrowthFactorden and use a modulo to map a hash to a bucket. Slower but it can be usefull if you want a slower growth.

Definition at line 150 of file hopscotch_hash.h.

#include <hopscotch_hash.h>

Public Member Functions

 mod_growth_policy (std::size_t &min_bucket_count_in_out)
 
std::size_t bucket_for_hash (std::size_t hash) const
 
std::size_t next_bucket_count () const
 
std::size_t max_bucket_count () const
 

Private Attributes

std::size_t m_bucket_count
 

Static Private Attributes

static const std::size_t MIN_BUCKETS_SIZE = 2
 
static constexpr double REHASH_SIZE_MULTIPLICATION_FACTOR = 1.0*GrowthFactor::num/GrowthFactor::den
 
static const std::size_t MAX_BUCKET_COUNT
 

Constructor & Destructor Documentation

◆ mod_growth_policy()

template<class GrowthFactor = std::ratio<3, 2>>
tsl::mod_growth_policy< GrowthFactor >::mod_growth_policy ( std::size_t &  min_bucket_count_in_out)
inline

Definition at line 152 of file hopscotch_hash.h.

Member Function Documentation

◆ bucket_for_hash()

template<class GrowthFactor = std::ratio<3, 2>>
std::size_t tsl::mod_growth_policy< GrowthFactor >::bucket_for_hash ( std::size_t  hash) const
inline

Definition at line 164 of file hopscotch_hash.h.

◆ max_bucket_count()

template<class GrowthFactor = std::ratio<3, 2>>
std::size_t tsl::mod_growth_policy< GrowthFactor >::max_bucket_count ( ) const
inline

Definition at line 187 of file hopscotch_hash.h.

◆ next_bucket_count()

template<class GrowthFactor = std::ratio<3, 2>>
std::size_t tsl::mod_growth_policy< GrowthFactor >::next_bucket_count ( ) const
inline

Definition at line 169 of file hopscotch_hash.h.

Field Documentation

◆ m_bucket_count

template<class GrowthFactor = std::ratio<3, 2>>
std::size_t tsl::mod_growth_policy< GrowthFactor >::m_bucket_count
private

Definition at line 201 of file hopscotch_hash.h.

◆ MAX_BUCKET_COUNT

template<class GrowthFactor = std::ratio<3, 2>>
const std::size_t tsl::mod_growth_policy< GrowthFactor >::MAX_BUCKET_COUNT
staticprivate
Initial value:
=
std::size_t(double(
std::numeric_limits<std::size_t>::max()/REHASH_SIZE_MULTIPLICATION_FACTOR
))

Definition at line 194 of file hopscotch_hash.h.

◆ MIN_BUCKETS_SIZE

template<class GrowthFactor = std::ratio<3, 2>>
const std::size_t tsl::mod_growth_policy< GrowthFactor >::MIN_BUCKETS_SIZE = 2
staticprivate

Definition at line 192 of file hopscotch_hash.h.

◆ REHASH_SIZE_MULTIPLICATION_FACTOR

template<class GrowthFactor = std::ratio<3, 2>>
constexpr double tsl::mod_growth_policy< GrowthFactor >::REHASH_SIZE_MULTIPLICATION_FACTOR = 1.0*GrowthFactor::num/GrowthFactor::den
staticconstexprprivate

Definition at line 193 of file hopscotch_hash.h.


The documentation for this class was generated from the following file: