Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 149 of file Edge.h.

Member Function Documentation

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

Definition at line 151 of file Edge.h.

152  {
153  std::size_t seed = 0;
154  unsigned int id1 = p->m_n1->m_id;
155  unsigned int id2 = p->m_n2->m_id;
156  boost::hash_combine(seed, id1 < id2 ? id1 : id2);
157  boost::hash_combine(seed, id2 < id1 ? id1 : id2);
158  return seed;
159  }