DeSiGNAR  0.5a
Data Structures General Library
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
Designar::LHashTable< Key, Cmp > Class Template Reference

#include <hash.H>

Inheritance diagram for Designar::LHashTable< Key, Cmp >:
Inheritance graph
[legend]
Collaboration diagram for Designar::LHashTable< Key, Cmp >:
Collaboration graph
[legend]

Classes

class  Iterator
 

Public Types

using ItemType = Key
 
using KeyType = Key
 
using DataType = Key
 
using ValueType = Key
 
using SizeType = nat_t
 
using CmpType = Cmp
 
using HashFctPtr = nat_t(*)(const Key &)
 
using HashFctType = std::function< nat_t(const Key &)>
 

Public Member Functions

 LHashTable (nat_t size, Cmp &_cmp, HashFctType fct, real_t _lower_alpha, real_t _upper_alpha)
 
 LHashTable (nat_t size, Cmp &_cmp, HashFctType fct)
 
 LHashTable (nat_t size, Cmp &&_cmp, HashFctType fct)
 
 LHashTable (nat_t size, Cmp &_cmp, HashFctPtr fct=&super_fast_hash)
 
 LHashTable (nat_t size, Cmp &&_cmp=Cmp(), HashFctPtr fct=&super_fast_hash)
 
 LHashTable (Cmp &_cmp, HashFctType fct)
 
 LHashTable (Cmp &&_cmp, HashFctType fct)
 
 LHashTable (Cmp &_cmp, HashFctPtr fct=&super_fast_hash)
 
 LHashTable (Cmp &&_cmp=Cmp(), HashFctPtr fct=&super_fast_hash)
 
 LHashTable (const LHashTable &h)
 
 LHashTable (LHashTable &&h)
 
 LHashTable (const std::initializer_list< Key > &)
 
LHashTableoperator= (const LHashTable &h)
 
LHashTableoperator= (LHashTable &&h)
 
void swap (LHashTable &h)
 
Cmp & get_cmp ()
 
const Cmp & get_cmp () const
 
const HashFctTypeget_hash_fct () const
 
real_t get_lower_alpha () const
 
real_t get_upper_alpha () const
 
void set_lower_alpha (real_t value)
 
void set_upper_alpha (real_t value)
 
void reset_alpha_values ()
 
real_t alpha () const
 
bool is_empty () const
 
nat_t size () const
 
nat_t N () const
 
nat_t M () const
 
void clear ()
 
Key * insert (const Key &item)
 
Key * insert (Key &&item)
 
Key * insert_dup (const Key &item)
 
Key * insert_dup (Key &&item)
 
Key * append (const Key &k)
 
Key * append (Key &&k)
 
Key * append_dup (const Key &k)
 
Key * append_dup (Key &&k)
 
Key * search (const Key &k)
 
const Key * search (const Key &k) const
 
Key * search_or_insert (const Key &item)
 
Key * search_or_insert (Key &&item)
 
Key & find (const Key &k)
 
const Key & find (const Key &k) const
 
bool remove (const Key &k)
 
Iterator begin ()
 
Iterator begin () const
 
Iterator end ()
 
Iterator end () const
 
- Public Member Functions inherited from Designar::ContainerAlgorithms< LHashTable< Key, Cmp >, Key >
Key * nth_ptr (nat_t i)
 
Key & nth (nat_t i)
 
const Key & nth (nat_t i) const
 
void for_each (Op &op) const
 
void for_each (Op &&op=Op()) const
 
ContainerRet filter (Pred &pred) const
 
ContainerRet filter (Pred &&pred=Pred()) const
 
ContainerRet map (Op &op) const
 
ContainerRet map (Op &&op=Op()) const
 
ContainerRet map_if (Op &op, Pred &pred) const
 
ContainerRet map_if (Op &op, Pred &&pred=Pred()) const
 
ContainerRet map_if (Op &&op, Pred &pred) const
 
ContainerRet map_if (Op &&op=Op(), Pred &&pred=Pred()) const
 
RetT fold (const RetT &init_val, Op &op) const
 
RetT fold (const RetT &init_val, Op &&op=Op()) const
 
RetT fold (RetT &&init_val, Op &op) const
 
RetT fold (RetT &&init_val, Op &&op=Op()) const
 
bool all (Pred &pred) const
 
bool all (Pred &&pred=Pred()) const
 
bool exists (Pred &pred) const
 
bool exists (Pred &&pred=Pred()) const
 
bool none (Pred &pred) const
 
bool none (Pred &&pred=Pred()) const
 
Key * search_ptr (Pred &pred) const
 
Key * search_ptr (Pred &&pred=Pred()) const
 
bool remove_first_if (Pred &pred)
 
bool remove_first_if (Pred &&pred=Pred())
 
void remove_if (Pred &pred)
 
void remove_if (Pred &&pred=Pred())
 
bool equal (const ContainerType2 &c, Eq &eq) const
 
bool equal (const ContainerType2 &c, Eq &&eq=Eq()) const
 
bool is_sorted (Cmp &cmp) const
 
bool is_sorted (Cmp &&cmp=Cmp()) const
 
SLList< std::pair< Key, typename ContainerType2::KeyType > > zip (const ContainerType2 &c) const
 
SLList< std::pair< Key, typename ContainerType2::KeyType > > zip_eq (const ContainerType2 &c) const
 
SLList< std::pair< Key, typename ContainerType2::KeyType > > zip_left (const ContainerType2 &c) const
 
SLList< std::pair< Key, typename ContainerType2::KeyType > > zip_right (const ContainerType2 &c) const
 
DynArray< Key > to_array () const
 
SLList< Key > to_list () const
 
- Public Member Functions inherited from Designar::SetAlgorithms< LHashTable< Key, Cmp >, Key >
bool contains (const Key &k) const
 
bool has (const Key &k) const
 
LHashTable< Key, Cmp > join (const LHashTable< Key, Cmp > &s) const
 
LHashTable< Key, Cmp > intersect (const LHashTable< Key, Cmp > &s) const
 
LHashTable< Key, Cmp > difference (const LHashTable< Key, Cmp > &s) const
 
SLList< std::pair< Key, typename SetType2::KeyType > > cartesian_product (const SetType2 &s) const
 

Static Public Attributes

static constexpr nat_t DFT_SIZE = 32
 
static constexpr real_t DFT_LOWER_ALPHA = 0.25
 
static constexpr real_t DFT_UPPER_ALPHA = 0.75
 

Additional Inherited Members

- Static Public Member Functions inherited from Designar::SetAlgorithms< LHashTable< Key, Cmp >, Key >
static LHashTable< Key, Cmp > join (const LHashTable< Key, Cmp > &s1, const LHashTable< Key, Cmp > &s2)
 
static LHashTable< Key, Cmp > intersect (const LHashTable< Key, Cmp > &s1, const LHashTable< Key, Cmp > &s2)
 
static LHashTable< Key, Cmp > difference (const LHashTable< Key, Cmp > &s1, const LHashTable< Key, Cmp > &s2)
 
static SLList< std::pair< Key, typename SetType2::KeyType > > cartesian_product (const LHashTable< Key, Cmp > &s1, const SetType2 &s2)
 

Member Typedef Documentation

template<typename Key, class Cmp = std::equal_to<Key>>
using Designar::LHashTable< Key, Cmp >::CmpType = Cmp
template<typename Key, class Cmp = std::equal_to<Key>>
using Designar::LHashTable< Key, Cmp >::DataType = Key
template<typename Key, class Cmp = std::equal_to<Key>>
using Designar::LHashTable< Key, Cmp >::HashFctPtr = nat_t (*) (const Key &)
template<typename Key, class Cmp = std::equal_to<Key>>
using Designar::LHashTable< Key, Cmp >::HashFctType = std::function<nat_t(const Key &)>
template<typename Key, class Cmp = std::equal_to<Key>>
using Designar::LHashTable< Key, Cmp >::ItemType = Key
template<typename Key, class Cmp = std::equal_to<Key>>
using Designar::LHashTable< Key, Cmp >::KeyType = Key
template<typename Key, class Cmp = std::equal_to<Key>>
using Designar::LHashTable< Key, Cmp >::SizeType = nat_t
template<typename Key, class Cmp = std::equal_to<Key>>
using Designar::LHashTable< Key, Cmp >::ValueType = Key

Constructor & Destructor Documentation

template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( nat_t  size,
Cmp &  _cmp,
HashFctType  fct,
real_t  _lower_alpha,
real_t  _upper_alpha 
)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( nat_t  size,
Cmp &  _cmp,
HashFctType  fct 
)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( nat_t  size,
Cmp &&  _cmp,
HashFctType  fct 
)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( nat_t  size,
Cmp &  _cmp,
HashFctPtr  fct = &super_fast_hash 
)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( nat_t  size,
Cmp &&  _cmp = Cmp(),
HashFctPtr  fct = &super_fast_hash 
)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( Cmp &  _cmp,
HashFctType  fct 
)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( Cmp &&  _cmp,
HashFctType  fct 
)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( Cmp &  _cmp,
HashFctPtr  fct = &super_fast_hash 
)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( Cmp &&  _cmp = Cmp(),
HashFctPtr  fct = &super_fast_hash 
)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( const LHashTable< Key, Cmp > &  h)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Designar::LHashTable< Key, Cmp >::LHashTable ( LHashTable< Key, Cmp > &&  h)
inline
template<typename Key, class Cmp>
Designar::LHashTable< Key, Cmp >::LHashTable ( const std::initializer_list< Key > &  l)

Member Function Documentation

template<typename Key, class Cmp = std::equal_to<Key>>
real_t Designar::LHashTable< Key, Cmp >::alpha ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::append ( const Key &  k)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::append ( Key &&  k)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::append_dup ( const Key &  k)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::append_dup ( Key &&  k)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Iterator Designar::LHashTable< Key, Cmp >::begin ( )
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Iterator Designar::LHashTable< Key, Cmp >::begin ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
void Designar::LHashTable< Key, Cmp >::clear ( )
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Iterator Designar::LHashTable< Key, Cmp >::end ( )
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Iterator Designar::LHashTable< Key, Cmp >::end ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key& Designar::LHashTable< Key, Cmp >::find ( const Key &  k)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
const Key& Designar::LHashTable< Key, Cmp >::find ( const Key &  k) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Cmp& Designar::LHashTable< Key, Cmp >::get_cmp ( )
inline
template<typename Key, class Cmp = std::equal_to<Key>>
const Cmp& Designar::LHashTable< Key, Cmp >::get_cmp ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
const HashFctType& Designar::LHashTable< Key, Cmp >::get_hash_fct ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
real_t Designar::LHashTable< Key, Cmp >::get_lower_alpha ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
real_t Designar::LHashTable< Key, Cmp >::get_upper_alpha ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::insert ( const Key &  item)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::insert ( Key &&  item)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::insert_dup ( const Key &  item)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::insert_dup ( Key &&  item)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
bool Designar::LHashTable< Key, Cmp >::is_empty ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
nat_t Designar::LHashTable< Key, Cmp >::M ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
nat_t Designar::LHashTable< Key, Cmp >::N ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
LHashTable& Designar::LHashTable< Key, Cmp >::operator= ( const LHashTable< Key, Cmp > &  h)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
LHashTable& Designar::LHashTable< Key, Cmp >::operator= ( LHashTable< Key, Cmp > &&  h)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
bool Designar::LHashTable< Key, Cmp >::remove ( const Key &  k)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
void Designar::LHashTable< Key, Cmp >::reset_alpha_values ( )
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::search ( const Key &  k)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
const Key* Designar::LHashTable< Key, Cmp >::search ( const Key &  k) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::search_or_insert ( const Key &  item)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
Key* Designar::LHashTable< Key, Cmp >::search_or_insert ( Key &&  item)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
void Designar::LHashTable< Key, Cmp >::set_lower_alpha ( real_t  value)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
void Designar::LHashTable< Key, Cmp >::set_upper_alpha ( real_t  value)
inline
template<typename Key, class Cmp = std::equal_to<Key>>
nat_t Designar::LHashTable< Key, Cmp >::size ( ) const
inline
template<typename Key, class Cmp = std::equal_to<Key>>
void Designar::LHashTable< Key, Cmp >::swap ( LHashTable< Key, Cmp > &  h)
inline

Member Data Documentation

template<typename Key, class Cmp = std::equal_to<Key>>
constexpr real_t Designar::LHashTable< Key, Cmp >::DFT_LOWER_ALPHA = 0.25
static
template<typename Key, class Cmp = std::equal_to<Key>>
constexpr nat_t Designar::LHashTable< Key, Cmp >::DFT_SIZE = 32
static
template<typename Key, class Cmp = std::equal_to<Key>>
constexpr real_t Designar::LHashTable< Key, Cmp >::DFT_UPPER_ALPHA = 0.75
static

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