Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Nektar::NekMeshUtils::EdgeHash Struct Reference

Defines a hash function for edges. More...

#include <Edge.h>

Inheritance diagram for Nektar::NekMeshUtils::EdgeHash:
Inheritance graph
[legend]
Collaboration diagram for Nektar::NekMeshUtils::EdgeHash:
Collaboration graph
[legend]

Public Member Functions

std::size_t operator() (EdgeSharedPtr const &p) const
 

Detailed Description

Defines a hash function for edges.

The hash of an edge is defined using the IDs of the two nodes which define it. First the minimum ID is hashed, then the maximum ID, which takes the two possible orientations into account.

Definition at line 210 of file Edge.h.

Member Function Documentation

std::size_t Nektar::NekMeshUtils::EdgeHash::operator() ( EdgeSharedPtr const &  p) const
inline

Definition at line 212 of file Edge.h.

213  {
214  std::size_t seed = 0;
215  unsigned int id1 = p->m_n1->m_id;
216  unsigned int id2 = p->m_n2->m_id;
217  boost::hash_combine(seed, id1 < id2 ? id1 : id2);
218  boost::hash_combine(seed, id2 < id1 ? id1 : id2);
219  return seed;
220  }