%% for a long time these were red and blue by default, %% now black, but keep variables to overwrite \definecolor{FuncColor}{rgb}{0.0,0.0,0.0} %% strange name because of pdflatex bug: \definecolor{Chapter }{rgb}{0.0,0.0,0.0} \definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}
% write page numbers to a .pnr log file for online help \newwrite\pagenrlog \immediate\openout\pagenrlog =\jobname.pnr \immediate\write\pagenrlog{PAGENRS := [} \newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}} %% were never documented, give conflicts with some additional packages
\newcommand{\GAP}{\textsf{GAP}}
%% nicer description environments, allows long labels \usepackage{enumitem} \setdescription{style=nextline}
\hypersetup{pdftitle= datastructures } \markright{\scriptsize\mbox{}\hfill datastructures \hfill\mbox{}}
{\Huge\textbf{ Collection of standard data structures for \textsf{GAP} \mbox{}}}\\ \vfill
{\Huge 0.4.0 \mbox{}}\\[1cm]
{ 14 October 2025 \mbox{}}\\[1cm] \mbox{}\\[2cm]
{\Large\textbf{ Markus Pfeiffer\\ \mbox{}}}\\
{\Large\textbf{ Max Horn\\ \mbox{}}}\\
{\Large\textbf{ Christopher Jefferson\\ \mbox{}}}\\
{\Large\textbf{ Steve Linton\\ \mbox{}}}\\ \hypersetup{pdfauthor= Markus Pfeiffer\\
; Max Horn\\
; Christopher Jefferson\\
; Steve Linton\\
} \end{center}\vfill
\mbox{}\\
{\mbox{}\\ \small\noindent\textbf{ Markus Pfeiffer\\
} Email: \href{mailto://markus.pfeiffer@st-andrews.ac.uk} {\texttt{markus.pfeiffer@st\texttt{\symbol{45}}andrews.ac.uk}}\\
Homepage: \href{http://www.morphism.de/~markusp} {\texttt{http://www.morphism.de/\texttt{\symbol{126}}markusp}}\\ Address: \begin{minipage}[t]{8cm}\noindent School of Computer Science\\
University of St Andrews\\
Jack Cole Building, North Haugh\\
St Andrews, Fife, KY16 9SX\\
United Kingdom\\ \end{minipage}
}\\
{\mbox{}\\ \small\noindent\textbf{ Max Horn\\
} Email: \href{mailto://mhorn@rptu.de} {\texttt{mhorn@rptu.de}}\\
Homepage: \href{https://www.quendi.de/math} {\texttt{https://www.quendi.de/math}}\\ Address: \begin{minipage}[t]{8cm}\noindent
Fachbereich Mathematik\\
RPTU Kaiserslautern\texttt{\symbol{45}}Landau\\
Gottlieb\texttt{\symbol{45}}Daimler\texttt{\symbol{45}}Stra{\ss}e 48\\
67663 Kaiserslautern\\
Germany\\ \end{minipage}
}\\
{\mbox{}\\ \small\noindent\textbf{ Christopher Jefferson\\
} Email: \href{mailto://caj21@st-andrews.ac.uk} {\texttt{caj21@st\texttt{\symbol{45}}andrews.ac.uk}}\\
Homepage: \href{http://caj.host.cs.st-andrews.ac.uk/} {\texttt{http://caj.host.cs.st\texttt{\symbol{45}}andrews.ac.uk/}}\\ Address: \begin{minipage}[t]{8cm}\noindent School of Computer Science\\
University of St Andrews\\
Jack Cole Building, North Haugh\\
St Andrews, Fife, KY16 9SX\\
United Kingdom\\ \end{minipage}
}\\
{\mbox{}\\ \small\noindent\textbf{ Steve Linton\\
} Email: \href{mailto://steve.linton@st-andrews.ac.uk} {\texttt{steve.linton@st\texttt{\symbol{45}}andrews.ac.uk}}\\
Homepage: \href{http://sl4.host.cs.st-andrews.ac.uk/} {\texttt{http://sl4.host.cs.st\texttt{\symbol{45}}andrews.ac.uk/}}\\ Address: \begin{minipage}[t]{8cm}\noindent School of Computer Science\\
University of St Andrews\\
Jack Cole Building, North Haugh\\
St Andrews, Fife, KY16 9SX\\
United Kingdom\\ \end{minipage}
}\\ \end{titlepage}
\newpage\setcounter{page}{2}
{\small \section*{Copyright} \logpage{[ 0, 0, 1 ]}
{\copyright} 2015\texttt{\symbol{45}}18 by Chris Jefferson, Steve Linton,
Markus Pfeiffer, Max Horn, Reimer Behrends and others
\textsf{datastructures} package is free software; you can redistribute it and/or modify it under the
terms of the \href{https://www.fsf.org/licenses/gpl.html} {GNU General Public License} as published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. \mbox{}}\\[1cm]
{\small \section*{Acknowledgements} \logpage{[ 0, 0, 2 ]}
We appreciate very much all past and future comments, suggestions and
contributions to this package and its documentation provided by \textsf{GAP} users and developers. \mbox{}}\\[1cm] \newpage
\section{\textcolor{Chapter }{Purpose and goals of this package}}\logpage{[ 1, 1, 0 ]} \hyperdef{L}{X7F0445BA85C0D680}{}
{
The \textsf{datastructures} package for \textsf{GAP} has two main goals: \begin{itemize} \item Provide abstract interfaces for commonly used datastructures \item Provide good low\texttt{\symbol{45}}level implementations for these
datastructures \end{itemize} \textsf{datastructures} requires building of a kernel module for \textsf{GAP} to function, please refer to Chapter \ref{install} for details; the package is not automatically loaded by \textsf{GAP} after it has been installed. You must load the package with \texttt{LoadPackage("datastructures");} before its functions become available.
}
\section{\textcolor{Chapter }{Overview over this manual}}\logpage{[ 1, 2, 0 ]} \hyperdef{L}{X786BACDB82918A65}{}
{
Chapter \ref{install} describes the installation of this package. The remaining chapters describe
the available datastructures in this package with a definition of the
supported API and details about provided implementations. }
\section{\textcolor{Chapter }{Feedback}}\label{feedback} \logpage{[ 1, 3, 0 ]} \hyperdef{L}{X80D704CC7EBFDF7A}{}
{
For bug reports, feature requests and suggestions, please use our \href{https://github.com/gap-packages/datastructures/issues} {issue tracker}. }
}
\chapter{\textcolor{Chapter }{Installation}}\label{install} \logpage{[ 2, 0, 0 ]} \hyperdef{L}{X8360C04082558A12}{}
{ \index{\textsf{datastructures}} \textsf{datastructures} does not work without compiling its kernel module, and is not loaded by \textsf{GAP} by default. To load the package run \texttt{LoadPackage("datastructures");} at the \textsf{GAP} prompt. \section{\textcolor{Chapter }{Building the Kernel Module}}\logpage{[ 2, 1, 0 ]} \hyperdef{L}{X8584FE1F8248F0A4}{}
{
To build the kernel module, you will need \begin{itemize} \item a C compiler, e.g. GCC or Clang \item GNU Make \end{itemize}
To install a released version of this package, extract the package's archive
file into \textsf{GAP}'s \texttt{pkg} folder.
\end{verbatim}
To build the kernel module then run the following commands in the package's
directory. \begin{verbatim}
./configure
make
\end{verbatim}
}
\section{\textcolor{Chapter }{Building the Documentation}}\logpage{[ 2, 2, 0 ]} \hyperdef{L}{X7F7AE6058776DF06}{}
{
To build the package documentation, run the following command in the package's
directory \begin{verbatim}
gap makedoc.g
A \emph{heap} is a tree datastructure such that for any child $C$ of a node $N$ it holds that $C \leq N$, according to some ordering relation $\leq$.
The fundamental operations for heaps are Construction, \texttt{Push}ing data onto the heap, \texttt{Peek}ing at the topmost item, and \texttt{Pop}ping the topmost item off of the heap.
For a good heap implementation these basic operations should not exceed $O(\log n)$ in runtime where $n$ is the number of items on the heap.
We currently provide two types of heaps: Binary Heaps \ref{Section_BinaryHeap} and Pairing Heaps \ref{Section_PairingHeap}.
The following code shows how to use a binary heap. \begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
!gapprompt@gap>| !gapinput@h := BinaryHeap();|
<binary heap with 0 entries>
!gapprompt@gap>| !gapinput@Push(h, 5);|
!gapprompt@gap>| !gapinput@Push(h, -10);|
!gapprompt@gap>| !gapinput@Peek(h);|
5
!gapprompt@gap>| !gapinput@Pop(h);|
5
!gapprompt@gap>| !gapinput@Peek(h);|
-10 \end{Verbatim}
The following code shows how to use a pairing heap. \begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
!gapprompt@gap>| !gapinput@h := PairingHeap( {x,y} -> x.rank > y.rank );|
<pairing heap with 0 entries>
!gapprompt@gap>| !gapinput@Push(h, rec( rank := 5 ));|
!gapprompt@gap>| !gapinput@Push(h, rec( rank := 7 ));|
!gapprompt@gap>| !gapinput@Push(h, rec( rank := -15 ));|
!gapprompt@gap>| !gapinput@h;|
<pairing heap with 3 entries>
!gapprompt@gap>| !gapinput@Peek(h);|
rec( rank := -15 )
!gapprompt@gap>| !gapinput@Pop(h);|
rec( rank := -15 ) \end{Verbatim}
}
For the purposes of the \textsf{datastructures}, we provide a category \texttt{IsHeap} (\ref{IsHeap:for IsObject}) . Every implementation of a heap in the category \texttt{IsHeap} (\ref{IsHeap:for IsObject}) must follow the API described in this section.
A binary heap employs a binary tree as its underlying tree datastructure. The
implemenataion of binary heaps in \textsf{datastructures} stores this tree in a flat array which makes it a very good and fast default
choice for general purpose use. In particular, even though other heap
implementations have better theoretical runtime bounds,
well\texttt{\symbol{45}}tuned binary heaps outperform them in many
applications.
Constructor for binary heaps. The optional argument \mbox{\texttt{\mdseries\slshape isLess}} must be a binary function that performs comparison between two elements on the
heap, and returns \texttt{true} if the first argument is less than the second, and \texttt{false} otherwise. Using the optional argument \mbox{\texttt{\mdseries\slshape data}} the user can give a collection of initial values that are pushed on the stack
after construction. }
A pairing heap is a heap datastructure with a very simple implementation in
terms of \textsf{GAP} lists. \texttt{Push} and \texttt{Peek} have $O(1)$ complexity, and \texttt{Pop} has an amortized amortised O(log n), where $n$ is the number of items on the heap.
Constructor for pairing heaps. The optional argument \mbox{\texttt{\mdseries\slshape isLess}} must be a binary function that performs comparison between two elements on the
heap, and returns \texttt{true} if the first argument is less than the second, and \texttt{false} otherwise. Using the optional argument \mbox{\texttt{\mdseries\slshape data}} the user can give a collection of initial values that are pushed on the stack
after construction. }
\textsf{datastructures} implements deques using a circular buffer stored in a \textsf{GAP} a plain list, wrapped in a positional object ( (\textbf{Reference: Positional Objects})).
The five positions in such a deque \texttt{Q} have the following purpose
\begin{itemize} \item\texttt{Q![1]} \texttt{\symbol{45}} head, the index in \texttt{Q![5]} of the first element in the deque \item\texttt{Q![2]} \texttt{\symbol{45}} tail, the index in \texttt{Q![5]} of the last element in the deque \item\texttt{Q![3]} \texttt{\symbol{45}} capacity, the allocated capacity in the deque \item\texttt{Q![4]} \texttt{\symbol{45}} factor by which storage is increased if capacity is
exceeded \item\texttt{Q![5]} \texttt{\symbol{45}} GAP plain list with storage for capacity many entries \end{itemize}
Global constants \texttt{QHEAD}, \texttt{QTAIL}, \texttt{QCAPACITY}, \texttt{QFACTOR}, and \texttt{QDATA} are bound to reflect the above.
When a push fills the deque, its capacity is resized by a factor of \texttt{QFACTOR} using PlistDequeExpand. A new empty plist is allocated and all current entries
of the deque are copied into the new plist with the head entry at index 1.
The deque is empty if and only if head = tail and the entry that head and tail
point to in the storage list is unbound.
Constructor for plist based deques. The optional argument \mbox{\texttt{\mdseries\slshape capacity}} must be a positive integer and is the capacity of the created deque, and the
optional argument \mbox{\texttt{\mdseries\slshape factor}} must be a rational number greater than one which is the factor by which the
storage of the deque is increased if it runs out of capacity when an object is
put on the queue. }
Pop object from the front of \mbox{\texttt{\mdseries\slshape deque}} and return it. If \mbox{\texttt{\mdseries\slshape deque}} is empty, returns \texttt{fail}. }
Pop object from the back of \mbox{\texttt{\mdseries\slshape deque}} and return it. If \mbox{\texttt{\mdseries\slshape deque}} is empty, returns \texttt{fail}. }
Returns the object at the front \mbox{\texttt{\mdseries\slshape deque}} without removing it. If \mbox{\texttt{\mdseries\slshape deque}} is empty, returns \texttt{fail}. }
Returns the object at the back \mbox{\texttt{\mdseries\slshape deque}} without removing it. If \mbox{\texttt{\mdseries\slshape deque}} is empty, returns \texttt{fail}. }
Helper function to expand the capacity of \mbox{\texttt{\mdseries\slshape deque}} by the configured factor. }
}
\emph{Queues} are linear data structure that allow adding elements at the end of the queue,
and removing elements from the front. A \emph{deque} is a \emph{double\texttt{\symbol{45}}ended queue}; a linear data structure that allows access to objects at both ends.
The API that objects that lie in \texttt{IsQueue} (\ref{IsQueue:for IsObject}) and \texttt{IsDeque} (\ref{IsDeque:for IsObject}) must implement the API set out below.
\textsf{datastructures} defines the interface for mutable data structures representing partitions of \texttt{[1..n]}, commonly known as union\texttt{\symbol{45}}find data structures. Key
operations are \texttt{Unite} (\ref{Unite:for IsPartitionDS and IsMutable, IsPosInt, IsPosInt}) which fuses two parts of a partition and \texttt{Representative} (\ref{Representative:for IsPartitionDS, IsPosInt}) which returns a canonical representative of the part containing a given point.
Fuses the parts of the partition \mbox{\texttt{\mdseries\slshape unionfind}} containing \mbox{\texttt{\mdseries\slshape k1}} and \mbox{\texttt{\mdseries\slshape k2}}. }
A hash function in \textsf{datastructures} is a function $H$ which maps a value $X$ to a small integer (where a small integer is an integer in the range \texttt{[\texttt{\symbol{45}}2\texttt{\symbol{94}}28..2\texttt{\symbol{94}}28\texttt{\symbol{45}}1]} on a 32\texttt{\symbol{45}}bit system, and \texttt{[\texttt{\symbol{45}}2\texttt{\symbol{94}}60..2\texttt{\symbol{94}}60\texttt{\symbol{45}}1]} on a 64\texttt{\symbol{45}}bit system), under the requirement that if $X=Y$, then $H(X)=H(Y)$.
A variety of hash functions is provided by \textsf{datastructures}, with different behaviours. A bad choice of hash function can lead to serious
performance problems.
\textsf{datastructures} does not guarantee consistency of hash values across release or \textsf{GAP} sessions. }
\subsection{\textcolor{Chapter }{HashBasic}} \logpage{[ 6, 2, 1 ]}\nobreak \hyperdef{L}{X85E86FF080A3A37A}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{HashBasic({\mdseries\slshape obj...})\index{HashBasic@\texttt{HashBasic}} \label{HashBasic}
}\hfill{\scriptsize (function)}}\\ \textbf{\indent Returns:\ }
a small integer
Hashes any values built inductively from \begin{itemize} \item built\texttt{\symbol{45}}in types, namely integers, booleans, permutations,
transformations, partial permutations, and \item constructors for lists and records. \end{itemize}
This function is variadic, treating more than one argument as equivalent to a
list containing the arguments, that is \texttt{HashBasic(x,y,z) = HashBasic([x,y,z])}. }
\textsf{datastructures} provides two hash functions for permutation groups; \texttt{Hash{\textunderscore}PermGroup{\textunderscore}Fast} (\ref{HashuScorePermGroupuScoreFast}) is the faster one, with higher likelihood of collisions and \texttt{Hash{\textunderscore}PermGroup{\textunderscore}Complete} (\ref{HashuScorePermGroupuScoreComplete}) is slower but provides a lower likelihood of collisions.
\subsection{\textcolor{Chapter }{Hash{\textunderscore}PermGroup{\textunderscore}Fast}} \logpage{[ 6, 3, 1 ]}\nobreak \hyperdef{L}{X848AD86F8089106F}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{Hash{\textunderscore}PermGroup{\textunderscore}Fast({\mdseries\slshape group})\index{Hash{\textunderscore}PermGroup{\textunderscore}Fast@\texttt{Hash{\textunderscore}}\-\texttt{Perm}\-\texttt{Group{\textunderscore}}\-\texttt{Fast}} \label{HashuScorePermGroupuScoreFast}
}\hfill{\scriptsize (function)}}\\ \textbf{\indent Returns:\ }
a small integer
\texttt{Hash{\textunderscore}PermGroup{\textunderscore}Fast} (\ref{HashuScorePermGroupuScoreFast}) is faster than \texttt{Hash{\textunderscore}PermGroup{\textunderscore}Complete} (\ref{HashuScorePermGroupuScoreComplete}), but will return the same value for groups with the same size, orbits and
degree of transitivity. }
\subsection{\textcolor{Chapter }{Hash{\textunderscore}PermGroup{\textunderscore}Complete}} \logpage{[ 6, 3, 2 ]}\nobreak \hyperdef{L}{X86FFE7A07E784C24}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{Hash{\textunderscore}PermGroup{\textunderscore}Complete({\mdseries\slshape group})\index{Hash{\textunderscore}PermGroup{\textunderscore}Complete@\texttt{Hash{\textunderscore}}\-\texttt{Perm}\-\texttt{Group{\textunderscore}}\-\texttt{Complete}} \label{HashuScorePermGroupuScoreComplete}
}\hfill{\scriptsize (function)}}\\ \textbf{\indent Returns:\ }
a small integer
\texttt{Hash{\textunderscore}PermGroup{\textunderscore}Complete} (\ref{HashuScorePermGroupuScoreComplete}) is slower than \texttt{Hash{\textunderscore}PermGroup{\textunderscore}Fast} (\ref{HashuScorePermGroupuScoreFast}), but is extremely unlikely to return the same hash for two different groups. }
Create a new hash map. The optional argument \mbox{\texttt{\mdseries\slshape values}} must be a list of key\texttt{\symbol{45}}value pairs which will be inserted
into the new hashmap in order. The optional argument \mbox{\texttt{\mdseries\slshape hashfunc}} must be a hash\texttt{\symbol{45}}function, \mbox{\texttt{\mdseries\slshape eqfunc}} must be a binary equality testing function that returns \texttt{true} if the two arguments are considered equal, and \texttt{false} if they are not. Refer to Chapter \ref{Chapter_HashFunctions} about the requirements for hashfunctions and equality testers. The optional
argument \mbox{\texttt{\mdseries\slshape capacity}} determines the initial size of the hashmap.
A hash set stores objects and allows efficient lookup whether an object is
already a member of the set.
\textsf{datastructures} currently provides a reference implementation of hashsets using a hashtable
stored in a plain \textsf{GAP} list. \section{\textcolor{Chapter }{API}}\label{Chapter_Hashsets_Section_API} \logpage{[ 8, 1, 0 ]} \hyperdef{L}{X7C5F33687C53BEF0}{}
{
\subsection{\textcolor{Chapter }{IsHashSet (for IsObject and IsFinite)}} \logpage{[ 8, 1, 1 ]}\nobreak \hyperdef{L}{X81FA1C7B84314DAF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsHashSet({\mdseries\slshape arg})\index{IsHashSet@\texttt{IsHashSet}!for IsObject and IsFinite} \label{IsHashSet:for IsObject and IsFinite}
}\hfill{\scriptsize (filter)}}\\ \textbf{\indent Returns:\ } \texttt{true} or \texttt{false}
Create a new hashset. The optional argument \mbox{\texttt{\mdseries\slshape values}} must be a list of values, which will be inserted into the new hashset in
order. The optional argument \mbox{\texttt{\mdseries\slshape hashfunc}} must be a hash\texttt{\symbol{45}} function, \mbox{\texttt{\mdseries\slshape eqfunc}} must be a binary equality testing function that returns \texttt{true} if the two arguments are considered equal, and \texttt{false} if they are not. Refer to Chapter \ref{Chapter_HashFunctions} about the requirements for hashfunctions and equality testers. The optional
argument \mbox{\texttt{\mdseries\slshape capacity}} determines the initial size of the hashmap.
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. }
\subsection{\textcolor{Chapter }{MemoizeFunction}} \logpage{[ 9, 1, 1 ]}\nobreak \hyperdef{L}{X7E7224D77AFAFE00}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MemoizeFunction({\mdseries\slshape function[, options]})\index{MemoizeFunction@\texttt{MemoizeFunction}} \label{MemoizeFunction}
}\hfill{\scriptsize (function)}}\\ \textbf{\indent Returns:\ }
A function
\texttt{MemoizeFunction} returns a function which behaves the same as \mbox{\texttt{\mdseries\slshape function}}, except that it caches the return value of \mbox{\texttt{\mdseries\slshape function}}. The cache can be flushed by calling \texttt{FlushCaches} (\textbf{Reference: FlushCaches}).
This function does not promise to never call \mbox{\texttt{\mdseries\slshape function}} more than once for any input\texttt{\symbol{45}}\texttt{\symbol{45}} values
may be removed if the cache gets too large, or GAP chooses to flush all
caches, or if multiple threads try to calculate the same value simultaneously.
The optional second argument is a record which provides a number of
configuration options. The following options are supported. \begin{description} \item[{\texttt{flush} (default \texttt{true})}] If this is \texttt{true}, the cache is emptied whenever \texttt{FlushCaches} (\textbf{Reference: FlushCaches}) is called. \item[{\texttt{contract} (defaults to \texttt{ReturnTrue} (\textbf{Reference: ReturnTrue}))}] A function that is called on the arguments given to \mbox{\texttt{\mdseries\slshapefunction}}. If this function returns \texttt{false}, then \texttt{errorHandler} is called. \item[{\texttt{errorHandler} (defaults to none)}] A function to be called when an input that does not fulfil \texttt{contract} is passed to the cache. \end{description}
In this chapter we deal with datastructures designed to represent sets of
objects which have an intrinsic ordering. Such datastructures should support
fast (possibly amortised) $O(\log n)$ addition, deletion and membership test operations and allow efficient
iteration through all the objects in the datastructure in the order determined
by the given comparison function. Since they represent a set, adding an object
equal to one already present has no effect.
We refer to these as ordered set \emph{datastructure} because the differ from the \textsf{GAP} notion of a set in a number of ways: \begin{itemize} \item They all lie in a common family \texttt{OrderedSetDSFamily} and pay no attention to the families of the objects stored in them. \item Equality of these structures is by identity, not equality of the represented
set \item The ordering of the objects in the set does not have to be default \textsf{GAP} ordering "less than", but is determined by the attribute \texttt{LessFunction} (\ref{LessFunction:for IsOrderedSetDS}) \end{itemize}
Three implementations of ordered set data structures are currently included:
skiplists, binary search trees and (as a specialisation of binary search
trees) AVL trees. AVL trees seem to be the fastest in general, and memory
usage is similar. More details to come \section{\textcolor{Chapter }{Usage}}\label{Chapter_Ordered_Set_Datastructures_Section_Usage} \logpage{[ 10, 1, 0 ]} \hyperdef{L}{X86A9B6F87E619FFF}{}
{
The family that contains all ordered set datastructures. Constructors for
ordered sets
The argument \mbox{\texttt{\mdseries\slshape filter}} is a filter that the resulting ordered set object will have.
The optional argument \mbox{\texttt{\mdseries\slshape lessThan}} must be a binary function that returns \texttt{true} if its first argument is less than its second argument, and \texttt{false} otherwise. The default \mbox{\texttt{\mdseries\slshape lessThan}} is \textsf{GAP}'s built in \texttt{{\textless}}.
The optional argument \mbox{\texttt{\mdseries\slshape initialEntries}} gives a collection of elements that the ordered set is initialised with, and
defaults to the empty set.
The optional argument \mbox{\texttt{\mdseries\slshape randomSource}} is useful in a number of possible implementations that use randomised methods
to achieve good amortised complexity with high probability and simple data
structures. It defaults to the global Mersenne twister.
¤ 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.0.76Bemerkung:
(vorverarbeitet)
¤
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.