]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
3 | <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | |
4 | <title>Selection</title> | |
5 | <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> | |
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> | |
7 | <link rel="home" href="../../index.html" title="Chapter 1. Boost.Icl"> | |
8 | <link rel="up" href="../function_reference.html" title="Function Reference"> | |
9 | <link rel="prev" href="range.html" title="Range"> | |
10 | <link rel="next" href="addition.html" title="Addition"> | |
11 | </head> | |
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | |
13 | <table cellpadding="2" width="100%"><tr> | |
14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> | |
15 | <td align="center"><a href="../../../../../../index.html">Home</a></td> | |
16 | <td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> | |
17 | <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> | |
18 | <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> | |
19 | <td align="center"><a href="../../../../../../more/index.htm">More</a></td> | |
20 | </tr></table> | |
21 | <hr> | |
22 | <div class="spirit-nav"> | |
23 | <a accesskey="p" href="range.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function_reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="addition.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
24 | </div> | |
25 | <div class="section boost_icl_function_reference_selection" lang="en"> | |
26 | <div class="titlepage"><div><div><h3 class="title"> | |
27 | <a name="boost_icl.function_reference.selection"></a><a class="link" href="selection.html" title="Selection">Selection</a> | |
28 | </h3></div></div></div> | |
29 | <div class="informaltable"><table class="table"> | |
30 | <colgroup> | |
31 | <col> | |
32 | <col> | |
33 | <col> | |
34 | <col> | |
35 | <col> | |
36 | <col> | |
37 | </colgroup> | |
38 | <thead><tr> | |
39 | <th> | |
40 | <p> | |
41 | <span class="emphasis"><em><span class="bold"><strong>Selection</strong></span></em></span> | |
42 | </p> | |
43 | </th> | |
44 | <th> | |
45 | <p> | |
46 | interval<br> sets | |
47 | </p> | |
48 | </th> | |
49 | <th> | |
50 | <p> | |
51 | interval<br> maps | |
52 | </p> | |
53 | </th> | |
54 | <th> | |
55 | <p> | |
56 | element<br> sets | |
57 | </p> | |
58 | </th> | |
59 | <th> | |
60 | <p> | |
61 | element<br> maps | |
62 | </p> | |
63 | </th> | |
64 | <th> | |
65 | <p> | |
66 | condition | |
67 | </p> | |
68 | </th> | |
69 | </tr></thead> | |
70 | <tbody> | |
71 | <tr> | |
72 | <td> | |
73 | <p> | |
74 | <code class="computeroutput"><span class="identifier">iterator</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">domain_type</span><span class="special">&)</span></code> | |
75 | </p> | |
76 | </td> | |
77 | <td> | |
78 | <p> | |
79 | </p> | |
80 | </td> | |
81 | <td> | |
82 | <p> | |
83 | </p> | |
84 | </td> | |
85 | <td> | |
86 | <p> | |
87 | <span class="emphasis"><em>O(log n)</em></span> | |
88 | </p> | |
89 | </td> | |
90 | <td> | |
91 | <p> | |
92 | <span class="emphasis"><em>O(log n)</em></span> | |
93 | </p> | |
94 | </td> | |
95 | <td> | |
96 | <p> | |
97 | </p> | |
98 | </td> | |
99 | </tr> | |
100 | <tr> | |
101 | <td> | |
102 | <p> | |
103 | <code class="computeroutput"><span class="identifier">const_iterator</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">domain_type</span><span class="special">&)</span><span class="keyword">const</span></code> | |
104 | </p> | |
105 | </td> | |
106 | <td> | |
107 | <p> | |
108 | <span class="emphasis"><em>O(log n)</em></span> | |
109 | </p> | |
110 | </td> | |
111 | <td> | |
112 | <p> | |
113 | <span class="emphasis"><em>O(log n)</em></span> | |
114 | </p> | |
115 | </td> | |
116 | <td> | |
117 | <p> | |
118 | <span class="emphasis"><em>O(log n)</em></span> | |
119 | </p> | |
120 | </td> | |
121 | <td> | |
122 | <p> | |
123 | <span class="emphasis"><em>O(log n)</em></span> | |
124 | </p> | |
125 | </td> | |
126 | <td> | |
127 | <p> | |
128 | </p> | |
129 | </td> | |
130 | </tr> | |
131 | <tr> | |
132 | <td> | |
133 | <p> | |
134 | <code class="computeroutput"><span class="identifier">const_iterator</span> <span class="identifier">find</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> | |
135 | <span class="identifier">domain_type</span><span class="special">&)</span></code> | |
136 | </p> | |
137 | </td> | |
138 | <td> | |
139 | <p> | |
140 | <span class="emphasis"><em>O(log n)</em></span> | |
141 | </p> | |
142 | </td> | |
143 | <td> | |
144 | <p> | |
145 | <span class="emphasis"><em>O(log n)</em></span> | |
146 | </p> | |
147 | </td> | |
148 | <td> | |
149 | <p> | |
150 | </p> | |
151 | </td> | |
152 | <td> | |
153 | <p> | |
154 | </p> | |
155 | </td> | |
156 | <td> | |
157 | <p> | |
158 | </p> | |
159 | </td> | |
160 | </tr> | |
161 | <tr> | |
162 | <td> | |
163 | <p> | |
164 | <code class="computeroutput"><span class="identifier">const_iterator</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">interval_type</span><span class="special">&)</span><span class="keyword">const</span></code> | |
165 | </p> | |
166 | </td> | |
167 | <td> | |
168 | <p> | |
169 | <span class="emphasis"><em>O(log n)</em></span> | |
170 | </p> | |
171 | </td> | |
172 | <td> | |
173 | <p> | |
174 | <span class="emphasis"><em>O(log n)</em></span> | |
175 | </p> | |
176 | </td> | |
177 | <td> | |
178 | <p> | |
179 | </p> | |
180 | </td> | |
181 | <td> | |
182 | <p> | |
183 | </p> | |
184 | </td> | |
185 | <td> | |
186 | <p> | |
187 | </p> | |
188 | </td> | |
189 | </tr> | |
190 | <tr> | |
191 | <td> | |
192 | <p> | |
193 | <code class="computeroutput"><span class="identifier">const_iterator</span> <span class="identifier">find</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> | |
194 | <span class="identifier">interval_type</span><span class="special">&)</span></code> | |
195 | </p> | |
196 | </td> | |
197 | <td> | |
198 | <p> | |
199 | <span class="emphasis"><em>O(log n)</em></span> | |
200 | </p> | |
201 | </td> | |
202 | <td> | |
203 | <p> | |
204 | <span class="emphasis"><em>O(log n)</em></span> | |
205 | </p> | |
206 | </td> | |
207 | <td> | |
208 | <p> | |
209 | </p> | |
210 | </td> | |
211 | <td> | |
212 | <p> | |
213 | </p> | |
214 | </td> | |
215 | <td> | |
216 | <p> | |
217 | </p> | |
218 | </td> | |
219 | </tr> | |
220 | <tr> | |
221 | <td> | |
222 | <p> | |
223 | <code class="computeroutput"><span class="identifier">codomain_type</span><span class="special">&</span> | |
224 | <span class="keyword">operator</span><span class="special">[]</span> | |
225 | <span class="special">(</span><span class="keyword">const</span> | |
226 | <span class="identifier">domain_type</span><span class="special">&)</span></code> | |
227 | </p> | |
228 | </td> | |
229 | <td> | |
230 | <p> | |
231 | </p> | |
232 | </td> | |
233 | <td> | |
234 | <p> | |
235 | </p> | |
236 | </td> | |
237 | <td> | |
238 | <p> | |
239 | </p> | |
240 | </td> | |
241 | <td> | |
242 | <p> | |
243 | <span class="emphasis"><em>O(log n)</em></span> | |
244 | </p> | |
245 | </td> | |
246 | <td> | |
247 | <p> | |
248 | </p> | |
249 | </td> | |
250 | </tr> | |
251 | <tr> | |
252 | <td> | |
253 | <p> | |
254 | <code class="computeroutput"><span class="identifier">codomain_type</span> <span class="keyword">operator</span><span class="special">()</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">domain_type</span><span class="special">&)</span><span class="keyword">const</span></code> | |
255 | </p> | |
256 | </td> | |
257 | <td> | |
258 | <p> | |
259 | </p> | |
260 | </td> | |
261 | <td> | |
262 | <p> | |
263 | <span class="emphasis"><em>O(log n)</em></span> | |
264 | </p> | |
265 | </td> | |
266 | <td> | |
267 | <p> | |
268 | </p> | |
269 | </td> | |
270 | <td> | |
271 | <p> | |
272 | <span class="emphasis"><em>O(log n)</em></span> | |
273 | </p> | |
274 | </td> | |
275 | <td> | |
276 | <p> | |
277 | <code class="computeroutput"><span class="identifier">is_total</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">value</span></code> | |
278 | </p> | |
279 | </td> | |
280 | </tr> | |
281 | </tbody> | |
282 | </table></div> | |
283 | <div class="itemizedlist"><ul type="disc"> | |
284 | <li> | |
285 | All time <span class="bold"><strong>complexities</strong></span> are <span class="emphasis"><em><span class="bold"><strong>logarithmic</strong></span></em></span> in the containers <code class="computeroutput"><span class="identifier">iterative_size</span><span class="special">()</span></code>. | |
286 | </li> | |
287 | <li> | |
288 | <code class="computeroutput"><span class="keyword">operator</span><span class="special">()</span></code> | |
289 | is available for total maps only. | |
290 | </li> | |
291 | <li> | |
292 | <code class="computeroutput"><span class="identifier">interval_type</span></code> is also the | |
293 | interval container's <code class="computeroutput"><span class="identifier">key_type</span></code> | |
294 | </li> | |
295 | </ul></div> | |
296 | <div class="informaltable"><table class="table"> | |
297 | <colgroup> | |
298 | <col> | |
299 | <col> | |
300 | <col> | |
301 | </colgroup> | |
302 | <thead><tr> | |
303 | <th> | |
304 | <p> | |
305 | <span class="emphasis"><em><span class="bold"><strong>Selection</strong></span></em></span> | |
306 | </p> | |
307 | </th> | |
308 | <th> | |
309 | <p> | |
310 | Types | |
311 | </p> | |
312 | </th> | |
313 | <th> | |
314 | <p> | |
315 | Description | |
316 | </p> | |
317 | </th> | |
318 | </tr></thead> | |
319 | <tbody> | |
320 | <tr> | |
321 | <td> | |
322 | <p> | |
323 | <code class="computeroutput"><span class="identifier">iterator</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">domain_type</span><span class="special">&</span> | |
324 | <span class="identifier">x</span><span class="special">)</span></code> | |
325 | </p> | |
326 | </td> | |
327 | <td> | |
328 | <p> | |
329 | <a class="link" href="../interface/function_synopsis.html#itl_set_type"><span class="bold"><strong>s</strong></span></a> | |
330 | <a class="link" href="../interface/function_synopsis.html#itl_map_type"><span class="bold"><strong>m</strong></span></a> | |
331 | </p> | |
332 | </td> | |
333 | <td> | |
334 | <p> | |
335 | Searches the container for the element <code class="computeroutput"><span class="identifier">x</span></code> | |
336 | and return an iterator to it, if <code class="computeroutput"><span class="identifier">x</span></code> | |
337 | is found. Otherwise <code class="computeroutput"><span class="identifier">find</span></code> | |
338 | returns iterator <code class="computeroutput"><span class="identifier">end</span><span class="special">()</span></code>. | |
339 | </p> | |
340 | </td> | |
341 | </tr> | |
342 | <tr> | |
343 | <td> | |
344 | <p> | |
345 | <code class="computeroutput"><span class="identifier">const_iterator</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">find</span></code><br> | |
346 | <code class="computeroutput"><span class="special">(</span><span class="keyword">const</span> | |
347 | <span class="identifier">domain_type</span><span class="special">&</span> | |
348 | <span class="identifier">x</span><span class="special">)</span><span class="keyword">const</span></code> | |
349 | </p> | |
350 | </td> | |
351 | <td> | |
352 | <p> | |
353 | <a class="link" href="../interface/function_synopsis.html#itl_set_type"><span class="bold"><strong>s</strong></span></a> | |
354 | <a class="link" href="../interface/function_synopsis.html#itl_map_type"><span class="bold"><strong>m</strong></span></a> | |
355 | </p> | |
356 | </td> | |
357 | <td> | |
358 | <p> | |
359 | Const version of <code class="computeroutput"><span class="identifier">find</span></code> | |
360 | above. | |
361 | </p> | |
362 | </td> | |
363 | </tr> | |
364 | <tr> | |
365 | <td> | |
366 | <p> | |
367 | <code class="computeroutput"><span class="identifier">const_iterator</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">find</span></code><br> | |
368 | <code class="computeroutput"><span class="special">(</span><span class="keyword">const</span> | |
369 | <span class="identifier">domain_type</span><span class="special">&</span> | |
370 | <span class="identifier">x</span><span class="special">)</span><span class="keyword">const</span></code><br> <br> <code class="computeroutput"><span class="identifier">const_iterator</span> | |
371 | <span class="identifier">find</span></code><br> <code class="computeroutput"><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> | |
372 | <span class="identifier">domain_type</span><span class="special">&</span> | |
373 | <span class="identifier">x</span><span class="special">)</span></code> | |
374 | </p> | |
375 | </td> | |
376 | <td> | |
377 | <p> | |
378 | <a class="link" href="../interface/function_synopsis.html#interval_set_types"><span class="bold"><strong>S</strong></span></a> | |
379 | <a class="link" href="../interface/function_synopsis.html#interval_map_types"><span class="bold"><strong>M</strong></span></a> | |
380 | </p> | |
381 | </td> | |
382 | <td> | |
383 | <p> | |
384 | For interval containers <code class="computeroutput"><span class="identifier">c</span></code>, | |
385 | <code class="computeroutput"><span class="identifier">c</span><span class="special">.</span><span class="identifier">find</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code> | |
386 | or <code class="computeroutput"><span class="identifier">icl</span><span class="special">::</span><span class="identifier">find</span><span class="special">(</span><span class="identifier">c</span><span class="special">,</span><span class="identifier">x</span><span class="special">)</span></code> | |
387 | searches a key element <code class="computeroutput"><span class="identifier">x</span></code> | |
388 | and returns an iterator to the interval containing the element <code class="computeroutput"><span class="identifier">x</span></code>. | |
389 | </p> | |
390 | </td> | |
391 | </tr> | |
392 | <tr> | |
393 | <td> | |
394 | <p> | |
395 | <code class="computeroutput"><span class="identifier">const_iterator</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">find</span></code><br> | |
396 | <code class="computeroutput"><span class="special">(</span><span class="keyword">const</span> | |
397 | <span class="identifier">interval_type</span><span class="special">&</span> | |
398 | <span class="identifier">x</span><span class="special">)</span><span class="keyword">const</span></code><br> <br> <code class="computeroutput"><span class="identifier">const_iterator</span> | |
399 | <span class="identifier">find</span></code><br> <code class="computeroutput"><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> | |
400 | <span class="identifier">interval_type</span><span class="special">&</span> | |
401 | <span class="identifier">x</span><span class="special">)</span></code> | |
402 | </p> | |
403 | </td> | |
404 | <td> | |
405 | <p> | |
406 | <a class="link" href="../interface/function_synopsis.html#interval_set_types"><span class="bold"><strong>S</strong></span></a> | |
407 | <a class="link" href="../interface/function_synopsis.html#interval_map_types"><span class="bold"><strong>M</strong></span></a> | |
408 | </p> | |
409 | </td> | |
410 | <td> | |
411 | <p> | |
412 | For interval containers <code class="computeroutput"><span class="identifier">c</span></code>, | |
413 | <code class="computeroutput"><span class="identifier">c</span><span class="special">.</span><span class="identifier">find</span><span class="special">(</span><span class="identifier">y</span><span class="special">)</span></code> | |
414 | or <code class="computeroutput"><span class="identifier">icl</span><span class="special">::</span><span class="identifier">find</span><span class="special">(</span><span class="identifier">c</span><span class="special">,</span><span class="identifier">y</span><span class="special">)</span></code> | |
415 | searches an interval <code class="computeroutput"><span class="identifier">y</span></code> | |
416 | and returns an iterator to the first interval in <code class="computeroutput"><span class="identifier">c</span></code> | |
417 | that overlaps with <code class="computeroutput"><span class="identifier">y</span></code>. | |
418 | </p> | |
419 | </td> | |
420 | </tr> | |
421 | <tr> | |
422 | <td> | |
423 | <p> | |
424 | <code class="computeroutput"><span class="identifier">codomain_type</span><span class="special">&</span> | |
425 | <span class="keyword">operator</span><span class="special">[]</span></code><br> | |
426 | <code class="computeroutput"><span class="special">(</span><span class="keyword">const</span> | |
427 | <span class="identifier">domain_type</span><span class="special">&</span> | |
428 | <span class="identifier">x</span><span class="special">)</span></code> | |
429 | </p> | |
430 | </td> | |
431 | <td> | |
432 | <p> | |
433 | <a class="link" href="../interface/function_synopsis.html#itl_map_type"><span class="bold"><strong>m</strong></span></a> | |
434 | </p> | |
435 | </td> | |
436 | <td> | |
437 | <p> | |
438 | For the key element <code class="computeroutput"><span class="identifier">x</span></code> | |
439 | the operator returns a reference to the mapped value. A pair <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</span><span class="identifier">codomain_type</span><span class="special">())</span></code> | |
440 | will be inserted, of <code class="computeroutput"><span class="identifier">x</span></code> | |
441 | is not found in the map. | |
442 | </p> | |
443 | </td> | |
444 | </tr> | |
445 | <tr> | |
446 | <td> | |
447 | <p> | |
448 | <code class="computeroutput"><span class="identifier">codomain_type</span> <span class="keyword">operator</span><span class="special">()</span></code><br> <code class="computeroutput"><span class="special">(</span><span class="keyword">const</span> <span class="identifier">domain_type</span><span class="special">&</span> <span class="identifier">x</span><span class="special">)</span><span class="keyword">const</span></code> | |
449 | </p> | |
450 | </td> | |
451 | <td> | |
452 | <p> | |
453 | <a class="link" href="../interface/function_synopsis.html#interval_map_types"><span class="bold"><strong>M</strong></span></a> | |
454 | <a class="link" href="../interface/function_synopsis.html#itl_map_type"><span class="bold"><strong>m</strong></span></a> | |
455 | </p> | |
456 | </td> | |
457 | <td> | |
458 | <p> | |
459 | Returns the mapped value for a key <code class="computeroutput"><span class="identifier">x</span></code>. | |
460 | The operator is only available for <span class="emphasis"><em><span class="bold"><strong>total</strong></span></em></span> | |
461 | maps. | |
462 | </p> | |
463 | </td> | |
464 | </tr> | |
465 | </tbody> | |
466 | </table></div> | |
467 | <p> | |
468 | <span class="emphasis"><em><span class="bold"><strong>See also . . .</strong></span></em></span> | |
469 | </p> | |
470 | <div class="informaltable"><table class="table"> | |
471 | <colgroup><col></colgroup> | |
472 | <thead><tr></tr></thead> | |
473 | <tbody><tr><td> | |
474 | <p> | |
475 | <a class="link" href="intersection.html" title="Intersection"><span class="emphasis"><em><span class="bold"><strong>Intersection</strong></span></em></span></a> | |
476 | </p> | |
477 | </td></tr></tbody> | |
478 | </table></div> | |
479 | <p> | |
480 | <span class="emphasis"><em><span class="bold"><strong>Back to section . . .</strong></span></em></span> | |
481 | </p> | |
482 | <div class="informaltable"><table class="table"> | |
483 | <colgroup><col></colgroup> | |
484 | <thead><tr></tr></thead> | |
485 | <tbody> | |
486 | <tr><td> | |
487 | <p> | |
488 | <a class="link" href="../interface/function_synopsis.html#function_synopsis_table"><span class="emphasis"><em><span class="bold"><strong>Function | |
489 | Synopsis</strong></span></em></span></a> | |
490 | </p> | |
491 | </td></tr> | |
492 | <tr><td> | |
493 | <p> | |
494 | <a class="link" href="../interface.html" title="Interface"><span class="emphasis"><em><span class="bold"><strong>Interface</strong></span></em></span></a> | |
495 | </p> | |
496 | </td></tr> | |
497 | </tbody> | |
498 | </table></div> | |
499 | </div> | |
500 | <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> | |
501 | <td align="left"></td> | |
502 | <td align="right"><div class="copyright-footer">Copyright © 2007 -2010 Joachim Faulhaber<br>Copyright © 1999 -2006 Cortex Software GmbH<p> | |
503 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
504 | file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) | |
505 | </p> | |
506 | </div></td> | |
507 | </tr></table> | |
508 | <hr> | |
509 | <div class="spirit-nav"> | |
510 | <a accesskey="p" href="range.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function_reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="addition.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
511 | </div> | |
512 | </body> | |
513 | </html> |