Ifpack Package Browser (Single Doxygen Collection) Development
Public Member Functions | Private Member Functions | Private Attributes
Ifpack_HashTable Class Reference

#include <Ifpack_HashTable.h>

List of all members.

Public Member Functions

 Ifpack_HashTable (const int n_keys=1031, const int n_sets=1)
 constructor.
double get (const int key)
 Returns an element from the hash table, or 0.0 if not found.
void set (const int key, const double value, const bool addToValue=false)
 Sets an element in the hash table.
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.
int getNumEntries () const
 Returns the number of stored entries.
void arrayify (int *key_array, double *val_array)
 Converts the contents in array format for both keys and values.
void print ()
 Basic printing routine.
int getRecommendedHashSize (int n)

Private Member Functions

int doHash (const int key)
 Performs the hashing.

Private Attributes

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

Detailed Description

Definition at line 77 of file Ifpack_HashTable.h.


Constructor & Destructor Documentation

Ifpack_HashTable::Ifpack_HashTable ( const int  n_keys = 1031,
const int  n_sets = 1 
) [inline]

constructor.

Definition at line 81 of file Ifpack_HashTable.h.


Member Function Documentation

double Ifpack_HashTable::get ( const int  key) [inline]

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

Definition at line 104 of file Ifpack_HashTable.h.

void Ifpack_HashTable::set ( const int  key,
const double  value,
const bool  addToValue = false 
) [inline]

Sets an element in the hash table.

Definition at line 118 of file Ifpack_HashTable.h.

void Ifpack_HashTable::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 162 of file Ifpack_HashTable.h.

int Ifpack_HashTable::getNumEntries ( ) const [inline]

Returns the number of stored entries.

Definition at line 168 of file Ifpack_HashTable.h.

void Ifpack_HashTable::arrayify ( int *  key_array,
double *  val_array 
) [inline]

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

Definition at line 177 of file Ifpack_HashTable.h.

void Ifpack_HashTable::print ( ) [inline]

Basic printing routine.

Definition at line 190 of file Ifpack_HashTable.h.

int Ifpack_HashTable::getRecommendedHashSize ( int  n) [inline]

Definition at line 196 of file Ifpack_HashTable.h.

int Ifpack_HashTable::doHash ( const int  key) [inline, private]

Performs the hashing.

Definition at line 229 of file Ifpack_HashTable.h.


Member Data Documentation

Definition at line 235 of file Ifpack_HashTable.h.

Definition at line 236 of file Ifpack_HashTable.h.

std::vector<std::vector<double> > Ifpack_HashTable::vals_ [private]

Definition at line 237 of file Ifpack_HashTable.h.

std::vector<std::vector<int> > Ifpack_HashTable::keys_ [private]

Definition at line 238 of file Ifpack_HashTable.h.

std::vector<int> Ifpack_HashTable::counter_ [private]

Definition at line 239 of file Ifpack_HashTable.h.

unsigned int Ifpack_HashTable::seed_ [private]

Definition at line 240 of file Ifpack_HashTable.h.


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