Scaffolding  0.1
This program can assemble genome scaffolds using the pairing information in paired-end reads.
unordered_pair.hpp
Go to the documentation of this file.
1 
7 #ifndef UNORDERED_PAIR
8 #define UNORDERED_PAIR
9 
10 #include <utility>
11 #include <functional>
12 
13 namespace std{
14 
16  template<class ElementA, class ElementB>
17  struct unordered_pair: public pair<ElementA, ElementB>
18  {
19  using pair<ElementA, ElementB>::pair;
20 
23  {
24  return ((this->first == up.first) && (this->second == up.second))
25  || ((this->first == up.second) && (this->second == up.first));
26  }
27  };
28 
30  template<class ElementA, class ElementB>
31  size_t hash_value(const unordered_pair<ElementA, ElementB>& up)
32  {
33  return std::hash<ElementA>{}(up.first) + std::hash<ElementB>{}(up.second);
34  }
35 
36 
37 };
38 
39 #endif
40 
bool operator==(const unordered_pair< ElementA, ElementB > &up) const
two unordered pairs {u,v} and {x,y} are equal if (u=x & v=y) or (u=y & v=x)
Definition: unordered_pair.hpp:22
Definition: low_priority_queue.hpp:23
an unordered pair
Definition: unordered_pair.hpp:17
size_t hash_value(const boost::unordered_set< T > &S)
a hash computation for an unordered set, XORing its members
Definition: utils.hpp:178