Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VDNAMesh::hashFunc Struct Reference

#include <G4VDNAMesh.hh>

Public Member Functions

size_t operator() (const Index &k) const

Detailed Description

Definition at line 76 of file G4VDNAMesh.hh.

Member Function Documentation

◆ operator()()

size_t G4VDNAMesh::hashFunc::operator() ( const Index & k) const
inline

Definition at line 78 of file G4VDNAMesh.hh.

79 {
80 size_t h1 = std::hash<G4int>()(k.x);
81 size_t h2 = std::hash<G4int>()(k.y);
82 size_t h3 = std::hash<G4int>()(k.z);
83
84 // Combine the hashes using a consistent and well-distributed technique
85 size_t seed = 0;
86 seed ^= h1 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
87 seed ^= h2 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
88 seed ^= h3 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
89
90 return seed;
91 }

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