]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
3 | <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | |
4 | <title>Symmetric Difference</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="intersection.html" title="Intersection"> | |
10 | <link rel="next" href="iterator_related.html" title="Iterator related"> | |
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="intersection.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="iterator_related.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
24 | </div> | |
25 | <div class="section boost_icl_function_reference_symmetric_difference" lang="en"> | |
26 | <div class="titlepage"><div><div><h3 class="title"> | |
27 | <a name="boost_icl.function_reference.symmetric_difference"></a><a class="link" href="symmetric_difference.html" title="Symmetric Difference">Symmetric | |
28 | Difference</a> | |
29 | </h3></div></div></div> | |
30 | <div class="toc"><dl> | |
31 | <dt><span class="section"><a href="symmetric_difference.html#boost_icl.function_reference.symmetric_difference.synopsis">Synopsis</a></span></dt> | |
32 | <dt><span class="section"><a href="symmetric_difference.html#boost_icl.function_reference.symmetric_difference.functions">Functions</a></span></dt> | |
33 | <dt><span class="section"><a href="symmetric_difference.html#boost_icl.function_reference.symmetric_difference.inplace_operators">Inplace | |
34 | operators</a></span></dt> | |
35 | <dt><span class="section"><a href="symmetric_difference.html#boost_icl.function_reference.symmetric_difference.infix_operators">Infix | |
36 | operators</a></span></dt> | |
37 | </dl></div> | |
38 | <div class="section boost_icl_function_reference_symmetric_difference_synopsis" lang="en"> | |
39 | <div class="titlepage"><div><div><h4 class="title"> | |
40 | <a name="boost_icl.function_reference.symmetric_difference.synopsis"></a><a class="link" href="symmetric_difference.html#boost_icl.function_reference.symmetric_difference.synopsis" title="Synopsis">Synopsis</a> | |
41 | </h4></div></div></div> | |
42 | <div class="informaltable"><table class="table"> | |
43 | <colgroup> | |
44 | <col> | |
45 | <col> | |
46 | <col> | |
47 | <col> | |
48 | <col> | |
49 | </colgroup> | |
50 | <thead><tr> | |
51 | <th> | |
52 | <p> | |
53 | Symmetric difference | |
54 | </p> | |
55 | </th> | |
56 | <th> | |
57 | <p> | |
58 | interval<br> sets | |
59 | </p> | |
60 | </th> | |
61 | <th> | |
62 | <p> | |
63 | interval<br> maps | |
64 | </p> | |
65 | </th> | |
66 | <th> | |
67 | <p> | |
68 | element<br> sets | |
69 | </p> | |
70 | </th> | |
71 | <th> | |
72 | <p> | |
73 | element<br> maps | |
74 | </p> | |
75 | </th> | |
76 | </tr></thead> | |
77 | <tbody> | |
78 | <tr> | |
79 | <td> | |
80 | <p> | |
81 | <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> | |
82 | <span class="identifier">T</span><span class="special">::</span><span class="identifier">flip</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span></code> | |
83 | </p> | |
84 | </td> | |
85 | <td> | |
86 | <p> | |
87 | <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a> | |
88 | <a class="link" href="../interface/function_synopsis.html#interval_type"><span class="bold"><strong>i</strong></span></a> | |
89 | </p> | |
90 | </td> | |
91 | <td> | |
92 | <p> | |
93 | <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a> | |
94 | <a class="link" href="../interface/function_synopsis.html#interval_mapping_type"><span class="bold"><strong>p</strong></span></a> | |
95 | </p> | |
96 | </td> | |
97 | <td> | |
98 | <p> | |
99 | </p> | |
100 | </td> | |
101 | <td> | |
102 | <p> | |
103 | <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a> | |
104 | </p> | |
105 | </td> | |
106 | </tr> | |
107 | <tr> | |
108 | <td> | |
109 | <p> | |
110 | <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> | |
111 | <span class="identifier">flip</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> | |
112 | <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span></code> | |
113 | </p> | |
114 | </td> | |
115 | <td> | |
116 | <p> | |
117 | <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a> | |
118 | <a class="link" href="../interface/function_synopsis.html#interval_type"><span class="bold"><strong>i</strong></span></a> | |
119 | </p> | |
120 | </td> | |
121 | <td> | |
122 | <p> | |
123 | <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a> | |
124 | <a class="link" href="../interface/function_synopsis.html#interval_mapping_type"><span class="bold"><strong>p</strong></span></a> | |
125 | </p> | |
126 | </td> | |
127 | <td> | |
128 | <p> | |
129 | <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a> | |
130 | </p> | |
131 | </td> | |
132 | <td> | |
133 | <p> | |
134 | <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a> | |
135 | </p> | |
136 | </td> | |
137 | </tr> | |
138 | <tr> | |
139 | <td> | |
140 | <p> | |
141 | <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> | |
142 | <span class="keyword">operator</span> <span class="special">^=(</span><span class="identifier">T</span><span class="special">&,</span> | |
143 | <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span></code> | |
144 | </p> | |
145 | </td> | |
146 | <td> | |
147 | <p> | |
148 | <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a> | |
149 | <a class="link" href="../interface/function_synopsis.html#interval_type"><span class="bold"><strong>i</strong></span></a> | |
150 | <a class="link" href="../interface/function_synopsis.html#interval_set_types"><span class="bold"><strong>S</strong></span></a> | |
151 | </p> | |
152 | </td> | |
153 | <td> | |
154 | <p> | |
155 | <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a> | |
156 | <a class="link" href="../interface/function_synopsis.html#interval_mapping_type"><span class="bold"><strong>p</strong></span></a> | |
157 | <a class="link" href="../interface/function_synopsis.html#interval_map_types"><span class="bold"><strong>M</strong></span></a> | |
158 | </p> | |
159 | </td> | |
160 | <td> | |
161 | <p> | |
162 | <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a> | |
163 | <a class="link" href="../interface/function_synopsis.html#itl_set_type"><span class="bold"><strong>s</strong></span></a> | |
164 | </p> | |
165 | </td> | |
166 | <td> | |
167 | <p> | |
168 | <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a> | |
169 | <a class="link" href="../interface/function_synopsis.html#itl_map_type"><span class="bold"><strong>m</strong></span></a> | |
170 | </p> | |
171 | </td> | |
172 | </tr> | |
173 | <tr> | |
174 | <td> | |
175 | <p> | |
176 | <code class="computeroutput"><span class="identifier">T</span> <span class="keyword">operator</span> | |
177 | <span class="special">^</span> <span class="special">(</span><span class="identifier">T</span><span class="special">,</span> | |
178 | <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span></code><br> <code class="computeroutput"><span class="identifier">T</span> | |
179 | <span class="keyword">operator</span> <span class="special">^</span> | |
180 | <span class="special">(</span><span class="keyword">const</span> | |
181 | <span class="identifier">P</span><span class="special">&,</span> | |
182 | <span class="identifier">T</span><span class="special">)</span></code> | |
183 | </p> | |
184 | </td> | |
185 | <td> | |
186 | <p> | |
187 | <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a> | |
188 | <a class="link" href="../interface/function_synopsis.html#interval_type"><span class="bold"><strong>i</strong></span></a> | |
189 | <a class="link" href="../interface/function_synopsis.html#interval_set_types"><span class="bold"><strong>S</strong></span></a> | |
190 | </p> | |
191 | </td> | |
192 | <td> | |
193 | <p> | |
194 | <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a> | |
195 | <a class="link" href="../interface/function_synopsis.html#interval_mapping_type"><span class="bold"><strong>p</strong></span></a> | |
196 | <a class="link" href="../interface/function_synopsis.html#interval_map_types"><span class="bold"><strong>M</strong></span></a> | |
197 | </p> | |
198 | </td> | |
199 | <td> | |
200 | <p> | |
201 | <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a> | |
202 | <a class="link" href="../interface/function_synopsis.html#itl_set_type"><span class="bold"><strong>s</strong></span></a> | |
203 | </p> | |
204 | </td> | |
205 | <td> | |
206 | <p> | |
207 | <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a> | |
208 | <a class="link" href="../interface/function_synopsis.html#itl_map_type"><span class="bold"><strong>m</strong></span></a> | |
209 | </p> | |
210 | </td> | |
211 | </tr> | |
212 | </tbody> | |
213 | </table></div> | |
214 | <p> | |
215 | Functions and operators that implement <span class="emphasis"><em><span class="bold"><strong>symmetric | |
216 | difference</strong></span></em></span> on <span class="bold"><strong>icl</strong></span> | |
217 | objects are given in the table above. | |
218 | </p> | |
219 | <div class="informaltable"><table class="table"> | |
220 | <colgroup> | |
221 | <col> | |
222 | <col> | |
223 | </colgroup> | |
224 | <thead><tr> | |
225 | <th> | |
226 | <p> | |
227 | </p> | |
228 | </th> | |
229 | <th> | |
230 | <p> | |
231 | Description of symmetric difference | |
232 | </p> | |
233 | </th> | |
234 | </tr></thead> | |
235 | <tbody> | |
236 | <tr> | |
237 | <td> | |
238 | <p> | |
239 | <code class="computeroutput"><span class="identifier">Sets</span></code> | |
240 | </p> | |
241 | </td> | |
242 | <td> | |
243 | <p> | |
244 | <code class="computeroutput"><span class="keyword">operator</span> <span class="special">^</span></code> | |
245 | implements <span class="emphasis"><em><span class="bold"><strong>set symmetric difference</strong></span></em></span> | |
246 | </p> | |
247 | </td> | |
248 | </tr> | |
249 | <tr> | |
250 | <td> | |
251 | <p> | |
252 | <code class="computeroutput"><span class="identifier">Maps</span></code> | |
253 | </p> | |
254 | </td> | |
255 | <td> | |
256 | <p> | |
257 | <code class="computeroutput"><span class="keyword">operator</span> <span class="special">^</span></code> | |
258 | implements a <span class="emphasis"><em><span class="bold"><strong>map symmetric difference</strong></span></em></span> | |
259 | function similar to <span class="emphasis"><em>set symmetric difference</em></span>. | |
260 | All pairs that are common to both arguments are removed. All others | |
261 | unified. | |
262 | </p> | |
263 | </td> | |
264 | </tr> | |
265 | </tbody> | |
266 | </table></div> | |
267 | </div> | |
268 | <div class="section boost_icl_function_reference_symmetric_difference_functions" lang="en"> | |
269 | <div class="titlepage"><div><div><h4 class="title"> | |
270 | <a name="boost_icl.function_reference.symmetric_difference.functions"></a><a class="link" href="symmetric_difference.html#boost_icl.function_reference.symmetric_difference.functions" title="Functions">Functions</a> | |
271 | </h4></div></div></div> | |
272 | <p> | |
273 | <span class="emphasis"><em>Symmetric difference</em></span> is implemented on interval containers | |
274 | by the function <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> | |
275 | <span class="identifier">flip</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&</span> <span class="identifier">operand</span><span class="special">)</span></code>. | |
276 | </p> | |
277 | <p> | |
278 | ||
279 | </p> | |
280 | <pre class="programlisting"><span class="identifier">flip</span><span class="special">(</span><span class="identifier">y</span><span class="special">,</span><span class="identifier">x</span><span class="special">)</span> | |
281 | </pre> | |
282 | <p> | |
283 | </p> | |
284 | <p> | |
285 | deletes every element of <code class="computeroutput"><span class="identifier">y</span></code>, | |
286 | if it is contained in <code class="computeroutput"><span class="identifier">x</span></code>. | |
287 | Elements of <code class="computeroutput"><span class="identifier">x</span></code> not contained | |
288 | in <code class="computeroutput"><span class="identifier">y</span></code> are added. For icl | |
289 | containers flip is also availabel as memeber function <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">flip</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&</span> <span class="identifier">operand</span><span class="special">)</span></code>. | |
290 | </p> | |
291 | <p> | |
292 | The admissible combinations of types for member function <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">flip</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span></code> | |
293 | can be summarized in the <span class="emphasis"><em><span class="bold"><strong>overload table</strong></span></em></span> | |
294 | below: | |
295 | </p> | |
296 | <p> | |
297 | ||
298 | </p> | |
299 | <pre class="programlisting"><span class="comment">/* overload table for */</span> <span class="identifier">T</span><span class="special">\</span><span class="identifier">P</span><span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span> | |
300 | <span class="identifier">T</span><span class="special">&</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">flip</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span> <span class="special">---+--------</span> | |
301 | <span class="identifier">T</span><span class="special">&</span> <span class="identifier">flip</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span> <span class="identifier">s</span> <span class="special">|</span> <span class="identifier">s</span> | |
302 | <span class="identifier">m</span> <span class="special">|</span> <span class="identifier">m</span> | |
303 | <span class="identifier">S</span> <span class="special">|</span> <span class="identifier">S</span> <span class="identifier">S</span> | |
304 | <span class="identifier">M</span> <span class="special">|</span> <span class="identifier">M</span> <span class="identifier">M</span> | |
305 | </pre> | |
306 | <p> | |
307 | </p> | |
308 | <p> | |
309 | The next table contains complexity characteristics for functions <code class="computeroutput"><span class="identifier">flip</span></code>. | |
310 | </p> | |
311 | <div class="table"> | |
312 | <a name="id1182273"></a><p class="title"><b>Table 1.37. Time Complexity for member functions flip on icl | |
313 | containers</b></p> | |
314 | <div class="table-contents"><table class="table" summary="Time Complexity for member functions flip on icl | |
315 | containers"> | |
316 | <colgroup> | |
317 | <col> | |
318 | <col> | |
319 | <col> | |
320 | <col> | |
321 | <col> | |
322 | </colgroup> | |
323 | <thead><tr> | |
324 | <th> | |
325 | <p> | |
326 | <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> | |
327 | <span class="identifier">T</span><span class="special">::</span><span class="identifier">flip</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span></code><br> <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> <span class="identifier">flip</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> | |
328 | <span class="identifier">P</span><span class="special">&)</span></code> | |
329 | </p> | |
330 | </th> | |
331 | <th> | |
332 | <p> | |
333 | domain<br> type | |
334 | </p> | |
335 | </th> | |
336 | <th> | |
337 | <p> | |
338 | interval<br> type | |
339 | </p> | |
340 | </th> | |
341 | <th> | |
342 | <p> | |
343 | domain<br> mapping<br> type | |
344 | </p> | |
345 | </th> | |
346 | <th> | |
347 | <p> | |
348 | interval<br> mapping<br> type | |
349 | </p> | |
350 | </th> | |
351 | </tr></thead> | |
352 | <tbody> | |
353 | <tr> | |
354 | <td> | |
355 | <p> | |
356 | <a href="http://www.cplusplus.com/reference/stl/set/" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">set</span></code> </a> | |
357 | </p> | |
358 | </td> | |
359 | <td> | |
360 | <p> | |
361 | <span class="emphasis"><em>O(log n)</em></span> | |
362 | </p> | |
363 | </td> | |
364 | <td> | |
365 | <p> | |
366 | </p> | |
367 | </td> | |
368 | <td> | |
369 | <p> | |
370 | </p> | |
371 | </td> | |
372 | <td> | |
373 | <p> | |
374 | </p> | |
375 | </td> | |
376 | </tr> | |
377 | <tr> | |
378 | <td> | |
379 | <p> | |
380 | <code class="computeroutput"><a class="link" href="../../boost/icl/map.html" title="Class template map">icl::map</a></code> | |
381 | </p> | |
382 | </td> | |
383 | <td> | |
384 | <p> | |
385 | </p> | |
386 | </td> | |
387 | <td> | |
388 | <p> | |
389 | </p> | |
390 | </td> | |
391 | <td> | |
392 | <p> | |
393 | <span class="emphasis"><em>O(log n)</em></span> | |
394 | </p> | |
395 | </td> | |
396 | <td> | |
397 | <p> | |
398 | </p> | |
399 | </td> | |
400 | </tr> | |
401 | <tr> | |
402 | <td> | |
403 | <p> | |
404 | <code class="computeroutput"><a class="link" href="../../boost/icl/interval_set.html" title="Class template interval_set">interval_set</a></code><br> | |
405 | <code class="computeroutput"><a class="link" href="../../boost/icl/separate_interval_set.html" title="Class template separate_interval_set">separate_interval_set</a></code> | |
406 | </p> | |
407 | </td> | |
408 | <td> | |
409 | <p> | |
410 | <span class="emphasis"><em>O(log n)</em></span> | |
411 | </p> | |
412 | </td> | |
413 | <td> | |
414 | <p> | |
415 | <span class="emphasis"><em>O(n)</em></span> | |
416 | </p> | |
417 | </td> | |
418 | <td> | |
419 | <p> | |
420 | </p> | |
421 | </td> | |
422 | <td> | |
423 | <p> | |
424 | </p> | |
425 | </td> | |
426 | </tr> | |
427 | <tr> | |
428 | <td> | |
429 | <p> | |
430 | <code class="computeroutput"><a class="link" href="../../boost/icl/split_interval_set.html" title="Class template split_interval_set">split_interval_set</a></code> | |
431 | </p> | |
432 | </td> | |
433 | <td> | |
434 | <p> | |
435 | <span class="emphasis"><em>O(log n)</em></span> | |
436 | </p> | |
437 | </td> | |
438 | <td> | |
439 | <p> | |
440 | <span class="emphasis"><em>O(n)</em></span> | |
441 | </p> | |
442 | </td> | |
443 | <td> | |
444 | <p> | |
445 | </p> | |
446 | </td> | |
447 | <td> | |
448 | <p> | |
449 | </p> | |
450 | </td> | |
451 | </tr> | |
452 | <tr> | |
453 | <td> | |
454 | <p> | |
455 | <code class="computeroutput"><a class="link" href="../../boost/icl/interval_map.html" title="Class template interval_map">interval_map</a></code><br> | |
456 | <code class="computeroutput"><a class="link" href="../../boost/icl/split_interval_map.html" title="Class template split_interval_map">split_interval_map</a></code> | |
457 | </p> | |
458 | </td> | |
459 | <td> | |
460 | <p> | |
461 | </p> | |
462 | </td> | |
463 | <td> | |
464 | <p> | |
465 | </p> | |
466 | </td> | |
467 | <td> | |
468 | <p> | |
469 | <span class="emphasis"><em>O(log n)</em></span> | |
470 | </p> | |
471 | </td> | |
472 | <td> | |
473 | <p> | |
474 | <span class="emphasis"><em>O(n)</em></span> | |
475 | </p> | |
476 | </td> | |
477 | </tr> | |
478 | </tbody> | |
479 | </table></div> | |
480 | </div> | |
481 | <br class="table-break"> | |
482 | </div> | |
483 | <div class="section boost_icl_function_reference_symmetric_difference_inplace_operators" lang="en"> | |
484 | <div class="titlepage"><div><div><h4 class="title"> | |
485 | <a name="boost_icl.function_reference.symmetric_difference.inplace_operators"></a><a class="link" href="symmetric_difference.html#boost_icl.function_reference.symmetric_difference.inplace_operators" title="Inplace operators">Inplace | |
486 | operators</a> | |
487 | </h4></div></div></div> | |
488 | <p> | |
489 | The overload tables below are giving admissible type combinations for | |
490 | <code class="computeroutput"><span class="keyword">operator</span> <span class="special">^=</span></code> | |
491 | that implements <span class="emphasis"><em><span class="bold"><strong>symmetric difference</strong></span></em></span>. | |
492 | </p> | |
493 | <p> | |
494 | ||
495 | </p> | |
496 | <pre class="programlisting"><span class="comment">// overload tables for element containers: interval containers: | |
497 | </span><span class="identifier">T</span><span class="special">&</span> <span class="keyword">operator</span> <span class="special">^=</span> <span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span> <span class="special">^=</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">b</span> <span class="identifier">s</span> <span class="identifier">m</span> <span class="special">^=</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span> <span class="identifier">S</span> <span class="identifier">M</span> | |
498 | <span class="special">---+--------</span> <span class="special">---+------------</span> | |
499 | <span class="identifier">s</span> <span class="special">|</span> <span class="identifier">s</span> <span class="identifier">s</span> <span class="identifier">S</span> <span class="special">|</span> <span class="identifier">S</span> <span class="identifier">S</span> <span class="identifier">S</span> | |
500 | <span class="identifier">m</span> <span class="special">|</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">M</span> <span class="special">|</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span> | |
501 | </pre> | |
502 | <p> | |
503 | Complexity characteristics for inplace operators that implement <span class="emphasis"><em><span class="bold"><strong>symmetric difference</strong></span></em></span> are given by the | |
504 | next tables where | |
505 | </p> | |
506 | <pre class="programlisting"><span class="identifier">n</span> <span class="special">=</span> <span class="identifier">iterative_size</span><span class="special">(</span><span class="identifier">y</span><span class="special">);</span> | |
507 | <span class="identifier">m</span> <span class="special">=</span> <span class="identifier">iterative_size</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span> <span class="comment">//if P is a container | |
508 | </span></pre> | |
509 | <p> | |
510 | </p> | |
511 | <div class="table"> | |
512 | <a name="id1183001"></a><p class="title"><b>Table 1.38. Time Complexity for inplace symmetric difference | |
513 | on element containers</b></p> | |
514 | <div class="table-contents"><table class="table" summary="Time Complexity for inplace symmetric difference | |
515 | on element containers"> | |
516 | <colgroup> | |
517 | <col> | |
518 | <col> | |
519 | <col> | |
520 | <col> | |
521 | <col> | |
522 | </colgroup> | |
523 | <thead><tr> | |
524 | <th> | |
525 | <p> | |
526 | <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> | |
527 | <span class="keyword">operator</span> <span class="special">&=</span> | |
528 | <span class="special">(</span><span class="identifier">T</span><span class="special">&</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">const</span> | |
529 | <span class="identifier">P</span><span class="special">&</span> | |
530 | <span class="identifier">x</span><span class="special">)</span></code> | |
531 | </p> | |
532 | </th> | |
533 | <th> | |
534 | <p> | |
535 | domain<br> type | |
536 | </p> | |
537 | </th> | |
538 | <th> | |
539 | <p> | |
540 | domain<br> mapping<br> type | |
541 | </p> | |
542 | </th> | |
543 | <th> | |
544 | <p> | |
545 | std::set | |
546 | </p> | |
547 | </th> | |
548 | <th> | |
549 | <p> | |
550 | icl::map | |
551 | </p> | |
552 | </th> | |
553 | </tr></thead> | |
554 | <tbody> | |
555 | <tr> | |
556 | <td> | |
557 | <p> | |
558 | <a href="http://www.cplusplus.com/reference/stl/set/" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">set</span></code> </a> | |
559 | </p> | |
560 | </td> | |
561 | <td> | |
562 | <p> | |
563 | <span class="emphasis"><em>O(log n)</em></span> | |
564 | </p> | |
565 | </td> | |
566 | <td> | |
567 | <p> | |
568 | </p> | |
569 | </td> | |
570 | <td> | |
571 | <p> | |
572 | <span class="emphasis"><em>O(m log n)</em></span> | |
573 | </p> | |
574 | </td> | |
575 | <td> | |
576 | <p> | |
577 | </p> | |
578 | </td> | |
579 | </tr> | |
580 | <tr> | |
581 | <td> | |
582 | <p> | |
583 | <code class="computeroutput"><a class="link" href="../../boost/icl/map.html" title="Class template map">icl::map</a></code> | |
584 | </p> | |
585 | </td> | |
586 | <td> | |
587 | <p> | |
588 | <span class="emphasis"><em>O(log n)</em></span> | |
589 | </p> | |
590 | </td> | |
591 | <td> | |
592 | <p> | |
593 | <span class="emphasis"><em>O(log n)</em></span> | |
594 | </p> | |
595 | </td> | |
596 | <td> | |
597 | <p> | |
598 | <span class="emphasis"><em>O(m log n)</em></span> | |
599 | </p> | |
600 | </td> | |
601 | <td> | |
602 | <p> | |
603 | <span class="emphasis"><em>O(m log n)</em></span> | |
604 | </p> | |
605 | </td> | |
606 | </tr> | |
607 | </tbody> | |
608 | </table></div> | |
609 | </div> | |
610 | <br class="table-break"><div class="table"> | |
611 | <a name="id1183242"></a><p class="title"><b>Table 1.39. Time Complexity for inplace symmetric | |
612 | difference on interval containers</b></p> | |
613 | <div class="table-contents"><table class="table" summary="Time Complexity for inplace symmetric | |
614 | difference on interval containers"> | |
615 | <colgroup> | |
616 | <col> | |
617 | <col> | |
618 | <col> | |
619 | <col> | |
620 | <col> | |
621 | <col> | |
622 | <col> | |
623 | </colgroup> | |
624 | <thead><tr> | |
625 | <th> | |
626 | <p> | |
627 | <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> | |
628 | <span class="keyword">operator</span> <span class="special">&=</span> | |
629 | <span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> | |
630 | <span class="identifier">P</span><span class="special">&)</span></code> | |
631 | </p> | |
632 | </th> | |
633 | <th> | |
634 | <p> | |
635 | domain<br> type | |
636 | </p> | |
637 | </th> | |
638 | <th> | |
639 | <p> | |
640 | interval<br> type | |
641 | </p> | |
642 | </th> | |
643 | <th> | |
644 | <p> | |
645 | domain<br> mapping<br> type | |
646 | </p> | |
647 | </th> | |
648 | <th> | |
649 | <p> | |
650 | interval<br> mapping<br> type | |
651 | </p> | |
652 | </th> | |
653 | <th> | |
654 | <p> | |
655 | interval<br> sets | |
656 | </p> | |
657 | </th> | |
658 | <th> | |
659 | <p> | |
660 | interval<br> maps | |
661 | </p> | |
662 | </th> | |
663 | </tr></thead> | |
664 | <tbody> | |
665 | <tr> | |
666 | <td> | |
667 | <p> | |
668 | interval_sets | |
669 | </p> | |
670 | </td> | |
671 | <td> | |
672 | <p> | |
673 | <span class="emphasis"><em>O(log n)</em></span> | |
674 | </p> | |
675 | </td> | |
676 | <td> | |
677 | <p> | |
678 | <span class="emphasis"><em>O(n)</em></span> | |
679 | </p> | |
680 | </td> | |
681 | <td> | |
682 | <p> | |
683 | </p> | |
684 | </td> | |
685 | <td> | |
686 | <p> | |
687 | </p> | |
688 | </td> | |
689 | <td> | |
690 | <p> | |
691 | <span class="emphasis"><em>O(m log(n+m))</em></span> | |
692 | </p> | |
693 | </td> | |
694 | <td> | |
695 | <p> | |
696 | </p> | |
697 | </td> | |
698 | </tr> | |
699 | <tr> | |
700 | <td> | |
701 | <p> | |
702 | interval_maps | |
703 | </p> | |
704 | </td> | |
705 | <td> | |
706 | <p> | |
707 | <span class="emphasis"><em>O(log n)</em></span> | |
708 | </p> | |
709 | </td> | |
710 | <td> | |
711 | <p> | |
712 | <span class="emphasis"><em>O(n)</em></span> | |
713 | </p> | |
714 | </td> | |
715 | <td> | |
716 | <p> | |
717 | <span class="emphasis"><em>O(log n)</em></span> | |
718 | </p> | |
719 | </td> | |
720 | <td> | |
721 | <p> | |
722 | <span class="emphasis"><em>O(n)</em></span> | |
723 | </p> | |
724 | </td> | |
725 | <td> | |
726 | <p> | |
727 | <span class="emphasis"><em>O(m log(n+m))</em></span> | |
728 | </p> | |
729 | </td> | |
730 | <td> | |
731 | <p> | |
732 | <span class="emphasis"><em>O(m log(n+m))</em></span> | |
733 | </p> | |
734 | </td> | |
735 | </tr> | |
736 | </tbody> | |
737 | </table></div> | |
738 | </div> | |
739 | <br class="table-break"> | |
740 | </div> | |
741 | <div class="section boost_icl_function_reference_symmetric_difference_infix_operators" lang="en"> | |
742 | <div class="titlepage"><div><div><h4 class="title"> | |
743 | <a name="boost_icl.function_reference.symmetric_difference.infix_operators"></a><a class="link" href="symmetric_difference.html#boost_icl.function_reference.symmetric_difference.infix_operators" title="Infix operators">Infix | |
744 | operators</a> | |
745 | </h4></div></div></div> | |
746 | <p> | |
747 | For the infix version of symmetric difference the following overloads are | |
748 | available: | |
749 | </p> | |
750 | <p> | |
751 | ||
752 | </p> | |
753 | <pre class="programlisting"><span class="comment">// overload tables for element containers: interval containers: | |
754 | </span><span class="identifier">T</span> <span class="keyword">operator</span> <span class="special">^</span> <span class="special">(</span><span class="identifier">T</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span> <span class="special">^</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">b</span> <span class="identifier">s</span> <span class="identifier">m</span> <span class="special">^</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span> <span class="identifier">S1</span> <span class="identifier">S2</span> <span class="identifier">S3</span> <span class="identifier">M1</span> <span class="identifier">M3</span> | |
755 | <span class="identifier">T</span> <span class="keyword">operator</span> <span class="special">^</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&,</span> <span class="identifier">T</span><span class="special">)</span> <span class="special">---+--------</span> <span class="special">---+---------------------------</span> | |
756 | <span class="identifier">e</span> <span class="special">|</span> <span class="identifier">s</span> <span class="identifier">e</span> <span class="special">|</span> <span class="identifier">S1</span> <span class="identifier">S2</span> <span class="identifier">S3</span> | |
757 | <span class="identifier">b</span> <span class="special">|</span> <span class="identifier">m</span> <span class="identifier">i</span> <span class="special">|</span> <span class="identifier">S1</span> <span class="identifier">S2</span> <span class="identifier">S3</span> | |
758 | <span class="identifier">s</span> <span class="special">|</span> <span class="identifier">s</span> <span class="identifier">s</span> <span class="identifier">b</span> <span class="special">|</span> <span class="identifier">M1</span> <span class="identifier">M3</span> | |
759 | <span class="identifier">m</span> <span class="special">|</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">p</span> <span class="special">|</span> <span class="identifier">M1</span> <span class="identifier">M3</span> | |
760 | <span class="identifier">S1</span> <span class="special">|</span> <span class="identifier">S1</span> <span class="identifier">S1</span> <span class="identifier">S1</span> <span class="identifier">S2</span> <span class="identifier">S3</span> | |
761 | <span class="identifier">S2</span> <span class="special">|</span> <span class="identifier">S2</span> <span class="identifier">S2</span> <span class="identifier">S2</span> <span class="identifier">S2</span> <span class="identifier">S3</span> | |
762 | <span class="identifier">S3</span> <span class="special">|</span> <span class="identifier">S3</span> <span class="identifier">S3</span> <span class="identifier">S3</span> <span class="identifier">S3</span> <span class="identifier">S3</span> | |
763 | <span class="identifier">M1</span> <span class="special">|</span> <span class="identifier">M1</span> <span class="identifier">M1</span> <span class="identifier">M1</span> <span class="identifier">M3</span> | |
764 | <span class="identifier">M3</span> <span class="special">|</span> <span class="identifier">M3</span> <span class="identifier">M3</span> <span class="identifier">M3</span> <span class="identifier">M3</span> | |
765 | </pre> | |
766 | <p> | |
767 | </p> | |
768 | <p> | |
769 | To resolve ambiguities among interval containers the <span class="emphasis"><em><span class="bold"><strong>finer</strong></span></em></span> container type is chosen as result | |
770 | type. | |
771 | </p> | |
772 | </div> | |
773 | <p> | |
774 | <span class="emphasis"><em><span class="bold"><strong>See also . . .</strong></span></em></span> | |
775 | </p> | |
776 | <div class="informaltable"><table class="table"> | |
777 | <colgroup><col></colgroup> | |
778 | <thead><tr></tr></thead> | |
779 | <tbody> | |
780 | <tr><td> | |
781 | <p> | |
782 | <a class="link" href="intersection.html" title="Intersection"><span class="emphasis"><em><span class="bold"><strong>Intersection</strong></span></em></span></a> | |
783 | </p> | |
784 | </td></tr> | |
785 | <tr><td> | |
786 | <p> | |
787 | <a class="link" href="subtraction.html" title="Subtraction"><span class="emphasis"><em><span class="bold"><strong>Subtraction</strong></span></em></span></a> | |
788 | </p> | |
789 | </td></tr> | |
790 | <tr><td> | |
791 | <p> | |
792 | <a class="link" href="addition.html" title="Addition"><span class="emphasis"><em><span class="bold"><strong>Addition</strong></span></em></span></a> | |
793 | </p> | |
794 | </td></tr> | |
795 | </tbody> | |
796 | </table></div> | |
797 | <p> | |
798 | <span class="emphasis"><em><span class="bold"><strong>Back to section . . .</strong></span></em></span> | |
799 | </p> | |
800 | <div class="informaltable"><table class="table"> | |
801 | <colgroup><col></colgroup> | |
802 | <thead><tr></tr></thead> | |
803 | <tbody> | |
804 | <tr><td> | |
805 | <p> | |
806 | <a class="link" href="../interface/function_synopsis.html#function_synopsis_table"><span class="emphasis"><em><span class="bold"><strong>Function | |
807 | Synopsis</strong></span></em></span></a> | |
808 | </p> | |
809 | </td></tr> | |
810 | <tr><td> | |
811 | <p> | |
812 | <a class="link" href="../interface.html" title="Interface"><span class="emphasis"><em><span class="bold"><strong>Interface</strong></span></em></span></a> | |
813 | </p> | |
814 | </td></tr> | |
815 | </tbody> | |
816 | </table></div> | |
817 | </div> | |
818 | <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> | |
819 | <td align="left"></td> | |
820 | <td align="right"><div class="copyright-footer">Copyright © 2007 -2010 Joachim Faulhaber<br>Copyright © 1999 -2006 Cortex Software GmbH<p> | |
821 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
822 | 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>) | |
823 | </p> | |
824 | </div></td> | |
825 | </tr></table> | |
826 | <hr> | |
827 | <div class="spirit-nav"> | |
828 | <a accesskey="p" href="intersection.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="iterator_related.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
829 | </div> | |
830 | </body> | |
831 | </html> |