10 #ifndef TEUCHOS_HASHUTILS_H 
   11 #define TEUCHOS_HASHUTILS_H 
   38       static int nextPrime(
int newCapacity);
 
   39       static int getHashCode(
const unsigned char *a, 
size_t len);
 
   46       static const int primes_[];
 
   58   template <
class T> 
int hashCode(
const T& x);
 
   71   template <> 
inline int hashCode(
const unsigned& x)
 
   74         reinterpret_cast<const unsigned char *>(&x), 
sizeof(
unsigned));
 
   80   template <> 
inline int hashCode(
const double& x)
 
   83         reinterpret_cast<const unsigned char *>(&x), 
sizeof(
double));
 
   97   template <> 
inline int hashCode(
const long long& x)
 
  100         reinterpret_cast<const unsigned char *>(&x), 
sizeof(
long long));
 
  109         reinterpret_cast<const unsigned char *>(&x), 
sizeof(
long));
 
  115   template <> 
inline int hashCode(
const std::string& x)
 
  120       const char* str = x.c_str();
 
  121       int len = 
static_cast<int>(x.length());
 
  122       int step = len/4 + 1;
 
  126       for (
int i=0; i<len/2; i+=step)
 
  128           rtn += base*(int) str[i];
 
  130           rtn += base*(int) str[len-i-1];
 
  139           size_t maxIntBeforeWrap = std::numeric_limits<int>::max();
 
  141           rtn += maxIntBeforeWrap;
 
  147 #endif // TEUCHOS_HASHUTILS_H 
int hashCode(const double &x)
Get the hash code of a double. 
 
int hashCode(const std::string &x)
Get the hash code of a std::string. 
 
Utilities for generating hashcodes. This is not a true hash ! For all ints and types less than ints i...
 
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
 
static int getHashCode(const unsigned char *a, size_t len)
 
int hashCode(const long &x)
Get the hash code of a long. 
 
int hashCode(const unsigned &x)
Get the hash code of an unsigned. 
 
int hashCode(const int &x)
Get the hash code of an int. 
 
#define TEUCHOSCORE_LIB_DLL_EXPORT
 
static const int primeCount_
 
int hashCode(const long long &x)
Get the hash code of a long long. 
 
int hashCode(const bool &x)
Get the hash code of a bool.