Tpetra Matrix/Vector Services Version of the Day
Public Member Functions
Tpetra::Details::HashTable< KeyType, ValueType > Class Template Reference

#include <Tpetra_HashTable_decl.hpp>

Inheritance diagram for Tpetra::Details::HashTable< KeyType, ValueType >:
Inheritance graph
[legend]

List of all members.

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.
ValueType get (const KeyType key)
 Get the value corresponding to the given key.
std::string description () const
 Implementation of Teuchos::Describable.
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.

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 unsinged 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 66 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 144 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 194 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 203 of file Tpetra_HashTable_def.hpp.

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

Implementation of Teuchos::Describable.

Return a simple one-line description of this object.

Reimplemented from Teuchos::Describable.

Definition at line 226 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 [virtual]

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

Reimplemented from Teuchos::Describable.

Definition at line 236 of file Tpetra_HashTable_def.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines