1 // <algorithm> parallel extensions -*- C++ -*-
3 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the terms
7 // of the GNU General Public License as published by the Free Software
8 // Foundation; either version 3, or (at your option) any later
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
25 /** @file parallel/algorithmfwd.h
26 * This file is a GNU parallel extension to the Standard C++ Library.
29 #ifndef _GLIBCXX_PARALLEL_ALGORITHMFWD_H
30 #define _GLIBCXX_PARALLEL_ALGORITHMFWD_H 1
32 #pragma GCC system_header
34 #include <parallel/tags.h>
35 #include <parallel/settings.h>
37 namespace std
_GLIBCXX_VISIBILITY(default)
41 template<typename _FIter
>
43 adjacent_find(_FIter
, _FIter
);
45 template<typename _FIter
>
47 adjacent_find(_FIter
, _FIter
, __gnu_parallel::sequential_tag
);
49 template<typename _FIter
, typename _IterTag
>
51 __adjacent_find_switch(_FIter
, _FIter
, _IterTag
);
53 template<typename _RAIter
>
55 __adjacent_find_switch(_RAIter
, _RAIter
, random_access_iterator_tag
);
58 template<typename _FIter
, typename _BiPredicate
>
60 adjacent_find(_FIter
, _FIter
, _BiPredicate
);
62 template<typename _FIter
, typename _BiPredicate
>
64 adjacent_find(_FIter
, _FIter
, _BiPredicate
,
65 __gnu_parallel::sequential_tag
);
67 template<typename _FIter
, typename _BiPredicate
, typename _IterTag
>
69 __adjacent_find_switch(_FIter
, _FIter
, _BiPredicate
, _IterTag
);
71 template<typename _RAIter
, typename _BiPredicate
>
73 __adjacent_find_switch(_RAIter
, _RAIter
, _BiPredicate
,
74 random_access_iterator_tag
);
77 template<typename _IIter
, typename _Tp
>
78 typename iterator_traits
<_IIter
>::difference_type
79 count(_IIter
, _IIter
, const _Tp
&);
81 template<typename _IIter
, typename _Tp
>
82 typename iterator_traits
<_IIter
>::difference_type
83 count(_IIter
, _IIter
, const _Tp
&, __gnu_parallel::sequential_tag
);
85 template<typename _IIter
, typename _Tp
>
86 typename iterator_traits
<_IIter
>::difference_type
87 count(_IIter
, _IIter
, const _Tp
&, __gnu_parallel::_Parallelism
);
89 template<typename _IIter
, typename _Tp
, typename _IterTag
>
90 typename iterator_traits
<_IIter
>::difference_type
91 __count_switch(_IIter
, _IIter
, const _Tp
&, _IterTag
);
93 template<typename _RAIter
, typename _Tp
>
94 typename iterator_traits
<_RAIter
>::difference_type
95 __count_switch(_RAIter
, _RAIter
, const _Tp
&, random_access_iterator_tag
,
96 __gnu_parallel::_Parallelism __parallelism
97 = __gnu_parallel::parallel_unbalanced
);
100 template<typename _IIter
, typename _Predicate
>
101 typename iterator_traits
<_IIter
>::difference_type
102 count_if(_IIter
, _IIter
, _Predicate
);
104 template<typename _IIter
, typename _Predicate
>
105 typename iterator_traits
<_IIter
>::difference_type
106 count_if(_IIter
, _IIter
, _Predicate
, __gnu_parallel::sequential_tag
);
108 template<typename _IIter
, typename _Predicate
>
109 typename iterator_traits
<_IIter
>::difference_type
110 count_if(_IIter
, _IIter
, _Predicate
, __gnu_parallel::_Parallelism
);
112 template<typename _IIter
, typename _Predicate
, typename _IterTag
>
113 typename iterator_traits
<_IIter
>::difference_type
114 __count_if_switch(_IIter
, _IIter
, _Predicate
, _IterTag
);
116 template<typename _RAIter
, typename _Predicate
>
117 typename iterator_traits
<_RAIter
>::difference_type
118 __count_if_switch(_RAIter
, _RAIter
, _Predicate
, random_access_iterator_tag
,
119 __gnu_parallel::_Parallelism __parallelism
120 = __gnu_parallel::parallel_unbalanced
);
123 template<typename _IIter1
, typename _IIter2
>
125 equal(_IIter1
, _IIter1
, _IIter2
, __gnu_parallel::sequential_tag
);
127 template<typename _IIter1
, typename _IIter2
, typename _Predicate
>
129 equal(_IIter1
, _IIter1
, _IIter2
, _Predicate
,
130 __gnu_parallel::sequential_tag
);
132 template<typename _IIter1
, typename _IIter2
>
134 equal(_IIter1
, _IIter1
, _IIter2
);
136 template<typename _IIter1
, typename _IIter2
, typename _Predicate
>
138 equal(_IIter1
, _IIter1
, _IIter2
, _Predicate
);
140 template<typename _IIter
, typename _Tp
>
142 find(_IIter
, _IIter
, const _Tp
&, __gnu_parallel::sequential_tag
);
144 template<typename _IIter
, typename _Tp
>
146 find(_IIter
, _IIter
, const _Tp
& __val
);
148 template<typename _IIter
, typename _Tp
, typename _IterTag
>
150 __find_switch(_IIter
, _IIter
, const _Tp
&, _IterTag
);
152 template<typename _RAIter
, typename _Tp
>
154 __find_switch(_RAIter
, _RAIter
, const _Tp
&, random_access_iterator_tag
);
156 template<typename _IIter
, typename _Predicate
>
158 find_if(_IIter
, _IIter
, _Predicate
, __gnu_parallel::sequential_tag
);
160 template<typename _IIter
, typename _Predicate
>
162 find_if(_IIter
, _IIter
, _Predicate
);
164 template<typename _IIter
, typename _Predicate
, typename _IterTag
>
166 __find_if_switch(_IIter
, _IIter
, _Predicate
, _IterTag
);
168 template<typename _RAIter
, typename _Predicate
>
170 __find_if_switch(_RAIter
, _RAIter
, _Predicate
, random_access_iterator_tag
);
172 template<typename _IIter
, typename _FIter
>
174 find_first_of(_IIter
, _IIter
, _FIter
, _FIter
,
175 __gnu_parallel::sequential_tag
);
177 template<typename _IIter
, typename _FIter
, typename _BiPredicate
>
179 find_first_of(_IIter
, _IIter
, _FIter
, _FIter
, _BiPredicate
,
180 __gnu_parallel::sequential_tag
);
182 template<typename _IIter
, typename _FIter
, typename _BiPredicate
>
184 find_first_of(_IIter
, _IIter
, _FIter
, _FIter
, _BiPredicate
);
186 template<typename _IIter
, typename _FIter
>
188 find_first_of(_IIter
, _IIter
, _FIter
, _FIter
);
190 template<typename _IIter
, typename _FIter
,
191 typename _IterTag1
, typename _IterTag2
>
193 __find_first_of_switch(
194 _IIter
, _IIter
, _FIter
, _FIter
, _IterTag1
, _IterTag2
);
196 template<typename _RAIter
, typename _FIter
, typename _BiPredicate
,
199 __find_first_of_switch(_RAIter
, _RAIter
, _FIter
, _FIter
, _BiPredicate
,
200 random_access_iterator_tag
, _IterTag
);
202 template<typename _IIter
, typename _FIter
, typename _BiPredicate
,
203 typename _IterTag1
, typename _IterTag2
>
205 __find_first_of_switch(_IIter
, _IIter
, _FIter
, _FIter
, _BiPredicate
,
206 _IterTag1
, _IterTag2
);
209 template<typename _IIter
, typename _Function
>
211 for_each(_IIter
, _IIter
, _Function
);
213 template<typename _IIter
, typename _Function
>
215 for_each(_IIter
, _IIter
, _Function
, __gnu_parallel::sequential_tag
);
217 template<typename _Iterator
, typename _Function
>
219 for_each(_Iterator
, _Iterator
, _Function
, __gnu_parallel::_Parallelism
);
221 template<typename _IIter
, typename _Function
, typename _IterTag
>
223 __for_each_switch(_IIter
, _IIter
, _Function
, _IterTag
);
225 template<typename _RAIter
, typename _Function
>
227 __for_each_switch(_RAIter
, _RAIter
, _Function
, random_access_iterator_tag
,
228 __gnu_parallel::_Parallelism __parallelism
229 = __gnu_parallel::parallel_balanced
);
232 template<typename _FIter
, typename _Generator
>
234 generate(_FIter
, _FIter
, _Generator
);
236 template<typename _FIter
, typename _Generator
>
238 generate(_FIter
, _FIter
, _Generator
, __gnu_parallel::sequential_tag
);
240 template<typename _FIter
, typename _Generator
>
242 generate(_FIter
, _FIter
, _Generator
, __gnu_parallel::_Parallelism
);
244 template<typename _FIter
, typename _Generator
, typename _IterTag
>
246 __generate_switch(_FIter
, _FIter
, _Generator
, _IterTag
);
248 template<typename _RAIter
, typename _Generator
>
250 __generate_switch(_RAIter
, _RAIter
, _Generator
, random_access_iterator_tag
,
251 __gnu_parallel::_Parallelism __parallelism
252 = __gnu_parallel::parallel_balanced
);
254 template<typename _OIter
, typename _Size
, typename _Generator
>
256 generate_n(_OIter
, _Size
, _Generator
);
258 template<typename _OIter
, typename _Size
, typename _Generator
>
260 generate_n(_OIter
, _Size
, _Generator
, __gnu_parallel::sequential_tag
);
262 template<typename _OIter
, typename _Size
, typename _Generator
>
264 generate_n(_OIter
, _Size
, _Generator
, __gnu_parallel::_Parallelism
);
266 template<typename _OIter
, typename _Size
, typename _Generator
,
269 __generate_n_switch(_OIter
, _Size
, _Generator
, _IterTag
);
271 template<typename _RAIter
, typename _Size
, typename _Generator
>
273 __generate_n_switch(_RAIter
, _Size
, _Generator
, random_access_iterator_tag
,
274 __gnu_parallel::_Parallelism __parallelism
275 = __gnu_parallel::parallel_balanced
);
277 template<typename _IIter1
, typename _IIter2
>
279 lexicographical_compare(_IIter1
, _IIter1
, _IIter2
, _IIter2
,
280 __gnu_parallel::sequential_tag
);
282 template<typename _IIter1
, typename _IIter2
, typename _Predicate
>
284 lexicographical_compare(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _Predicate
,
285 __gnu_parallel::sequential_tag
);
287 template<typename _IIter1
, typename _IIter2
>
289 lexicographical_compare(_IIter1
, _IIter1
, _IIter2
, _IIter2
);
291 template<typename _IIter1
, typename _IIter2
, typename _Predicate
>
293 lexicographical_compare(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _Predicate
);
295 template<typename _IIter1
, typename _IIter2
,
296 typename _Predicate
, typename _IterTag1
, typename _IterTag2
>
298 __lexicographical_compare_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
,
299 _Predicate
, _IterTag1
, _IterTag2
);
301 template<typename _RAIter1
, typename _RAIter2
, typename _Predicate
>
303 __lexicographical_compare_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
,
304 _Predicate
, random_access_iterator_tag
,
305 random_access_iterator_tag
);
308 template<typename _IIter1
, typename _IIter2
>
309 pair
<_IIter1
, _IIter2
>
310 mismatch(_IIter1
, _IIter1
, _IIter2
, __gnu_parallel::sequential_tag
);
312 template<typename _IIter1
, typename _IIter2
, typename _Predicate
>
313 pair
<_IIter1
, _IIter2
>
314 mismatch(_IIter1
, _IIter1
, _IIter2
, _Predicate
,
315 __gnu_parallel::sequential_tag
);
317 template<typename _IIter1
, typename _IIter2
>
318 pair
<_IIter1
, _IIter2
>
319 mismatch(_IIter1
, _IIter1
, _IIter2
);
321 template<typename _IIter1
, typename _IIter2
, typename _Predicate
>
322 pair
<_IIter1
, _IIter2
>
323 mismatch(_IIter1
, _IIter1
, _IIter2
, _Predicate
);
325 template<typename _IIter1
, typename _IIter2
, typename _Predicate
,
326 typename _IterTag1
, typename _IterTag2
>
327 pair
<_IIter1
, _IIter2
>
328 __mismatch_switch(_IIter1
, _IIter1
, _IIter2
, _Predicate
,
329 _IterTag1
, _IterTag2
);
331 template<typename _RAIter1
, typename _RAIter2
, typename _Predicate
>
332 pair
<_RAIter1
, _RAIter2
>
333 __mismatch_switch(_RAIter1
, _RAIter1
, _RAIter2
, _Predicate
,
334 random_access_iterator_tag
, random_access_iterator_tag
);
336 template<typename _FIter1
, typename _FIter2
>
338 search(_FIter1
, _FIter1
, _FIter2
, _FIter2
, __gnu_parallel::sequential_tag
);
340 template<typename _FIter1
, typename _FIter2
>
342 search(_FIter1
, _FIter1
, _FIter2
, _FIter2
);
344 template<typename _FIter1
, typename _FIter2
, typename _BiPredicate
>
346 search(_FIter1
, _FIter1
, _FIter2
, _FIter2
, _BiPredicate
,
347 __gnu_parallel::sequential_tag
);
349 template<typename _FIter1
, typename _FIter2
, typename _BiPredicate
>
351 search(_FIter1
, _FIter1
, _FIter2
, _FIter2
, _BiPredicate
);
353 template<typename _RAIter1
, typename _RAIter2
>
355 __search_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
,
356 random_access_iterator_tag
, random_access_iterator_tag
);
358 template<typename _FIter1
, typename _FIter2
, typename _IterTag1
,
361 __search_switch(_FIter1
, _FIter1
, _FIter2
, _FIter2
, _IterTag1
, _IterTag2
);
363 template<typename _RAIter1
, typename _RAIter2
, typename _BiPredicate
>
365 __search_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
, _BiPredicate
,
366 random_access_iterator_tag
, random_access_iterator_tag
);
368 template<typename _FIter1
, typename _FIter2
, typename _BiPredicate
,
369 typename _IterTag1
, typename _IterTag2
>
371 __search_switch(_FIter1
, _FIter1
, _FIter2
, _FIter2
, _BiPredicate
,
372 _IterTag1
, _IterTag2
);
374 template<typename _FIter
, typename _Integer
, typename _Tp
>
376 search_n(_FIter
, _FIter
, _Integer
, const _Tp
&,
377 __gnu_parallel::sequential_tag
);
379 template<typename _FIter
, typename _Integer
, typename _Tp
,
380 typename _BiPredicate
>
382 search_n(_FIter
, _FIter
, _Integer
, const _Tp
&, _BiPredicate
,
383 __gnu_parallel::sequential_tag
);
385 template<typename _FIter
, typename _Integer
, typename _Tp
>
387 search_n(_FIter
, _FIter
, _Integer
, const _Tp
&);
389 template<typename _FIter
, typename _Integer
, typename _Tp
,
390 typename _BiPredicate
>
392 search_n(_FIter
, _FIter
, _Integer
, const _Tp
&, _BiPredicate
);
394 template<typename _RAIter
, typename _Integer
, typename _Tp
,
395 typename _BiPredicate
>
397 __search_n_switch(_RAIter
, _RAIter
, _Integer
, const _Tp
&,
398 _BiPredicate
, random_access_iterator_tag
);
400 template<typename _FIter
, typename _Integer
, typename _Tp
,
401 typename _BiPredicate
, typename _IterTag
>
403 __search_n_switch(_FIter
, _FIter
, _Integer
, const _Tp
&,
404 _BiPredicate
, _IterTag
);
407 template<typename _IIter
, typename _OIter
, typename _UnaryOperation
>
409 transform(_IIter
, _IIter
, _OIter
, _UnaryOperation
);
411 template<typename _IIter
, typename _OIter
, typename _UnaryOperation
>
413 transform(_IIter
, _IIter
, _OIter
, _UnaryOperation
,
414 __gnu_parallel::sequential_tag
);
416 template<typename _IIter
, typename _OIter
, typename _UnaryOperation
>
418 transform(_IIter
, _IIter
, _OIter
, _UnaryOperation
,
419 __gnu_parallel::_Parallelism
);
421 template<typename _IIter
, typename _OIter
, typename _UnaryOperation
,
422 typename _IterTag1
, typename _IterTag2
>
424 __transform1_switch(_IIter
, _IIter
, _OIter
, _UnaryOperation
,
425 _IterTag1
, _IterTag2
);
428 template<typename _RAIIter
, typename _RAOIter
, typename _UnaryOperation
>
430 __transform1_switch(_RAIIter
, _RAIIter
, _RAOIter
, _UnaryOperation
,
431 random_access_iterator_tag
, random_access_iterator_tag
,
432 __gnu_parallel::_Parallelism __parallelism
433 = __gnu_parallel::parallel_balanced
);
436 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
437 typename _BiOperation
>
439 transform(_IIter1
, _IIter1
, _IIter2
, _OIter
, _BiOperation
);
441 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
442 typename _BiOperation
>
444 transform(_IIter1
, _IIter1
, _IIter2
, _OIter
, _BiOperation
,
445 __gnu_parallel::sequential_tag
);
447 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
448 typename _BiOperation
>
450 transform(_IIter1
, _IIter1
, _IIter2
, _OIter
, _BiOperation
,
451 __gnu_parallel::_Parallelism
);
453 template<typename _RAIter1
, typename _RAIter2
, typename _RAIter3
,
454 typename _BiOperation
>
456 __transform2_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter3
, _BiOperation
,
457 random_access_iterator_tag
, random_access_iterator_tag
,
458 random_access_iterator_tag
,
459 __gnu_parallel::_Parallelism __parallelism
460 = __gnu_parallel::parallel_balanced
);
462 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
463 typename _BiOperation
, typename _Tag1
,
464 typename _Tag2
, typename _Tag3
>
466 __transform2_switch(_IIter1
, _IIter1
, _IIter2
, _OIter
, _BiOperation
,
467 _Tag1
, _Tag2
, _Tag3
);
470 template<typename _FIter
, typename _Tp
>
472 replace(_FIter
, _FIter
, const _Tp
&, const _Tp
&);
474 template<typename _FIter
, typename _Tp
>
476 replace(_FIter
, _FIter
, const _Tp
&, const _Tp
&,
477 __gnu_parallel::sequential_tag
);
479 template<typename _FIter
, typename _Tp
>
481 replace(_FIter
, _FIter
, const _Tp
&, const _Tp
&,
482 __gnu_parallel::_Parallelism
);
484 template<typename _FIter
, typename _Tp
, typename _IterTag
>
486 __replace_switch(_FIter
, _FIter
, const _Tp
&, const _Tp
&, _IterTag
);
488 template<typename _RAIter
, typename _Tp
>
490 __replace_switch(_RAIter
, _RAIter
, const _Tp
&, const _Tp
&,
491 random_access_iterator_tag
, __gnu_parallel::_Parallelism
);
494 template<typename _FIter
, typename _Predicate
, typename _Tp
>
496 replace_if(_FIter
, _FIter
, _Predicate
, const _Tp
&);
498 template<typename _FIter
, typename _Predicate
, typename _Tp
>
500 replace_if(_FIter
, _FIter
, _Predicate
, const _Tp
&,
501 __gnu_parallel::sequential_tag
);
503 template<typename _FIter
, typename _Predicate
, typename _Tp
>
505 replace_if(_FIter
, _FIter
, _Predicate
, const _Tp
&,
506 __gnu_parallel::_Parallelism
);
508 template<typename _FIter
, typename _Predicate
, typename _Tp
,
511 __replace_if_switch(_FIter
, _FIter
, _Predicate
, const _Tp
&, _IterTag
);
513 template<typename _RAIter
, typename _Predicate
, typename _Tp
>
515 __replace_if_switch(_RAIter
, _RAIter
, _Predicate
, const _Tp
&,
516 random_access_iterator_tag
,
517 __gnu_parallel::_Parallelism
);
520 template<typename _FIter
>
522 max_element(_FIter
, _FIter
);
524 template<typename _FIter
>
526 max_element(_FIter
, _FIter
, __gnu_parallel::sequential_tag
);
528 template<typename _FIter
>
530 max_element(_FIter
, _FIter
, __gnu_parallel::_Parallelism
);
532 template<typename _FIter
, typename _Compare
>
534 max_element(_FIter
, _FIter
, _Compare
);
536 template<typename _FIter
, typename _Compare
>
538 max_element(_FIter
, _FIter
, _Compare
, __gnu_parallel::sequential_tag
);
540 template<typename _FIter
, typename _Compare
>
542 max_element(_FIter
, _FIter
, _Compare
, __gnu_parallel::_Parallelism
);
544 template<typename _FIter
, typename _Compare
, typename _IterTag
>
546 __max_element_switch(_FIter
, _FIter
, _Compare
, _IterTag
);
548 template<typename _RAIter
, typename _Compare
>
550 __max_element_switch(
551 _RAIter
, _RAIter
, _Compare
, random_access_iterator_tag
,
552 __gnu_parallel::_Parallelism __parallelism
553 = __gnu_parallel::parallel_balanced
);
556 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
558 merge(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
559 __gnu_parallel::sequential_tag
);
561 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
564 merge(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Compare
,
565 __gnu_parallel::sequential_tag
);
567 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
570 merge(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Compare
);
572 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
574 merge(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
576 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
577 typename _Compare
, typename _IterTag1
, typename _IterTag2
,
580 __merge_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Compare
,
581 _IterTag1
, _IterTag2
, _IterTag3
);
583 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
586 __merge_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Compare
,
587 random_access_iterator_tag
, random_access_iterator_tag
,
588 random_access_iterator_tag
);
591 template<typename _FIter
>
593 min_element(_FIter
, _FIter
);
595 template<typename _FIter
>
597 min_element(_FIter
, _FIter
, __gnu_parallel::sequential_tag
);
599 template<typename _FIter
>
601 min_element(_FIter
, _FIter
,
602 __gnu_parallel::_Parallelism __parallelism_tag
);
604 template<typename _FIter
, typename _Compare
>
606 min_element(_FIter
, _FIter
, _Compare
);
608 template<typename _FIter
, typename _Compare
>
610 min_element(_FIter
, _FIter
, _Compare
, __gnu_parallel::sequential_tag
);
612 template<typename _FIter
, typename _Compare
>
614 min_element(_FIter
, _FIter
, _Compare
, __gnu_parallel::_Parallelism
);
616 template<typename _FIter
, typename _Compare
, typename _IterTag
>
618 __min_element_switch(_FIter
, _FIter
, _Compare
, _IterTag
);
620 template<typename _RAIter
, typename _Compare
>
622 __min_element_switch(
623 _RAIter
, _RAIter
, _Compare
, random_access_iterator_tag
,
624 __gnu_parallel::_Parallelism __parallelism
625 = __gnu_parallel::parallel_balanced
);
627 template<typename _RAIter
>
629 nth_element(_RAIter
, _RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
631 template<typename _RAIter
, typename _Compare
>
633 nth_element(_RAIter
, _RAIter
, _RAIter
, _Compare
,
634 __gnu_parallel::sequential_tag
);
636 template<typename _RAIter
, typename _Compare
>
638 nth_element(_RAIter
, _RAIter
, _RAIter
, _Compare
);
640 template<typename _RAIter
>
642 nth_element(_RAIter
, _RAIter
, _RAIter
);
644 template<typename _RAIter
, typename _Compare
>
646 partial_sort(_RAIter
, _RAIter
, _RAIter
, _Compare
,
647 __gnu_parallel::sequential_tag
);
649 template<typename _RAIter
>
651 partial_sort(_RAIter
, _RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
653 template<typename _RAIter
, typename _Compare
>
655 partial_sort(_RAIter
, _RAIter
, _RAIter
, _Compare
);
657 template<typename _RAIter
>
659 partial_sort(_RAIter
, _RAIter
, _RAIter
);
661 template<typename _FIter
, typename _Predicate
>
663 partition(_FIter
, _FIter
, _Predicate
, __gnu_parallel::sequential_tag
);
665 template<typename _FIter
, typename _Predicate
>
667 partition(_FIter
, _FIter
, _Predicate
);
669 template<typename _FIter
, typename _Predicate
, typename _IterTag
>
671 __partition_switch(_FIter
, _FIter
, _Predicate
, _IterTag
);
673 template<typename _RAIter
, typename _Predicate
>
676 _RAIter
, _RAIter
, _Predicate
, random_access_iterator_tag
);
678 template<typename _RAIter
>
680 random_shuffle(_RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
682 template<typename _RAIter
, typename _RandomNumberGenerator
>
684 random_shuffle(_RAIter
, _RAIter
, _RandomNumberGenerator
&,
685 __gnu_parallel::sequential_tag
);
687 template<typename _RAIter
>
689 random_shuffle(_RAIter
, _RAIter
);
691 template<typename _RAIter
, typename _RandomNumberGenerator
>
693 random_shuffle(_RAIter
, _RAIter
,
694 #ifdef __GXX_EXPERIMENTAL_CXX0X__
695 _RandomNumberGenerator
&&);
697 _RandomNumberGenerator
&);
700 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
702 set_union(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
703 __gnu_parallel::sequential_tag
);
705 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
708 set_union(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Predicate
,
709 __gnu_parallel::sequential_tag
);
711 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
713 set_union(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
715 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
718 set_union(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Predicate
);
720 template<typename _IIter1
, typename _IIter2
, typename _Predicate
,
721 typename _OIter
, typename _IterTag1
, typename _IterTag2
,
724 __set_union_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
725 _Predicate
, _IterTag1
, _IterTag2
, _IterTag3
);
727 template<typename _RAIter1
, typename _RAIter2
, typename _Output_RAIter
,
730 __set_union_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
, _Output_RAIter
,
731 _Predicate
, random_access_iterator_tag
,
732 random_access_iterator_tag
, random_access_iterator_tag
);
734 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
736 set_intersection(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
737 __gnu_parallel::sequential_tag
);
739 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
742 set_intersection(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Predicate
,
743 __gnu_parallel::sequential_tag
);
745 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
747 set_intersection(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
749 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
752 set_intersection(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Predicate
);
754 template<typename _IIter1
, typename _IIter2
, typename _Predicate
,
755 typename _OIter
, typename _IterTag1
, typename _IterTag2
,
758 __set_intersection_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
759 _Predicate
, _IterTag1
, _IterTag2
, _IterTag3
);
761 template<typename _RAIter1
, typename _RAIter2
, typename _Output_RAIter
,
764 __set_intersection_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
,
765 _Output_RAIter
, _Predicate
,
766 random_access_iterator_tag
,
767 random_access_iterator_tag
,
768 random_access_iterator_tag
);
770 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
772 set_symmetric_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
773 __gnu_parallel::sequential_tag
);
775 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
778 set_symmetric_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
779 _Predicate
, __gnu_parallel::sequential_tag
);
781 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
783 set_symmetric_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
785 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
788 set_symmetric_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
791 template<typename _IIter1
, typename _IIter2
, typename _Predicate
,
792 typename _OIter
, typename _IterTag1
, typename _IterTag2
,
795 __set_symmetric_difference_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
,
796 _OIter
, _Predicate
, _IterTag1
, _IterTag2
,
799 template<typename _RAIter1
, typename _RAIter2
, typename _Output_RAIter
,
802 __set_symmetric_difference_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
,
803 _Output_RAIter
, _Predicate
,
804 random_access_iterator_tag
,
805 random_access_iterator_tag
,
806 random_access_iterator_tag
);
809 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
811 set_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
812 __gnu_parallel::sequential_tag
);
814 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
817 set_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Predicate
,
818 __gnu_parallel::sequential_tag
);
820 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
822 set_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
824 template<typename _IIter1
, typename _IIter2
, typename _OIter
,
827 set_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Predicate
);
829 template<typename _IIter1
, typename _IIter2
, typename _Predicate
,
830 typename _OIter
, typename _IterTag1
, typename _IterTag2
,
833 __set_difference_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
,
834 _Predicate
, _IterTag1
, _IterTag2
, _IterTag3
);
836 template<typename _RAIter1
, typename _RAIter2
, typename _Output_RAIter
,
839 __set_difference_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
,
840 _Output_RAIter
, _Predicate
,
841 random_access_iterator_tag
,
842 random_access_iterator_tag
,
843 random_access_iterator_tag
);
846 template<typename _RAIter
>
848 sort(_RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
850 template<typename _RAIter
, typename _Compare
>
852 sort(_RAIter
, _RAIter
, _Compare
, __gnu_parallel::sequential_tag
);
854 template<typename _RAIter
>
856 sort(_RAIter
, _RAIter
);
858 template<typename _RAIter
, typename _Compare
>
860 sort(_RAIter
, _RAIter
, _Compare
);
862 template<typename _RAIter
>
864 stable_sort(_RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
866 template<typename _RAIter
, typename _Compare
>
868 stable_sort(_RAIter
, _RAIter
, _Compare
, __gnu_parallel::sequential_tag
);
870 template<typename _RAIter
>
872 stable_sort(_RAIter
, _RAIter
);
874 template<typename _RAIter
, typename _Compare
>
876 stable_sort(_RAIter
, _RAIter
, _Compare
);
878 template<typename _IIter
, typename _OIter
>
880 unique_copy(_IIter
, _IIter
, _OIter
, __gnu_parallel::sequential_tag
);
882 template<typename _IIter
, typename _OIter
, typename _Predicate
>
884 unique_copy(_IIter
, _IIter
, _OIter
, _Predicate
,
885 __gnu_parallel::sequential_tag
);
887 template<typename _IIter
, typename _OIter
>
889 unique_copy(_IIter
, _IIter
, _OIter
);
891 template<typename _IIter
, typename _OIter
, typename _Predicate
>
893 unique_copy(_IIter
, _IIter
, _OIter
, _Predicate
);
895 template<typename _IIter
, typename _OIter
, typename _Predicate
,
896 typename _IterTag1
, typename _IterTag2
>
898 __unique_copy_switch(_IIter
, _IIter
, _OIter
, _Predicate
,
899 _IterTag1
, _IterTag2
);
901 template<typename _RAIter
, typename _RandomAccess_OIter
, typename _Predicate
>
903 __unique_copy_switch(_RAIter
, _RAIter
, _RandomAccess_OIter
, _Predicate
,
904 random_access_iterator_tag
, random_access_iterator_tag
);
905 } // end namespace __parallel
906 } // end namespace std
908 #endif /* _GLIBCXX_PARALLEL_ALGORITHMFWD_H */