6 #ifndef moab_SHARED_SET_DATA_HPP
7 #define moab_SHARED_SET_DATA_HPP
12 #define STRINGIFY_( X ) #X
13 #define STRINGIFY( X ) STRINGIFY_( X )
14 #ifdef MOAB_HAVE_UNORDERED_MAP
15 #include STRINGIFY( MOAB_HAVE_UNORDERED_MAP )
16 #include STRINGIFY( MOAB_HAVE_UNORDERED_SET )
71 return get_owner( set, rank, handle_out );
105 #ifdef MOAB_HAVE_UNORDERED_MAP
109 template <
typename T >
110 static void hash_combine(
size_t& seed, T val )
112 seed ^= MOAB_UNORDERED_MAP_NS::hash< T >().operator()( val ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 );
114 template <
typename IT >
115 static size_t hash_range( IT it, IT last )
118 for( ; it != last; ++it )
119 hash_combine( seed, *it );
122 size_t operator()(
const std::vector< unsigned >& v )
const
124 return hash_range( v.begin(), v.end() );
128 typedef MOAB_UNORDERED_MAP_NS::unordered_map< unsigned, ProcHandleMapType >
RHMap;
129 typedef MOAB_UNORDERED_MAP_NS::unordered_set< std::vector< unsigned >, hash_vect >
RProcMap;
133 bool operator()(
const std::vector< unsigned >& a,
const std::vector< unsigned >& b )
const
136 if( a.size() != b.size() )
return a.size() < b.size();
139 while( i != a.size() && a[i] == b[i] )
141 return i != a.size() && a[i] < b[i];
145 typedef std::map< unsigned, ProcHandleMapType >
RHMap;