1 /********************* */
4 ** Original author: cconway
5 ** Major contributors: mdeters
6 ** Minor contributors (to current version): taking
7 ** This file is part of the CVC4 prototype.
8 ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys)
9 ** Courant Institute of Mathematical Sciences
10 ** New York University
11 ** See the file COPYING in the top-level source directory for licensing
12 ** information.\endverbatim
14 ** \brief [[ Add one-line brief description here ]]
16 ** [[ Add lengthier description here ]]
17 ** \todo document this file
20 #include "cvc4_public.h"
22 #ifndef __CVC4__HASH_H
23 #define __CVC4__HASH_H
25 // in case it's not been declared as a namespace yet
26 namespace __gnu_cxx
{}
28 #include <ext/hash_map>
29 #include <ext/hash_set>
33 #ifdef CVC4_NEED_HASH_UINT64_T
34 // on some versions and architectures of GNU C++, we need a
35 // specialization of hash for 64-bit values
37 struct hash
<uint64_t> {
38 size_t operator()(uint64_t v
) const {
41 };/* struct hash<uint64_t> */
42 #endif /* CVC4_NEED_HASH_UINT64_T */
44 }/* __gnu_cxx namespace */
46 // hackish: treat hash stuff as if it were in std namespace
47 namespace std
{ using namespace __gnu_cxx
; }
51 struct StringHashFunction
{
52 size_t operator()(const std::string
& str
) const {
53 return std::hash
<const char*>()(str
.c_str());
55 };/* struct StringHashFunction */
57 template <class T
, class U
, class HashT
= std::hash
<T
>, class HashU
= std::hash
<U
> >
58 struct PairHashFunction
{
59 size_t operator()(const std::pair
<T
, U
>& pr
) const {
60 return HashT()(pr
.first
) ^ HashU()(pr
.second
);
62 };/* struct PairHashFunction */
66 #endif /* __CVC4__HASH_H */