<p>A hash function in <strong class="pkg">datastructures</strong> is a function <span class="SimpleMath">H</span> which maps a value <span class="SimpleMath">X</span> to a small integer (where a small integer is an integer in the range <code class="code">[-2^28..2^28-1]</code> on a 32-bit system, and <code class="code">[-2^60..2^60-1]</code> on a 64-bit system), under the requirement that if <span class="SimpleMath">X=Y</span>, then <span class="SimpleMath">H(X)=H(Y)</span>.</p>
<p>A variety of hash functions is provided by <strong class="pkg">datastructures</strong>, with different behaviours. A bad choice of hash function can lead to serious performance problems.</p>
<p><strong class="pkg">datastructures</strong> does not guarantee consistency of hash values across release or <strong class="pkg">GAP</strong> sessions.</p>
</li>
<li><p>constructors for lists and records.</p>
</li>
</ul>
<p>This function is variadic, treating more than one argument as equivalent to a list containing the arguments, that is <code class="code">HashBasic(x,y,z) = HashBasic([x,y,z])</code>.</p>
<h4>6.3 <span class="Heading">Hash Functions for Permutation Groups</span></h4>
<p><strong class="pkg">datastructures</strong> provides two hash functions for permutation groups; <code class="func">Hash_PermGroup_Fast</code> (<a href="chap6.html#X848AD86F8089106F"><span class="RefLink">6.3-1</span></a>) is the faster one, with higher likelihood of collisions and <code class="func">Hash_PermGroup_Complete</code> (<a href="chap6.html#X86FFE7A07E784C24"><span class="RefLink">6.3-2</span></a>) is slower but provides a lower likelihood of collisions.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Hash_PermGroup_Fast</code>( <var class="Arg">group</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a small integer</p>
<p><code class="func">Hash_PermGroup_Fast</code> is faster than <code class="func">Hash_PermGroup_Complete</code> (<a href="chap6.html#X86FFE7A07E784C24"><span class="RefLink">6.3-2</span></a>), but will return the same value for groups with the same size, orbits and degree of transitivity.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Hash_PermGroup_Complete</code>( <var class="Arg">group</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a small integer</p>
<p><code class="func">Hash_PermGroup_Complete</code> is slower than <code class="func">Hash_PermGroup_Fast</code> (<a href="chap6.html#X848AD86F8089106F"><span class="RefLink">6.3-1</span></a>), but is extremely unlikely to return the same hash for two different groups.</p>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.