55 template <
class TClassType>
58 const TClassType& Value
61 std::hash<TClassType> hasher;
62 Seed ^= hasher(Value) + 0x9e3779b9 + (Seed<<6) + (Seed>>2);
72 template <
class TClassType>
98 template<
class TClassType>
107 const TClassType& first,
108 const TClassType& second
111 if(first.size() != second.size()) {
115 auto it_first = first.begin();
116 auto it_second = second.begin();
118 while(it_first != first.end()) {
119 if(*it_first != *it_second) {
122 if(it_first != first.end()) {
136 template<
class TClassType>
146 return HashRange(rRange.begin(), rRange.end());
212 template<
class TIndexedObject>
222 return rIndexedObject.Id();
230 template<
class TIndexedObject>
239 const TIndexedObject& rFirst,
240 const TIndexedObject& rSecond
243 return rFirst.Id() == rSecond.Id();
252 template<
class TpIndexedObject>
262 return pIndexedObject->Id();
271 template<
class TpIndexedObject>
280 const TpIndexedObject pFirst,
281 const TpIndexedObject pSecond
284 return pFirst->Id() == pSecond->Id();
292 template<
class TSharedPo
inter>
302 return reinterpret_cast<HashType>(pPointer.get());
310 template<
class TSharedPo
inter>
319 const TSharedPointer& first,
320 const TSharedPointer& second
323 return first.get() == second.get();
331 template<
class TVectorIndex>
349 template<
class TVectorIndex>
359 if(
lhs.size() !=
rhs.size())
410 template<
class TType1,
class TType2>
420 HashCombine<TType1>(
seed, rPair.first);
421 HashCombine<TType2>(
seed, rPair.second);
430 template<
class TType1,
class TType2>
438 bool operator()(
const std::pair<TType1, TType2>& rPair1,
const std::pair<TType1, TType2>& rPair2)
const
440 return ((std::get<0>(rPair1) == std::get<0>(rPair2)) && (std::get<1>(rPair1) == std::get<1>(rPair2)));
462 template<
typename T1,
typename T2>
463 struct hash<
std::pair<T1, T2>>
473 const size_t h1 = std::hash<T1>()(
p.first);
474 const size_t h2 = std::hash<T2>()(
p.second);
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
const VariableData & GetVariable() const
Definition: dof.h:303
IndexType Id() const
Definition: dof.h:292
This class is the base of variables and variable's components which contains their common data.
Definition: variable_data.h:49
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
bool operator()(const TClassType &first, const TClassType &second) const
This is the () operator.
Definition: key_hash.h:106
HashType operator()(const std::pair< TType1, TType2 > &rPair) const
The () operator.
Definition: key_hash.h:417
HashType operator()(const Dof< double >::Pointer &pDoF) const
The () operator.
Definition: key_hash.h:380
HashType operator()(const TSharedPointer &pPointer) const
This is the () operator.
Definition: key_hash.h:300
void HashCombine(HashType &Seed, const TClassType &Value)
This method creates an "unique" hash for the input value.
Definition: key_hash.h:56
bool operator()(const TpIndexedObject pFirst, const TpIndexedObject pSecond) const
This is the () operator.
Definition: key_hash.h:279
HashType operator()(const TClassType &rRange) const
This is the () operator.
Definition: key_hash.h:144
bool operator()(const TIndexedObject &rFirst, const TIndexedObject &rSecond) const
This is the () operator.
Definition: key_hash.h:238
bool operator()(const TVectorIndex &lhs, const TVectorIndex &rhs) const
This is the () operator.
Definition: key_hash.h:357
bool operator()(const std::pair< TType1, TType2 > &rPair1, const std::pair< TType1, TType2 > &rPair2) const
The () operator.
Definition: key_hash.h:438
bool operator()(const TSharedPointer &first, const TSharedPointer &second) const
This is the () operator.
Definition: key_hash.h:318
HashType operator()(const TIndexedObject &rIndexedObject) const
This is the () operator.
Definition: key_hash.h:220
size_t operator()(const std::pair< T1, T2 > &p) const
Calculates the hash value of a given pair of values in a way that combines the hash values of the ind...
Definition: key_hash.h:470
HashType operator()(const TVectorIndex &k) const
This is the () operator.
Definition: key_hash.h:339
HashType operator()(const TpIndexedObject pIndexedObject) const
This is the () operator.
Definition: key_hash.h:260
HashType HashRange(TClassType First, TClassType Last)
This method combines hash until it reaches the last class in order to obtain a corresponding seed.
Definition: key_hash.h:73
std::size_t HashType
The definition of the hash type.
Definition: key_hash.h:38
bool operator()(const Dof< double >::Pointer &pDoF1, const Dof< double >::Pointer &pDoF2) const
The () operator.
Definition: key_hash.h:400
int seed
Definition: GenerateWind.py:138
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
rhs
Definition: generate_frictional_mortar_condition.py:297
lhs
Definition: generate_frictional_mortar_condition.py:297
int k
Definition: quadrature.py:595
p
Definition: sensitivityMatrix.py:52
namespace
Definition: array_1d.h:793
integer i
Definition: TensorModule.f:17
This is a key comparer between two dof pointers.
Definition: key_hash.h:394
This is a hasher for a dof pointers.
Definition: key_hash.h:375
This is a key comparer between two indexed objects.
Definition: key_hash.h:232
This is a hasher for indexed objects.
Definition: key_hash.h:214
This is a key comparer between two indexed objects (pointer)
Definition: key_hash.h:273
This is a hasher for indexed objects (pointer)
Definition: key_hash.h:254
This is a key comparer of general pourpose between two classes.
Definition: key_hash.h:100
This is a hasher of general pourpose.
Definition: key_hash.h:138
This is a key comparer between two indexes pairs.
Definition: key_hash.h:432
This is a hasher for pairs.
Definition: key_hash.h:412
This is a key comparer between two shared pointers.
Definition: key_hash.h:312
This is a hasher for shared pointers.
Definition: key_hash.h:294
This is a key comparer between two variables.
Definition: key_hash.h:167
This is a hasher for variables.
Definition: key_hash.h:154
This is a key comparer between two vectors of indexes.
Definition: key_hash.h:351
This is a hasher between two vectors of indexes.
Definition: key_hash.h:333
This is a key comparer between two variables pointers.
Definition: key_hash.h:196
This is a hasher for variables pointers.
Definition: key_hash.h:183