Ifpack Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TIfpack_HashTable< key_type > Class Template Reference

#include <Ifpack_HashTable.h>

Inheritance diagram for TIfpack_HashTable< key_type >:
Inheritance graph
[legend]

Public Member Functions

 TIfpack_HashTable (const int n_keys=1031, const int n_sets=1)
 constructor. More...
 
double get (const key_type key)
 Returns an element from the hash table, or 0.0 if not found. More...
 
void set (const key_type key, const double value, const bool addToValue=false)
 Sets an element in the hash table. More...
 
void reset ()
 Resets the entries of the already allocated memory. This method can be used to clean an array, to be reused without additional memory allocation/deallocation. More...
 
int getNumEntries () const
 Returns the number of stored entries. More...
 
void arrayify (key_type *key_array, double *val_array)
 Converts the contents in array format for both keys and values. More...
 
void print ()
 Basic printing routine. More...
 
int getRecommendedHashSize (int n)
 

Private Member Functions

int doHash (const key_type key)
 Performs the hashing. More...
 

Private Attributes

int n_keys_
 
int n_sets_
 
std::vector< std::vector
< double > > 
vals_
 
std::vector< std::vector
< key_type > > 
keys_
 
std::vector< int > counter_
 
unsigned int seed_
 

Detailed Description

template<typename key_type>
class TIfpack_HashTable< key_type >

Definition at line 89 of file Ifpack_HashTable.h.

Constructor & Destructor Documentation

template<typename key_type>
TIfpack_HashTable< key_type >::TIfpack_HashTable ( const int  n_keys = 1031,
const int  n_sets = 1 
)
inline

constructor.

Definition at line 93 of file Ifpack_HashTable.h.

Member Function Documentation

template<typename key_type>
double TIfpack_HashTable< key_type >::get ( const key_type  key)
inline

Returns an element from the hash table, or 0.0 if not found.

Definition at line 116 of file Ifpack_HashTable.h.

template<typename key_type>
void TIfpack_HashTable< key_type >::set ( const key_type  key,
const double  value,
const bool  addToValue = false 
)
inline

Sets an element in the hash table.

Definition at line 130 of file Ifpack_HashTable.h.

template<typename key_type>
void TIfpack_HashTable< key_type >::reset ( )
inline

Resets the entries of the already allocated memory. This method can be used to clean an array, to be reused without additional memory allocation/deallocation.

Definition at line 174 of file Ifpack_HashTable.h.

template<typename key_type>
int TIfpack_HashTable< key_type >::getNumEntries ( ) const
inline

Returns the number of stored entries.

Definition at line 180 of file Ifpack_HashTable.h.

template<typename key_type>
void TIfpack_HashTable< key_type >::arrayify ( key_type *  key_array,
double *  val_array 
)
inline

Converts the contents in array format for both keys and values.

Definition at line 189 of file Ifpack_HashTable.h.

template<typename key_type>
void TIfpack_HashTable< key_type >::print ( )
inline

Basic printing routine.

Definition at line 202 of file Ifpack_HashTable.h.

template<typename key_type>
int TIfpack_HashTable< key_type >::getRecommendedHashSize ( int  n)
inline

Definition at line 211 of file Ifpack_HashTable.h.

template<typename key_type>
int TIfpack_HashTable< key_type >::doHash ( const key_type  key)
inlineprivate

Performs the hashing.

Definition at line 244 of file Ifpack_HashTable.h.

Member Data Documentation

template<typename key_type>
int TIfpack_HashTable< key_type >::n_keys_
private

Definition at line 250 of file Ifpack_HashTable.h.

template<typename key_type>
int TIfpack_HashTable< key_type >::n_sets_
private

Definition at line 251 of file Ifpack_HashTable.h.

template<typename key_type>
std::vector<std::vector<double> > TIfpack_HashTable< key_type >::vals_
private

Definition at line 252 of file Ifpack_HashTable.h.

template<typename key_type>
std::vector<std::vector<key_type> > TIfpack_HashTable< key_type >::keys_
private

Definition at line 253 of file Ifpack_HashTable.h.

template<typename key_type>
std::vector<int> TIfpack_HashTable< key_type >::counter_
private

Definition at line 254 of file Ifpack_HashTable.h.

template<typename key_type>
unsigned int TIfpack_HashTable< key_type >::seed_
private

Definition at line 255 of file Ifpack_HashTable.h.


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