<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd " >
<html xmlns="http://www.w3.org/1999/xhtml " xml:lang="en" >
<head >
<title >GAP (datastructures) - Chapter 8: Hashsets</title >
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript" ></script >
<script type="text/javascript" >overwriteStyle();</script >
</head >
<body class="chap8" onload="jscontent()" >
<div class="chlinktop" ><span class="chlink1" >Goto Chapter: </span ><a href="chap0.html" >Top</a> <a href="chap1.html" >1</a> <a href="chap2.html" >2</a> <a href="chap3.html" >3</a> <a href="chap4.html" >4</a> <a href="chap5.html" >5</a> <a href="chap6.html" >6</a> <a href="chap7.html" >7</a> <a href="chap8.html" >8</a> <a href="chap9.html" >9</a> <a href="chap10.html" >10</a> <a href="chap11.html" >11</a> <a href="chap12.html" >12</a> <a href="chapBib.html" >Bib</a> <a href="chapInd.html" >Ind</a> </div >
<div class="chlinkprevnexttop" > <a href="chap0.html" >[Top of Book]</a> <a href="chap0.html#contents" >[Contents]</a> <a href="chap7.html" >[Previous Chapter]</a> <a href="chap9.html" >[Next Chapter]</a> </div >
<p id="mathjaxlink" class="pcenter" ><a href="chap8_mj.html" >[MathJax on]</a></p>
<p><a id="X80589F287F1620B2" name="X80589F287F1620B2" ></a></p>
<div class="ChapSects" ><a href="chap8.html#X80589F287F1620B2" >8 <span class="Heading" >Hashsets</span ></a>
<div class="ContSect" ><span class="tocline" ><span class="nocss" > </span ><a href="chap8.html#X7C5F33687C53BEF0" >8.1 <span class="Heading" >API</span ></a>
</span >
<div class="ContSSBlock" >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X81FA1C7B84314DAF" >8.1-1 IsHashSet</a></span >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X789A593B7C227BE5" >8.1-2 HashSet</a></span >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X7C7FBBE27E833BB3" >8.1-3 AddSet</a></span >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X7CECEB107D9B8645" ><code >8.1-4 \in</code ></a></span >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X80E770C2845B4155" >8.1-5 RemoveSet</a></span >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X82596CD77B2EC7C5" >8.1-6 Size</a></span >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X8142E775878A1A6E" >8.1-7 IsEmpty</a></span >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X7D1EE80687CAB426" >8.1-8 Set</a></span >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X835176CB8124AF70" >8.1-9 AsSet</a></span >
<span class="ContSS" ><br /><span class="nocss" > </span ><a href="chap8.html#X792F44027D8C73DA" >8.1-10 Iterator</a></span >
</div ></div >
</div >
<h3>8 <span class="Heading" >Hashsets</span ></h3>
<p>A hash set stores objects and allows efficient lookup whether an object is already a member of the set.</p>
<p><strong class="pkg" >datastructures</strong > currently provides a reference implementation of hashsets using a hashtable stored in a plain <strong class="pkg" >GAP</strong > list.</p>
<p><a id="X7C5F33687C53BEF0" name="X7C5F33687C53BEF0" ></a></p>
<h4>8.1 <span class="Heading" >API</span ></h4>
<p><a id="X81FA1C7B84314DAF" name="X81FA1C7B84314DAF" ></a></p>
<h5>8.1-1 IsHashSet</h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ IsHashSet</code >( <var class="Arg" >arg</var > )</td ><td class="tdright" >( filter )</td ></tr ></table ></div >
<p>Returns: <code class="keyw" >true</code > or <code class="keyw" >false</code ></p>
<p>Category of hashsets</p>
<p><a id="X789A593B7C227BE5" name="X789A593B7C227BE5" ></a></p>
<h5>8.1-2 HashSet</h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ HashSet</code >( [<var class="Arg" >values</var >][,] [<var class="Arg" >hashfunc</var >[, <var class="Arg" >eqfunc</var >]][,] [<var class="Arg" >capacity</var >] )</td ><td class="tdright" >( function )</td ></tr ></table ></div >
<p>Create a new hashset. The optional argument <var class="Arg" >values</var > must be a list of values, which will be inserted into the new hashset in order. The optional argument <var class="Arg" >hashfunc</var > must be a hash- function, <var class="Arg" >eqfunc</var > must be a binary equality testing function that returns <code class="keyw" >true</code > if the two arguments are considered equal, and <code class="keyw" >false</code > if they are not. Refer to Chapter <a href="chap6.html#X7AE36B967EB1382B" ><span class="RefLink" >6</span ></a> about the requirements for hashfunctions and equality testers. The optional argument <var class="Arg" >capacity</var > determines the initial size of the hashmap.</p>
<p><a id="X7C7FBBE27E833BB3" name="X7C7FBBE27E833BB3" ></a></p>
<h5>8.1-3 AddSet</h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ AddSet</code >( <var class="Arg" >hashset</var >, <var class="Arg" >obj</var > )</td ><td class="tdright" >( operation )</td ></tr ></table ></div >
<p>Add <var class="Arg" >obj</var > to <var class="Arg" >hashset</var >.</p>
<p><a id="X7CECEB107D9B8645" name="X7CECEB107D9B8645" ></a></p>
<h5><code >8.1-4 \in</code ></h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ \in</code >( <var class="Arg" >obj</var >, <var class="Arg" >hashset</var > )</td ><td class="tdright" >( operation )</td ></tr ></table ></div >
<p>Test membership of <var class="Arg" >obj</var > in <var class="Arg" >hashset</var ></p>
<p><a id="X80E770C2845B4155" name="X80E770C2845B4155" ></a></p>
<h5>8.1-5 RemoveSet</h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ RemoveSet</code >( <var class="Arg" >hashset</var >, <var class="Arg" >obj</var > )</td ><td class="tdright" >( operation )</td ></tr ></table ></div >
<p>Remove <var class="Arg" >obj</var > from <var class="Arg" >hashset</var >.</p>
<p><a id="X82596CD77B2EC7C5" name="X82596CD77B2EC7C5" ></a></p>
<h5>8.1-6 Size</h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ Size</code >( <var class="Arg" >hashset</var > )</td ><td class="tdright" >( operation )</td ></tr ></table ></div >
<p>Return the size of a hashset Returns an integer</p>
<p><a id="X8142E775878A1A6E" name="X8142E775878A1A6E" ></a></p>
<h5>8.1-7 IsEmpty</h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ IsEmpty</code >( <var class="Arg" >hashset</var > )</td ><td class="tdright" >( operation )</td ></tr ></table ></div >
<p>Returns: a boolean</p>
<p>Test a hashset for emptiness.</p>
<p><a id="X7D1EE80687CAB426" name="X7D1EE80687CAB426" ></a></p>
<h5>8.1-8 Set</h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ Set</code >( <var class="Arg" >hashset</var > )</td ><td class="tdright" >( operation )</td ></tr ></table ></div >
<p>Returns: a set</p>
<p>Convert a hashset into a <strong class="pkg" >GAP</strong > set</p>
<p><a id="X835176CB8124AF70" name="X835176CB8124AF70" ></a></p>
<h5>8.1-9 AsSet</h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ AsSet</code >( <var class="Arg" >hashset</var > )</td ><td class="tdright" >( operation )</td ></tr ></table ></div >
<p>Returns: an immutable set</p>
<p>Convert a hashset into a <strong class="pkg" >GAP</strong > set</p>
<p><a id="X792F44027D8C73DA" name="X792F44027D8C73DA" ></a></p>
<h5>8.1-10 Iterator</h5>
<div class="func" ><table class="func" width="100%" ><tr ><td class="tdleft" ><code class="func" >‣ Iterator</code >( <var class="Arg" >set</var > )</td ><td class="tdright" >( operation )</td ></tr ></table ></div >
<p>Returns: an iterator</p>
<p>Create an iterator for the values contained in a hashset. Note that elements added to the hashset after the creation of an iterator are not guaranteed to be returned by that iterator.</p>
<div class="chlinkprevnextbot" > <a href="chap0.html" >[Top of Book]</a> <a href="chap0.html#contents" >[Contents]</a> <a href="chap7.html" >[Previous Chapter]</a> <a href="chap9.html" >[Next Chapter]</a> </div >
<div class="chlinkbot" ><span class="chlink1" >Goto Chapter: </span ><a href="chap0.html" >Top</a> <a href="chap1.html" >1</a> <a href="chap2.html" >2</a> <a href="chap3.html" >3</a> <a href="chap4.html" >4</a> <a href="chap5.html" >5</a> <a href="chap6.html" >6</a> <a href="chap7.html" >7</a> <a href="chap8.html" >8</a> <a href="chap9.html" >9</a> <a href="chap10.html" >10</a> <a href="chap11.html" >11</a> <a href="chap12.html" >12</a> <a href="chapBib.html" >Bib</a> <a href="chapInd.html" >Ind</a> </div >
<hr />
<p class="foot" >generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc " >GAPDoc2HTML</a></p>
</body >
</html >
quality 98%
¤ Dauer der Verarbeitung: 0.27 Sekunden
(vorverarbeitet)
¤
*© Formatika GbR, Deutschland