Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Tpetra::Details::HashTable< KeyType, ValueType > Class Template Reference

#include <Tpetra_HashTable_decl.hpp>

Inherits Describable.

Public Member Functions

 HashTable (const int size, const unsigned int seed=(2654435761U))
 
void add (const KeyType key, const ValueType value)
 Add a key and its value to the hash table. More...
 
ValueType get (const KeyType key)
 Get the value corresponding to the given key. More...
 
std::string description () const
 Implementation of Teuchos::Describable. More...
 
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Print this object with the given verbosity to the output stream. More...
 

Detailed Description

template<typename KeyType, typename ValueType>
class Tpetra::Details::HashTable< KeyType, ValueType >

Template Parameters
KeyTypeThe type of the hash table's keys. This must be a built-in signed or unsigned integer type.
ValueTypeThe type of the hash table's values. This must be a built-in signed or unsigned integer type.

This class implements a hash table from signed integer keys to signed integer values. Keys and values may have different types. Tpetra::Map uses this to implement global-to-local index lookup.

The hash table uses an array of fixed size, each entry of which is a singly linked list of buckets.

Definition at line 32 of file Tpetra_HashTable_decl.hpp.

Constructor & Destructor Documentation

template<typename KeyType , typename ValueType >
Tpetra::Details::HashTable< KeyType, ValueType >::HashTable ( const int  size,
const unsigned int  seed = (2654435761U) 
)

Constructor

Parameters
size[in] Number of entries that in the best case, the table should be able to hold without collisions.
seed[in] Seed for the hash function. This parameter is not actually used.

Definition at line 106 of file Tpetra_HashTable_def.hpp.

Member Function Documentation

template<typename KeyType , typename ValueType >
void Tpetra::Details::HashTable< KeyType, ValueType >::add ( const KeyType  key,
const ValueType  value 
)

Add a key and its value to the hash table.

Definition at line 156 of file Tpetra_HashTable_def.hpp.

template<typename KeyType , typename ValueType >
ValueType Tpetra::Details::HashTable< KeyType, ValueType >::get ( const KeyType  key)

Get the value corresponding to the given key.

Definition at line 165 of file Tpetra_HashTable_def.hpp.

template<typename KeyType , typename ValueType >
std::string Tpetra::Details::HashTable< KeyType, ValueType >::description ( ) const

Implementation of Teuchos::Describable.

Return a simple one-line description of this object.

Definition at line 188 of file Tpetra_HashTable_def.hpp.

template<typename KeyType , typename ValueType >
void Tpetra::Details::HashTable< KeyType, ValueType >::describe ( Teuchos::FancyOStream &  out,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const

Print this object with the given verbosity to the output stream.

Definition at line 198 of file Tpetra_HashTable_def.hpp.


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