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 ( [values][,] [hashfunc[, eqfunc]][,] [capacity] ) | ( function ) |
Create a new hashset. The optional argument values must be a list of values, which will be inserted into the new hashset in order. 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 ) | ( operation ) |
Add obj to hashset.
8.1-4 \in
‣ \in ( obj, hashset ) | ( operation ) |
Test membership of obj in hashset
‣ RemoveSet ( hashset, obj ) | ( operation ) |
Remove obj from hashset.
‣ Size ( hashset ) | ( operation ) |
Return the size of a hashset Returns an integer
‣ IsEmpty ( hashset ) | ( operation ) |
Returns: a boolean
Test a hashset for emptiness.
‣ Set ( hashset ) | ( operation ) |
Returns: a set
Convert a hashset into a GAP set
‣ AsSet ( hashset ) | ( operation ) |
Returns: an immutable set
Convert a hashset into a GAP set
‣ Iterator ( set ) | ( operation ) |
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