Arcane  v3.15.3.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
HashSuite.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* HashSuite.h (C) 2000-2025 */
9/* */
10/* Fonction de hachage d'une suite de valeur. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_HASHSUITE_H
13#define ARCANE_UTILS_HASHSUITE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/HashFunction.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
35{
36 public:
37
44 template <class T>
45 void add(T value)
46 {
47 const UInt64 next_hash = static_cast<UInt64>(IntegerHashFunctionT<T>::hashfunc(value));
48 m_hash ^= next_hash + 0x9e3779b9 + (m_hash << 6) + (m_hash >> 2);
49 }
50
56 Int64 hash() const
57 {
58 return static_cast<Int64>(m_hash);
59 }
60
61 private:
62
63 UInt64 m_hash{0};
64};
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
68
69} // End namespace Arcane
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
73
74#endif
Fonctor pour une fonction de hachage.
Classe permettant de calculer un hash de manière itératif.
Definition HashSuite.h:35
void add(T value)
Méthode permettant d'ajouter une valeur dans le calcul du hash.
Definition HashSuite.h:45
Int64 hash() const
Méthode permettant de récupérer le hash calculé à partir de toutes les valeurs passées à la méthode a...
Definition HashSuite.h:56
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:149
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-