xref: /petsc/include/petsc/private/hashset.txt (revision 6d8694c4fbab79f9439f1ad13c0386ba7ee1ca4b)
1/* MANSEC = Sys */
2/* SUBMANSEC = PetscH */
3
4This file is processed by doc/build_man_pages.py to create manual pages
5for the types and macros created by PETSC_HASH_SET(). For example, PetscHHashIJ.
6
7/*S
8  PetscHSet<T> - Hash set with a key of <KeyType>
9
10  Level: developer
11
12.seealso: `PETSC_HASH_SET()`, `PetscHSet<T>Create()`, `PetscHSet<T>Destroy()`, `PetscHSet<T>QueryAdd()`, `PetscHSet<T>Del()`,
13          `PetscHSet<T>Add()`, `PetscHSet<T>Reset()`, `PETSC_HASH_MAP()`, `PetscHMap<T>Create()`,  `PetscHSet<T>`
14S*/
15typedef struct _PetscHash<T> PetscHSet<T>;
16
17/*MC
18  PetscHSet<T>Create - Create a hash set
19
20  Synopsis:
21  #include <petsc/private/hashset<t>.h>
22  PetscErrorCode PetscHSet<T>Create(PetscHSet<T> *ht)
23
24  Output Parameter:
25. ht - The hash set
26
27  Level: developer
28
29.seealso: `PetscHSet<T>Destroy()`
30M*/
31
32/*MC
33  PetscHSet<T>Destroy - Destroy a hash set
34
35  Synopsis:
36  #include <petsc/private/hashset<t>.h>
37  PetscErrorCode PetscHSet<T>Destroy(PetscHSet<T> *ht)
38
39  Input Parameter:
40. ht - The hash set
41
42  Level: developer
43
44.seealso: `PetscHSet<T>Create()`
45M*/
46
47/*MC
48  PetscHSet<T>Reset - Reset a hash set
49
50  Synopsis:
51  #include <petsc/private/hashset<t>.h>
52  PetscErrorCode PetscHSet<T>Reset(PetscHSet<T> ht)
53
54  Input Parameter:
55. ht - The hash set
56
57  Level: developer
58
59.seealso: `PetscHSet<T>Clear()`
60M*/
61
62/*MC
63  PetscHSet<T>Duplicate - Duplicate a hash set
64
65  Synopsis:
66  #include <petsc/private/hashset<t>.h>
67  PetscErrorCode PetscHSet<T>Duplicate(PetscHSet<T> ht,PetscHSet<T> *hd)
68
69  Input Parameter:
70. ht - The source hash set
71
72  Output Parameter:
73. ht - The duplicated hash set
74
75  Level: developer
76
77.seealso: `PetscHSet<T>Create()`
78M*/
79
80/*MC
81  PetscHSet<T>Update - Add entries from a has set to another
82
83  Synopsis:
84  #include <petsc/private/hashset<t>.h>
85  PetscErrorCode PetscHSet<T>Update(PetscHSet<T> ht,PetscHSet<T> hda)
86
87  Input Parameters:
88+ ht - The hash set to which elements are added
89- hta - The hash set from which the elements are retrieved
90
91  Output Parameter:
92. ht - The hash set filled with the elements from the other hash set
93
94  Level: developer
95
96.seealso: `PetscHSet<T>Create()`, `PetscHSet<T>Duplicate()`
97M*/
98
99/*MC
100  PetscHSet<T>Clear - Clear a hash set
101
102  Synopsis:
103  #include <petsc/private/hashset<t>.h>
104  PetscErrorCode PetscHSet<T>Clear(PetscHSet<T> ht)
105
106  Input Parameter:
107. ht - The hash set
108
109  Level: developer
110
111.seealso: `PetscHSet<T>Reset()`
112M*/
113
114/*MC
115  PetscHSet<T>Resize - Set the number of buckets in a hash set
116
117  Synopsis:
118  #include <petsc/private/hashset<t>.h>
119  PetscErrorCode PetscHSet<T>Resize(PetscHSet<T> ht,PetscInt nb)
120
121  Input Parameters:
122+ ht - The hash set
123- nb - The number of buckets
124
125  Level: developer
126
127.seealso: `PetscHSet<T>Create()`
128M*/
129
130/*MC
131  PetscHSet<T>GetSize - Get the number of entries in a hash set
132
133  Synopsis:
134  #include <petsc/private/hashset<t>.h>
135  PetscErrorCode PetscHSet<T>GetSize(PetscHSet<T> ht,PetscInt *n)
136
137  Input Parameter:
138. ht - The hash set
139
140  Output Parameter:
141. n - The number of entries
142
143  Level: developer
144
145.seealso: `PetscHSet<T>Resize()`
146M*/
147
148/*MC
149  PetscHSet<T>GetCapacity - Get the current size of the array in the hash set
150
151  Synopsis:
152  #include <petsc/private/hashset<t>.h>
153  PetscErrorCode PetscHSet<T>GetCapacity(PetscHSet<T> ht,PetscInt *n)
154
155  Input Parameter:
156. ht - The hash set
157
158  Output Parameter:
159. n - The capacity
160
161  Level: developer
162
163.seealso: `PetscHSet<T>Resize()`, `PetscHSet<T>GetSize()`
164M*/
165
166/*MC
167  PetscHSet<T>Has - Query for an entry in the hash set
168
169  Synopsis:
170  #include <petsc/private/hashset<t>.h>
171  PetscErrorCode PetscHSet<T>Has(PetscHSet<T> ht, <KeyType> key, PetscBool *has)
172
173  Input Parameters:
174+ ht  - The hash set
175- key - The entry
176
177  Output Parameter:
178. has - Boolean indicating whether the entry is in the hash set
179
180  Level: developer
181
182.seealso: `PetscHSet<T>Add()`, `PetscHSet<T>Del()`, `PetscHSet<T>QueryAdd()`
183M*/
184
185/*MC
186  PetscHSet<T>Add - Set an entry in the hash set
187
188  Synopsis:
189  #include <petsc/private/hashset<t>.h>
190  PetscErrorCode PetscHSet<T>Add(PetscHSet<T> ht, <KeyType> key)
191
192  Input Parameters:
193+ ht  - The hash set
194- key - The entry
195
196  Level: developer
197
198.seealso: `PetscHSet<T>Del()`, `PetscHSet<T>Has()`, `PetscHSet<T>QueryAdd()`
199M*/
200
201/*MC
202  PetscHSet<T>Del - Remove an entry from the hash set
203
204  Synopsis:
205  #include <petsc/private/hashset<t>.h>
206  PetscErrorCode PetscHSet<T>Del(PetscHSet<T> ht, <KeyType> key)
207
208  Input Parameters:
209+ ht  - The hash set
210- key - The entry
211
212  Level: developer
213
214.seealso: `PetscHSet<T>Add()`, `PetscHSet<T>Has()`
215M*/
216
217/*MC
218  PetscHSet<T>QueryAdd - Query and add an entry in the hash set
219
220  Synopsis:
221  #include <petsc/private/hashset<t>.h>
222  PetscErrorCode PetscHSet<T>QueryAdd(PetscHSet<T> ht, <KeyType> key, PetscBool *missing)
223
224  Input Parameters:
225+ ht  - The hash set
226- key - The entry
227
228  Output Parameter:
229. missing - Boolean indicating whether the entry was missing
230
231  Level: developer
232
233.seealso: `PetscHSet<T>QueryDel()`, `PetscHSet<T>Add()`, `PetscHSet<T>Has()`
234M*/
235
236/*MC
237  PetscHSet<T>QueryDel - Query and remove an entry from the hash set
238
239  Synopsis:
240  #include <petsc/private/hashset<t>.h>
241  PetscErrorCode PetscHSet<T>QueryDel(PetscHSet<T> ht, <KeyType> key, PetscBool *present)
242
243  Input Parameters:
244+ ht  - The hash set
245- key - The entry
246
247  Output Parameter:
248. present - Boolean indicating whether the entry was present
249
250  Level: developer
251
252.seealso: `PetscHSet<T>QueryAdd()`, `PetscHSet<T>Del()`
253M*/
254
255/*MC
256  PetscHSet<T>GetElems - Get all entries from a hash set
257
258  Synopsis:
259  #include <petsc/private/hashset<t>.h>
260  PetscErrorCode PetscHSet<T>GetElems(PetscHSet<T> ht, PetscInt *off, <KeyType> array[])
261
262  Input Parameters:
263+ ht    - The hash set
264. off   - Input offset in array (usually zero)
265- array - Array to put hash set entries in
266
267  Output Parameters:
268+ off   - Output offset in array (output offset = input offset + hash set size)
269- array - Array filled with the hash set entries
270
271  Level: developer
272
273.seealso: `PetscHSet<T>GetSize()`
274M*/
275