|
chombo-discharge
|
Hash functor for NNCellKey – REQUIRED whenever NNCellKey is used as a hash-map key; NNCellKey must never be used as an ordered (std::map or std::set) key. More...
#include <CD_NearestNeighborParticleMerge.H>
Public Member Functions | |
| std::size_t | operator() (const NNCellKey &a_key) const noexcept |
| Hash operator. | |
Hash functor for NNCellKey – REQUIRED whenever NNCellKey is used as a hash-map key; NNCellKey must never be used as an ordered (std::map or std::set) key.
IntVect::operator< (which std::pair<int,IntVect>::operator< calls for the second component) is a component-wise "strictly dominates in every direction" partial order, not a strict weak ordering. Two unrelated cells where neither dominates the other (e.g. (76,104) vs (80,101)) compare as neither-less-than, which std::map/std::set treat as equal keys – pooling unrelated cells' counts into one entry. Hashing depends only on IntVect::operator== (full component-wise equality), which is correct.
|
inlinenoexcept |
Hash operator.
| [in] | a_key | Cell key to hash. |