1<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
2<!-- %% -->
3<!-- %A  coll.msk                    GAP documentation            Alexander Hulpke -->
4<!-- %% -->
5<!-- %A  @(#)<M>Id: coll.msk,v 1.24 2006/08/29 13:38:17 gap Exp </M> -->
6<!-- %% -->
7<!-- %Y  (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland -->
8<!-- %Y  Copyright (C) 2002 The GAP Group -->
9<!-- %% -->
10<Chapter Label="Collections">
11<Heading>Collections</Heading>
12
13<#Include Label="[1]{coll}">
14
15
16<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
17<Section Label="sect:IsCollection">
18<Heading>IsCollection (Filter)</Heading>
19
20<#Include Label="IsCollection">
21
22</Section>
23
24
25<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
26<Section Label="Collection Families">
27<Heading>Collection Families</Heading>
28
29<#Include Label="CollectionsFamily">
30<#Include Label="IsCollectionFamily">
31<#Include Label="ElementsFamily">
32<#Include Label="CategoryCollections">
33<#Include Label="DeclareCategoryCollections">
34
35</Section>
36
37
38<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
39<Section Label="Lists and Collections">
40<Heading>Lists and Collections</Heading>
41
42<Index>Sorted Lists as Collections</Index>
43The following functions take a <E>list or collection</E> as argument,
44and return a corresponding <E>list</E>.
45They differ in whether or not the result is
46mutable or immutable (see&nbsp;<Ref Sect="Mutability and Copyability"/>),
47guaranteed to be sorted,
48or guaranteed to admit list access in constant time
49(see&nbsp;<Ref Filt="IsConstantTimeAccessList"/>).
50
51<#Include Label="IsListOrCollection">
52<#Include Label="Enumerator">
53<#Include Label="EnumeratorSorted">
54<#Include Label="EnumeratorByFunctions">
55<#Include Label="List:coll">
56<#Include Label="SortedList">
57<#Include Label="SSortedList">
58<#Include Label="AsList">
59<#Include Label="AsSortedList">
60<#Include Label="AsSSortedList">
61<#Include Label="Elements">
62
63</Section>
64
65
66<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
67<Section Label="Attributes and Properties for Collections">
68<Heading>Attributes and Properties for Collections</Heading>
69
70<#Include Label="IsEmpty">
71<#Include Label="IsFinite">
72<#Include Label="IsTrivial">
73<#Include Label="IsNonTrivial">
74<#Include Label="IsWholeFamily">
75<#Include Label="Size">
76<#Include Label="Representative">
77<#Include Label="RepresentativeSmallest">
78
79</Section>
80
81
82<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
83<Section Label="Operations for Collections">
84<Heading>Operations for Collections</Heading>
85
86<#Include Label="IsSubset">
87<#Include Label="Intersection">
88<#Include Label="Union">
89<#Include Label="Difference">
90
91</Section>
92
93
94<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
95<Section Label="Membership Test for Collections">
96<Heading>Membership Test for Collections</Heading>
97
98<Index Key="in" Subkey="operation for testing membership">
99<C>\in</C></Index>
100<Index Key="in" Subkey="operation for"><K>in</K></Index>
101
102<ManSection>
103<Oper Name="\in" Arg='obj, C' Label="for a collection"/>
104
105<Description>
106returns <K>true</K> if the object <A>obj</A> lies in the collection <A>C</A>,
107and <K>false</K> otherwise.
108<P/>
109The infix version of the command
110<P/>
111<A>obj</A> <K>in</K> <A>C</A>
112<P/>
113calls the operation <Ref Oper="\in" Label="for a collection"/>,
114for which methods can be installed.
115<P/>
116<Example><![CDATA[
117gap> 13 in Integers;  [ 1, 2 ] in Integers;
118true
119false
120gap> g:= Group( (1,2) );;  (1,2) in g;  (1,2,3) in g;
121true
122false
123]]></Example>
124</Description>
125</ManSection>
126
127</Section>
128
129
130<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
131<Section Label="Random Elements">
132<Heading>Random Elements</Heading>
133
134<#Include Label="[2]{coll}">
135<#Include Label="Random:coll">
136<#Include Label="PseudoRandom">
137<#Include Label="RandomList">
138
139</Section>
140
141
142<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
143<Section Label="Iterators">
144<Heading>Iterators</Heading>
145
146<#Include Label="Iterator">
147<#Include Label="IteratorSorted">
148<#Include Label="IsIterator">
149<#Include Label="IsDoneIterator">
150<#Include Label="NextIterator">
151<#Include Label="IteratorList">
152<#Include Label="TrivialIterator">
153<#Include Label="IteratorByFunctions">
154
155</Section>
156</Chapter>
157
158<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
159<!-- %% -->
160<!-- %E -->
161
162