Version: SMASH-3.1
smash::pair_hash Struct Reference

#include <parametrizations.h>

Hash a pair of integers.

Note that symmetric pairs and permutations yield identical hashes with this implementation.

Definition at line 531 of file parametrizations.h.

Public Member Functions

std::size_t operator() (const std::pair< uint64_t, uint64_t > &p) const
 Hashing is done by this operator. More...
 

Member Function Documentation

◆ operator()()

std::size_t smash::pair_hash::operator() ( const std::pair< uint64_t, uint64_t > &  p) const
inline

Hashing is done by this operator.

Definition at line 533 of file parametrizations.h.

533  {
534  auto h1 = std::hash<uint64_t>{}(p.first);
535  auto h2 = std::hash<uint64_t>{}(p.second);
536 
537  /* In our case the integers are PDG codes. We know they are different
538  * and their order is defined, so we can simply combine the hashes
539  * using XOR. Note that this yields 0 for h1 == h2. Also,
540  * std::swap(h1, h2) does not not change the final hash. */
541  assert(h1 != h2);
542  return h1 ^ h2;
543  }
constexpr int p
Proton.
constexpr int h1
h₁(1170).

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