A hash set stores objects and allows efficient lookup whether an object is already a member of the set.
datastructures currently provides a reference implementation of hashsets using a hashtable stored in a plain GAP list.
‣ IsHashSet( arg ) | ( filter ) |
Returns: true or false
Category of hashsets
‣ HashSet( [hashfunc[, eqfunc, ]][capacity] ) | ( function ) |
Create a new hashset. The optional argument hashfunc must be a hash- function, eqfunc must be a binary equality testing function that returns true if the two arguments are considered equal, and false if they are not. Refer to Chapter 6 about the requirements for hashfunctions and equality testers. The optional argument capacity determines the initial size of the hashmap.
‣ AddSet( hashset, obj ) | ( function ) |
Add obj to hashset.
8.1-4 \in‣ \in( obj, hashset ) | ( function ) |
Test membership of obj in hashset
‣ RemoveSet( hashset, obj ) | ( function ) |
Remove obj from hashset.
‣ Size( hashset ) | ( function ) |
Return the size of a hashset Returns an integer
‣ IsEmpty( hashset ) | ( function ) |
Returns: a boolean
Test a hashset for emptiness.
‣ Set( hashset ) | ( function ) |
Returns: a set
Convert a hashset into a GAP set
‣ AsSet( hashset ) | ( function ) |
Returns: an immutable set
Convert a hashset into a GAP set
‣ Iterator( set ) | ( function ) |
Returns: an iterator
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.
generated by GAPDoc2HTML