124 lines
43 KiB
HTML
124 lines
43 KiB
HTML
<!-- HTML header for doxygen 1.8.18-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.15"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>OR-Tools: hash.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(initResizable);
|
|
/* @license-end */</script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">OR-Tools
|
|
 <span id="projectnumber">9.1</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.15 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('hash_8h_source.html','');});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">hash.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="hash_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Copyright 2010-2021 Google LLC</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// You may obtain a copy of the License at</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">//</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">//</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// limitations under the License.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#ifndef OR_TOOLS_BASE_HASH_H_</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#define OR_TOOLS_BASE_HASH_H_</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include <array></span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include <string></span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include <utility></span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="basictypes_8h.html">ortools/base/basictypes.h</a>"</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">// In SWIG mode, we don't want anything besides these top-level includes.</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#if !defined(SWIG)</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="keyword">namespace </span><a class="code" href="namespaceoperations__research.html">operations_research</a> {</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment">// 32 bit version.</span></div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="namespaceoperations__research.html#a623d865a70360d624d8d29e6a13b3379"> 28</a></span> <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceoperations__research.html#a623d865a70360d624d8d29e6a13b3379">mix</a>(uint32_t& <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>, uint32_t& <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>, uint32_t& c) { <span class="comment">// NOLINT</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= c;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> ^= (c >> 13);</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= c;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> ^= (<a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> << 8);</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  c ^= (<a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> >> 13);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= c;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> ^= (c >> 12);</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= c;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> ^= (<a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> << 16);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  c ^= (<a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> >> 5);</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= c;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> ^= (c >> 3);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= c;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> ^= (<a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> << 10);</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  c ^= (<a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> >> 15);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="comment">// 64 bit version.</span></div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="namespaceoperations__research.html#a8313ca010e8fff115c931044f63e9d8c"> 59</a></span> <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceoperations__research.html#a623d865a70360d624d8d29e6a13b3379">mix</a>(uint64_t& <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>, uint64_t& <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>, uint64_t& c) { <span class="comment">// NOLINT</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= c;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> ^= (c >> 43);</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= c;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> ^= (<a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> << 9);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  c ^= (<a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> >> 8);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= c;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> ^= (c >> 38);</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= c;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> ^= (<a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> << 23);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  c ^= (<a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> >> 5);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= c;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> ^= (c >> 35);</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= c;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> ^= (<a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> << 49);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  c ^= (<a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> >> 11);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> -= c;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> ^= (c >> 12);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= c;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> ^= (<a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> << 18);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  c -= <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  c ^= (<a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> >> 22);</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> }</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="namespaceoperations__research.html#a66479cfb6b1f16b2c2bfdddf77e00dd8"> 97</a></span> <span class="keyword">inline</span> uint32_t <a class="code" href="namespaceoperations__research.html#a66479cfb6b1f16b2c2bfdddf77e00dd8">Hash32NumWithSeed</a>(uint32_t num, uint32_t c) {</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  uint32_t <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> = 0x9e3779b9UL; <span class="comment">// The golden ratio; an arbitrary value.</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <a class="code" href="namespaceoperations__research.html#a623d865a70360d624d8d29e6a13b3379">operations_research::mix</a>(num, <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>, c);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordflow">return</span> c;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> }</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="namespaceoperations__research.html#ae39433d1df0e672003627fa8b777fabb"> 103</a></span> <span class="keyword">inline</span> uint64_t <a class="code" href="namespaceoperations__research.html#ae39433d1df0e672003627fa8b777fabb">Hash64NumWithSeed</a>(uint64_t num, uint64_t c) {</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  uint64_t <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> = uint64_t{0xe08c1d668b756f82}; <span class="comment">// More of the golden ratio.</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="namespaceoperations__research.html#a623d865a70360d624d8d29e6a13b3379">operations_research::mix</a>(num, <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>, c);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">return</span> c;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> }</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> } <span class="comment">// namespace operations_research</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// Support a few hash<> operators, in the hash namespace.</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="keyword">namespace </span>std {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="keyword">template</span> <<span class="keyword">class</span> First, <span class="keyword">class</span> Second></div><div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="structstd_1_1hash_3_01std_1_1pair_3_01_first_00_01_second_01_4_01_4.html"> 113</a></span> <span class="keyword">struct </span><a class="code" href="matrix__utils_8cc.html#a95d4078c018ac04247ee3785eab30e7b">hash</a><std::pair<First, Second>> {</div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="structstd_1_1hash_3_01std_1_1pair_3_01_first_00_01_second_01_4_01_4.html#ab7ae56bca653c8ba4d315e57b59e5033"> 114</a></span>  <span class="keywordtype">size_t</span> <a class="code" href="structstd_1_1hash_3_01std_1_1pair_3_01_first_00_01_second_01_4_01_4.html#ab7ae56bca653c8ba4d315e57b59e5033">operator()</a>(<span class="keyword">const</span> std::pair<First, Second>& p)<span class="keyword"> const </span>{</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordtype">size_t</span> h1 = hash<First>()(p.first);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keywordtype">size_t</span> h2 = hash<Second>()(p.second);</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="comment">// The decision below is at compile time</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">return</span> (<span class="keyword">sizeof</span>(h1) <= <span class="keyword">sizeof</span>(uint32_t))</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  ? <span class="comment">// NOLINT</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <a class="code" href="namespaceoperations__research.html#a66479cfb6b1f16b2c2bfdddf77e00dd8">operations_research::Hash32NumWithSeed</a>(h1, h2)</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  : <a class="code" href="namespaceoperations__research.html#ae39433d1df0e672003627fa8b777fabb">operations_research::Hash64NumWithSeed</a>(h1, h2);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  }</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> };</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span> </div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="keyword">template</span> <<span class="keyword">class</span> T, std::<span class="keywordtype">size_t</span> N></div><div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4.html"> 126</a></span> <span class="keyword">struct </span><a class="code" href="matrix__utils_8cc.html#a95d4078c018ac04247ee3785eab30e7b">hash</a><std::array<T, N>> {</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4.html#ae74cb56a3d90fdfd34fa5c3bf85a13bd"> 128</a></span>  <span class="keywordtype">size_t</span> <a class="code" href="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4.html#ae74cb56a3d90fdfd34fa5c3bf85a13bd">operator()</a>(<span class="keyword">const</span> std::array<T, N>& t)<span class="keyword"> const </span>{</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  uint64_t current = 71;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> <a class="code" href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a> = 0; <a class="code" href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a> < N; ++<a class="code" href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>) {</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keyword">const</span> T& elem = t[<a class="code" href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>];</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="keyword">const</span> uint64_t new_hash = hash<T>()(elem);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  current = <a class="code" href="namespaceoperations__research.html#ae39433d1df0e672003627fa8b777fabb">operations_research::Hash64NumWithSeed</a>(current, new_hash);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  }</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keywordflow">return</span> current;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  }</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="comment">// Less than operator for MSVC.</span></div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4.html#a4e82f705479189805a97c17cc076c42b"> 138</a></span>  <span class="keywordtype">bool</span> <a class="code" href="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4.html#a4e82f705479189805a97c17cc076c42b">operator()</a>(<span class="keyword">const</span> std::array<T, N>& <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>, <span class="keyword">const</span> std::array<T, N>& <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keywordflow">return</span> <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a> < <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  }</div><div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4.html#adc4fc3bf01ff15b2c265a25be13e8b1c"> 141</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> bucket_size = 4; <span class="comment">// These are required by MSVC.</span></div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4.html#a83e1373a12f3fcd875cf47965c769e79"> 142</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> min_buckets = 8; <span class="comment">// 4 and 8 are defaults.</span></div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> };</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> } <span class="comment">// namespace std</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="preprocessor">#endif // SWIG</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div><div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="namespaceutil__hash.html"> 148</a></span> <span class="keyword">namespace </span><a class="code" href="namespaceutil__hash.html">util_hash</a> {</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div><div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="namespaceutil__hash.html#a17715af1c1bc575a706eb167371b81e9"> 150</a></span> <span class="keyword">inline</span> uint64_t <a class="code" href="namespaceutil__hash.html#a17715af1c1bc575a706eb167371b81e9">Hash</a>(uint64_t num, uint64_t c) {</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  uint64_t <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a> = uint64_t{0xe08c1d668b756f82}; <span class="comment">// More of the golden ratio.</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <a class="code" href="namespaceoperations__research.html#a623d865a70360d624d8d29e6a13b3379">operations_research::mix</a>(num, <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>, c);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">return</span> c;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span> }</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span> </div><div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="namespaceutil__hash.html#ae6a2906da1c44c67cdaeb6d61bde9c70"> 156</a></span> <span class="keyword">inline</span> uint64_t <a class="code" href="namespaceutil__hash.html#a17715af1c1bc575a706eb167371b81e9">Hash</a>(uint64_t <a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>, uint64_t <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>, uint64_t c) {</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <a class="code" href="namespaceoperations__research.html#a623d865a70360d624d8d29e6a13b3379">operations_research::mix</a>(<a class="code" href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a>, <a class="code" href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a>, c);</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keywordflow">return</span> c;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> }</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span> </div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span> } <span class="comment">// namespace util_hash</span></div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <span class="preprocessor">#endif // OR_TOOLS_BASE_HASH_H_</span></div><div class="ttc" id="namespaceutil__hash_html_a17715af1c1bc575a706eb167371b81e9"><div class="ttname"><a href="namespaceutil__hash.html#a17715af1c1bc575a706eb167371b81e9">util_hash::Hash</a></div><div class="ttdeci">uint64_t Hash(uint64_t num, uint64_t c)</div><div class="ttdef"><b>Definition:</b> <a href="hash_8h_source.html#l00150">hash.h:150</a></div></div>
|
|
<div class="ttc" id="structstd_1_1hash_3_01std_1_1pair_3_01_first_00_01_second_01_4_01_4_html_ab7ae56bca653c8ba4d315e57b59e5033"><div class="ttname"><a href="structstd_1_1hash_3_01std_1_1pair_3_01_first_00_01_second_01_4_01_4.html#ab7ae56bca653c8ba4d315e57b59e5033">std::hash< std::pair< First, Second > >::operator()</a></div><div class="ttdeci">size_t operator()(const std::pair< First, Second > &p) const</div><div class="ttdef"><b>Definition:</b> <a href="hash_8h_source.html#l00114">hash.h:114</a></div></div>
|
|
<div class="ttc" id="constraint__solver_2table_8cc_html_a9293e4d29cac928301645070dd307683"><div class="ttname"><a href="constraint__solver_2table_8cc.html#a9293e4d29cac928301645070dd307683">b</a></div><div class="ttdeci">int64_t b</div><div class="ttdef"><b>Definition:</b> <a href="constraint__solver_2table_8cc_source.html#l00047">constraint_solver/table.cc:47</a></div></div>
|
|
<div class="ttc" id="namespaceoperations__research_html_a623d865a70360d624d8d29e6a13b3379"><div class="ttname"><a href="namespaceoperations__research.html#a623d865a70360d624d8d29e6a13b3379">operations_research::mix</a></div><div class="ttdeci">static void mix(uint32_t &a, uint32_t &b, uint32_t &c)</div><div class="ttdef"><b>Definition:</b> <a href="hash_8h_source.html#l00028">hash.h:28</a></div></div>
|
|
<div class="ttc" id="matrix__utils_8cc_html_a95d4078c018ac04247ee3785eab30e7b"><div class="ttname"><a href="matrix__utils_8cc.html#a95d4078c018ac04247ee3785eab30e7b">hash</a></div><div class="ttdeci">int64_t hash</div><div class="ttdef"><b>Definition:</b> <a href="matrix__utils_8cc_source.html#l00061">matrix_utils.cc:61</a></div></div>
|
|
<div class="ttc" id="pack_8cc_html_a750b5d744c39a06bfb13e6eb010e35d0"><div class="ttname"><a href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a></div><div class="ttdeci">int index</div><div class="ttdef"><b>Definition:</b> <a href="pack_8cc_source.html#l00509">pack.cc:509</a></div></div>
|
|
<div class="ttc" id="namespaceoperations__research_html_a66479cfb6b1f16b2c2bfdddf77e00dd8"><div class="ttname"><a href="namespaceoperations__research.html#a66479cfb6b1f16b2c2bfdddf77e00dd8">operations_research::Hash32NumWithSeed</a></div><div class="ttdeci">uint32_t Hash32NumWithSeed(uint32_t num, uint32_t c)</div><div class="ttdef"><b>Definition:</b> <a href="hash_8h_source.html#l00097">hash.h:97</a></div></div>
|
|
<div class="ttc" id="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4_html_ae74cb56a3d90fdfd34fa5c3bf85a13bd"><div class="ttname"><a href="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4.html#ae74cb56a3d90fdfd34fa5c3bf85a13bd">std::hash< std::array< T, N > >::operator()</a></div><div class="ttdeci">size_t operator()(const std::array< T, N > &t) const</div><div class="ttdef"><b>Definition:</b> <a href="hash_8h_source.html#l00128">hash.h:128</a></div></div>
|
|
<div class="ttc" id="namespaceoperations__research_html_ae39433d1df0e672003627fa8b777fabb"><div class="ttname"><a href="namespaceoperations__research.html#ae39433d1df0e672003627fa8b777fabb">operations_research::Hash64NumWithSeed</a></div><div class="ttdeci">uint64_t Hash64NumWithSeed(uint64_t num, uint64_t c)</div><div class="ttdef"><b>Definition:</b> <a href="hash_8h_source.html#l00103">hash.h:103</a></div></div>
|
|
<div class="ttc" id="namespaceoperations__research_html"><div class="ttname"><a href="namespaceoperations__research.html">operations_research</a></div><div class="ttdoc">Collection of objects used to extend the Constraint Solver library.</div><div class="ttdef"><b>Definition:</b> <a href="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>
|
|
<div class="ttc" id="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4_html_a4e82f705479189805a97c17cc076c42b"><div class="ttname"><a href="structstd_1_1hash_3_01std_1_1array_3_01_t_00_01_n_01_4_01_4.html#a4e82f705479189805a97c17cc076c42b">std::hash< std::array< T, N > >::operator()</a></div><div class="ttdeci">bool operator()(const std::array< T, N > &a, const std::array< T, N > &b) const</div><div class="ttdef"><b>Definition:</b> <a href="hash_8h_source.html#l00138">hash.h:138</a></div></div>
|
|
<div class="ttc" id="namespaceutil__hash_html"><div class="ttname"><a href="namespaceutil__hash.html">util_hash</a></div><div class="ttdef"><b>Definition:</b> <a href="hash_8h_source.html#l00148">hash.h:148</a></div></div>
|
|
<div class="ttc" id="basictypes_8h_html"><div class="ttname"><a href="basictypes_8h.html">basictypes.h</a></div></div>
|
|
<div class="ttc" id="constraint__solver_2table_8cc_html_acb18315d548212835cd8ed4287e6c0b6"><div class="ttname"><a href="constraint__solver_2table_8cc.html#acb18315d548212835cd8ed4287e6c0b6">a</a></div><div class="ttdeci">int64_t a</div><div class="ttdef"><b>Definition:</b> <a href="constraint__solver_2table_8cc_source.html#l00046">constraint_solver/table.cc:46</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- HTML footer for doxygen 1.8.18-->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_a7cc1eeded8f693d0da6c729bc88c45a.html">ortools</a></li><li class="navelem"><a class="el" href="dir_8f9dc966244f4c6e9b2fa0dee1e4ef1a.html">base</a></li><li class="navelem"><a class="el" href="hash_8h.html">hash.h</a></li>
|
|
<li class="footer">Generated by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|