1 // <algorithm> parallel extensions -*- C++ -*-
3 // Copyright (C) 2007 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 2, 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 // You should have received a copy of the GNU General Public License
17 // along with this library; see the file COPYING. If not, write to
18 // the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
19 // MA 02111-1307, USA.
21 // As a special exception, you may use this file as part of a free
22 // software library without restriction. Specifically, if other files
23 // instantiate templates or use macros or inline functions from this
24 // file, or you compile this file and link it with other files to
25 // produce an executable, this file does not by itself cause the
26 // resulting executable to be covered by the GNU General Public
27 // License. This exception does not however invalidate any other
28 // reasons why the executable file might be covered by the GNU General
31 /** @file parallel/algorithmfwd.h
32 * This file is a GNU parallel extension to the Standard C++ Library.
35 #ifndef _GLIBCXX_PARALLEL_ALGORITHMFWD_H
36 #define _GLIBCXX_PARALLEL_ALGORITHMFWD_H 1
38 #pragma GCC system_header
40 #include <parallel/tags.h>
41 #include <parallel/settings.h>
47 template<typename _FIter
>
49 adjacent_find(_FIter
, _FIter
, __gnu_parallel::sequential_tag
);
51 template<typename _FIter
, typename BinaryPredicate
>
53 adjacent_find(_FIter
, _FIter
, BinaryPredicate
, __gnu_parallel::sequential_tag
);
55 template<typename _FIter
>
57 adjacent_find(_FIter
, _FIter
);
59 template<typename _FIter
, typename BinaryPredicate
>
61 adjacent_find(_FIter
, _FIter
, BinaryPredicate
);
63 template<typename _RAIter
>
65 adjacent_find_switch(_RAIter
, _RAIter
, random_access_iterator_tag
);
67 template<typename _FIter
, typename IteratorTag
>
69 adjacent_find_switch(_FIter
, _FIter
, IteratorTag
);
71 template<typename _FIter
, typename BinaryPredicate
, typename IteratorTag
>
73 adjacent_find_switch(_FIter
, _FIter
, BinaryPredicate
, IteratorTag
);
75 template<typename _RAIter
, typename BinaryPredicate
>
77 adjacent_find_switch(_RAIter
, _RAIter
, BinaryPredicate
, random_access_iterator_tag
);
80 template<typename _IIter
, typename T
>
81 inline typename iterator_traits
<_IIter
>::difference_type
82 count(_IIter
, _IIter
, const T
& value
, __gnu_parallel::sequential_tag
);
84 template<typename _IIter
, typename T
>
85 inline typename iterator_traits
<_IIter
>::difference_type
86 count(_IIter
, _IIter
, const T
& value
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_unbalanced
);
88 template<typename _RAIter
, typename T
>
89 typename iterator_traits
<_RAIter
>::difference_type
90 count_switch(_RAIter
, _RAIter
, const T
& value
, random_access_iterator_tag
, __gnu_parallel::parallelism
);
92 template<typename _IIter
, typename T
, typename IteratorTag
>
93 typename iterator_traits
<_IIter
>::difference_type
94 count_switch(_IIter
, _IIter
, const T
& value
, IteratorTag
, __gnu_parallel::parallelism
);
97 template<typename _IIter
, typename Predicate
>
98 inline typename iterator_traits
<_IIter
>::difference_type
99 count_if(_IIter
, _IIter
, Predicate
, __gnu_parallel::sequential_tag
);
101 template<typename _IIter
, typename Predicate
>
102 inline typename iterator_traits
<_IIter
>::difference_type
103 count_if(_IIter
, _IIter
, Predicate
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_unbalanced
);
105 template<typename _RAIter
, typename Predicate
>
106 typename iterator_traits
<_RAIter
>::difference_type
107 count_if_switch(_RAIter
, _RAIter
, Predicate
, random_access_iterator_tag
, __gnu_parallel::parallelism
);
109 template<typename _IIter
, typename Predicate
, typename IteratorTag
>
110 typename iterator_traits
<_IIter
>::difference_type
111 count_if_switch(_IIter
, _IIter
, Predicate
, IteratorTag
, __gnu_parallel::parallelism
);
114 template<typename _IIter1
, typename _IIter2
>
116 equal(_IIter1
, _IIter1
, _IIter2
, __gnu_parallel::sequential_tag
);
118 template<typename _IIter1
, typename _IIter2
, typename Predicate
>
120 equal(_IIter1
, _IIter1
, _IIter2
, Predicate
, __gnu_parallel::sequential_tag
);
122 template<typename _IIter1
, typename _IIter2
>
124 equal(_IIter1
, _IIter1
, _IIter2
);
126 template<typename _IIter1
, typename _IIter2
, typename Predicate
>
128 equal(_IIter1
, _IIter1
, _IIter2
, Predicate
);
130 template<typename _IIter
, typename T
>
132 find(_IIter
, _IIter
, const T
&, __gnu_parallel::sequential_tag
);
134 template<typename _IIter
, typename T
>
136 find(_IIter
, _IIter
, const T
& val
);
138 template<typename _IIter
, typename T
, typename IteratorTag
>
140 find_switch(_IIter
, _IIter
, const T
&, IteratorTag
);
142 template<typename _RAIter
, typename T
>
144 find_switch(_RAIter
, _RAIter
, const T
&, random_access_iterator_tag
);
146 template<typename _IIter
, typename Predicate
>
148 find_if(_IIter
, _IIter
, Predicate
, __gnu_parallel::sequential_tag
);
150 template<typename _IIter
, typename Predicate
>
152 find_if (_IIter
, _IIter
, Predicate
);
154 template<typename _IIter
, typename Predicate
, typename IteratorTag
>
156 find_if_switch(_IIter
, _IIter
, Predicate
, IteratorTag
);
158 template<typename _RAIter
, typename Predicate
>
160 find_if_switch(_RAIter
, _RAIter
, Predicate
, random_access_iterator_tag
);
162 template<typename _IIter
, typename _FIter
>
164 find_first_of(_IIter
, _IIter
, _FIter
, _FIter
, __gnu_parallel::sequential_tag
);
166 template<typename _IIter
, typename _FIter
, typename BinaryPredicate
>
168 find_first_of(_IIter
, _IIter
, _FIter
, _FIter
, BinaryPredicate
, __gnu_parallel::sequential_tag
);
170 template<typename _IIter
, typename _FIter
, typename BinaryPredicate
>
172 find_first_of(_IIter
, _IIter
, _FIter
, _FIter
, BinaryPredicate
);
174 template<typename _IIter
, typename _FIter
>
176 find_first_of(_IIter
, _IIter
, _FIter
, _FIter
);
178 template<typename _IIter
, typename _FIter
, typename IteratorTag1
, typename IteratorTag2
>
180 find_first_of_switch(_IIter
, _IIter
, _FIter
, _FIter
, IteratorTag1
, IteratorTag2
);
182 template<typename _RAIter
, typename _FIter
, typename BinaryPredicate
, typename IteratorTag
>
184 find_first_of_switch(_RAIter
, _RAIter
, _FIter
, _FIter
, BinaryPredicate
, random_access_iterator_tag
, IteratorTag
);
186 template<typename _IIter
, typename _FIter
, typename BinaryPredicate
, typename IteratorTag1
, typename IteratorTag2
>
188 find_first_of_switch(_IIter
, _IIter
, _FIter
, _FIter
, BinaryPredicate
, IteratorTag1
, IteratorTag2
);
191 template<typename _IIter
, typename Function
>
193 for_each(_IIter
, _IIter
, Function f
, __gnu_parallel::sequential_tag
);
195 template<typename Iterator
, typename Function
>
197 for_each(Iterator
, Iterator
, Function f
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
199 template<typename _IIter
, typename Function
, typename IteratorTag
>
201 for_each_switch(_IIter
, _IIter
, Function f
, IteratorTag
, __gnu_parallel::parallelism
);
203 template<typename _RAIter
, typename Function
>
205 for_each_switch(_RAIter
, _RAIter
, Function f
, random_access_iterator_tag
, __gnu_parallel::parallelism
);
207 template<typename _FIter
, typename Generator
>
209 generate(_FIter
, _FIter
, Generator
, __gnu_parallel::sequential_tag
);
211 template<typename _FIter
, typename Generator
>
213 generate(_FIter
, _FIter
, Generator
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
215 template<typename _FIter
, typename Generator
, typename IteratorTag
>
217 generate_switch(_FIter
, _FIter
, Generator
, IteratorTag
, __gnu_parallel::parallelism
);
219 template<typename _RAIter
, typename Generator
>
221 generate_switch(_RAIter
, _RAIter
, Generator
, random_access_iterator_tag
, __gnu_parallel::parallelism
);
223 template<typename _OIter
, typename Size
, typename Generator
>
225 generate_n(_OIter
, Size
, Generator
, __gnu_parallel::sequential_tag
);
227 template<typename _OIter
, typename Size
, typename Generator
>
229 generate_n(_OIter
, Size
, Generator
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
231 template<typename _OIter
, typename Size
, typename Generator
, typename IteratorTag
>
233 generate_n_switch(_OIter
, Size
, Generator
, IteratorTag
, __gnu_parallel::parallelism
);
235 template<typename _RAIter
, typename Size
, typename Generator
>
237 generate_n_switch(_RAIter
, Size
, Generator
, random_access_iterator_tag
, __gnu_parallel::parallelism
);
239 template<typename _IIter1
, typename _IIter2
>
241 lexicographical_compare(_IIter1
, _IIter1
, _IIter2
, _IIter2
, __gnu_parallel::sequential_tag
);
243 template<typename _IIter1
, typename _IIter2
, typename Predicate
>
245 lexicographical_compare(_IIter1
, _IIter1
, _IIter2
, _IIter2
, Predicate
, __gnu_parallel::sequential_tag
);
247 template<typename _IIter1
, typename _IIter2
>
249 lexicographical_compare(_IIter1
, _IIter1
, _IIter2
, _IIter2
);
251 template<typename _IIter1
, typename _IIter2
, typename Predicate
>
253 lexicographical_compare(_IIter1
, _IIter1
, _IIter2
, _IIter2
, Predicate
);
255 template<typename _IIter1
, typename _IIter2
, typename Predicate
, typename IteratorTag1
, typename IteratorTag2
>
257 lexicographical_compare_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, Predicate
, IteratorTag1
, IteratorTag2
);
259 template<typename _RAIter1
, typename _RAIter2
, typename Predicate
>
261 lexicographical_compare_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
, Predicate
, random_access_iterator_tag
, random_access_iterator_tag
);
264 template<typename _IIter1
, typename _IIter2
>
265 inline pair
<_IIter1
, _IIter2
>
266 mismatch(_IIter1
, _IIter1
, _IIter2
, __gnu_parallel::sequential_tag
);
268 template<typename _IIter1
, typename _IIter2
, typename Predicate
>
269 inline pair
<_IIter1
, _IIter2
>
270 mismatch(_IIter1
, _IIter1
, _IIter2
, Predicate
, __gnu_parallel::sequential_tag
);
272 template<typename _IIter1
, typename _IIter2
>
273 inline pair
<_IIter1
, _IIter2
>
274 mismatch(_IIter1
, _IIter1
, _IIter2
);
276 template<typename _IIter1
, typename _IIter2
, typename Predicate
>
277 inline pair
<_IIter1
, _IIter2
>
278 mismatch(_IIter1
, _IIter1
, _IIter2
, Predicate
);
280 template<typename _IIter1
, typename _IIter2
, typename Predicate
, typename IteratorTag1
, typename IteratorTag2
>
281 inline pair
<_IIter1
, _IIter2
>
282 mismatch_switch(_IIter1
, _IIter1
, _IIter2
, Predicate
, IteratorTag1
, IteratorTag2
);
284 template<typename _RAIter1
, typename _RAIter2
, typename Predicate
>
285 pair
<_RAIter1
, _RAIter2
>
286 mismatch_switch(_RAIter1
, _RAIter1
, _RAIter2
, Predicate
, random_access_iterator_tag
, random_access_iterator_tag
);
288 template<typename _FIter1
, typename _FIter2
>
290 search(_FIter1
, _FIter1
, _FIter2
, _FIter2
, __gnu_parallel::sequential_tag
);
292 template<typename _FIter1
, typename _FIter2
>
294 search(_FIter1
, _FIter1
, _FIter2
, _FIter2
);
296 template<typename _FIter1
, typename _FIter2
, typename BinaryPredicate
>
298 search(_FIter1
, _FIter1
, _FIter2
, _FIter2
, BinaryPredicate
, __gnu_parallel::sequential_tag
);
300 template<typename _FIter1
, typename _FIter2
, typename BinaryPredicate
>
302 search(_FIter1
, _FIter1
, _FIter2
, _FIter2
, BinaryPredicate
);
304 template<typename _RAIter1
, typename _RAIter2
>
306 search_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
, random_access_iterator_tag
, random_access_iterator_tag
);
308 template<typename _FIter1
, typename _FIter2
, typename IteratorTag1
, typename IteratorTag2
>
310 search_switch(_FIter1
, _FIter1
, _FIter2
, _FIter2
, IteratorTag1
, IteratorTag2
);
312 template<typename _RAIter1
, typename _RAIter2
, typename BinaryPredicate
>
314 search_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
, BinaryPredicate
, random_access_iterator_tag
, random_access_iterator_tag
);
316 template<typename _FIter1
, typename _FIter2
, typename BinaryPredicate
, typename IteratorTag1
, typename IteratorTag2
>
318 search_switch(_FIter1
, _FIter1
, _FIter2
, _FIter2
, BinaryPredicate
, IteratorTag1
, IteratorTag2
);
320 template<typename _FIter
, typename Integer
, typename T
>
322 search_n(_FIter
, _FIter
, Integer
, const T
&, __gnu_parallel::sequential_tag
);
324 template<typename _FIter
, typename Integer
, typename T
, typename BinaryPredicate
>
326 search_n(_FIter
, _FIter
, Integer
, const T
&, BinaryPredicate
, __gnu_parallel::sequential_tag
);
328 template<typename _FIter
, typename Integer
, typename T
>
330 search_n(_FIter
, _FIter
, Integer
, const T
& val
);
332 template<typename _FIter
, typename Integer
, typename T
, typename BinaryPredicate
>
334 search_n(_FIter
, _FIter
, Integer
, const T
&, BinaryPredicate
);
336 template<typename _RAIter
, typename Integer
, typename T
, typename BinaryPredicate
>
338 search_n_switch(_RAIter
, _RAIter
, Integer
, const T
&, BinaryPredicate
, random_access_iterator_tag
);
340 template<typename _FIter
, typename Integer
, typename T
, typename BinaryPredicate
, typename IteratorTag
>
342 search_n_switch(_FIter
, _FIter
, Integer
, const T
&, BinaryPredicate
, IteratorTag
);
345 template<typename _IIter
, typename _OIter
, typename UnaryOperation
>
347 transform(_IIter
, _IIter
, _OIter
, UnaryOperation
, __gnu_parallel::sequential_tag
);
349 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename BinaryOperation
>
351 transform(_IIter1
, _IIter1
, _IIter2
, _OIter
, BinaryOperation binary_op
, __gnu_parallel::sequential_tag
);
353 template<typename _IIter
, typename _OIter
, typename UnaryOperation
>
355 transform(_IIter
, _IIter
, _OIter
, UnaryOperation
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
357 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename BinaryOperation
>
359 transform(_IIter1
, _IIter1
, _IIter2
, _OIter
, BinaryOperation binary_op
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
361 template<typename _RAIter1
, typename _RAIter3
, typename UnaryOperation
>
363 transform1_switch(_RAIter1
, _RAIter1
, _RAIter3
, UnaryOperation
, random_access_iterator_tag
, random_access_iterator_tag
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
365 template<typename _RAIter1
, typename _RAIter3
, typename UnaryOperation
, typename IteratorTag1
, typename IteratorTag2
>
367 transform1_switch(_RAIter1
, _RAIter1
, _RAIter3
, UnaryOperation
, IteratorTag1
, IteratorTag2
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
369 template<typename _RAIter1
, typename _RAIter2
, typename _RAIter3
, typename BinaryOperation
>
371 transform2_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter3
, BinaryOperation binary_op
, random_access_iterator_tag
, random_access_iterator_tag
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
373 template<typename _RAIter1
, typename _RAIter2
, typename _RAIter3
, typename BinaryOperation
, typename tag1
, typename tag2
, typename tag3
>
375 transform2_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter3
, BinaryOperation binary_op
, tag1
, tag2
, tag3
, __gnu_parallel::parallelism
);
377 template<typename _FIter
, typename T
>
379 replace(_FIter
, _FIter
, const T
&, const T
&, __gnu_parallel::sequential_tag
);
381 template<typename _FIter
, typename T
>
383 replace(_FIter
, _FIter
, const T
&, const T
&, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
385 template<typename _FIter
, typename T
, typename IteratorTag
>
387 replace_switch(_FIter
, _FIter
, const T
&, const T
&, IteratorTag
, __gnu_parallel::parallelism
);
389 template<typename _RAIter
, typename T
>
391 replace_switch(_RAIter
, _RAIter
, const T
&, const T
&, random_access_iterator_tag
, __gnu_parallel::parallelism
);
394 template<typename _FIter
, typename Predicate
, typename T
>
396 replace_if(_FIter
, _FIter
, Predicate
, const T
&, __gnu_parallel::sequential_tag
);
398 template<typename _FIter
, typename Predicate
, typename T
>
400 replace_if(_FIter
, _FIter
, Predicate
, const T
&, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
402 template<typename _FIter
, typename Predicate
, typename T
, typename IteratorTag
>
404 replace_if_switch(_FIter
, _FIter
, Predicate
, const T
&, IteratorTag
, __gnu_parallel::parallelism
);
406 template<typename _RAIter
, typename Predicate
, typename T
>
408 replace_if_switch(_RAIter
, _RAIter
, Predicate
, const T
&, random_access_iterator_tag
, __gnu_parallel::parallelism
);
410 template<typename _FIter
>
412 max_element(_FIter
, _FIter
, __gnu_parallel::sequential_tag
);
414 template<typename _FIter
, typename _Compare
>
416 max_element(_FIter
, _FIter
, _Compare
, __gnu_parallel::sequential_tag
);
418 template<typename _FIter
>
420 max_element(_FIter
, _FIter
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
422 template<typename _FIter
, typename _Compare
>
424 max_element(_FIter
, _FIter
, _Compare
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
426 template<typename _FIter
, typename _Compare
, typename IteratorTag
>
428 max_element_switch(_FIter
, _FIter
, _Compare
, IteratorTag
, __gnu_parallel::parallelism
);
430 template<typename _RAIter
, typename _Compare
>
432 max_element_switch(_RAIter
, _RAIter
, _Compare
, random_access_iterator_tag
, __gnu_parallel::parallelism
);
434 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
436 merge(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, __gnu_parallel::sequential_tag
);
438 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename _Compare
>
440 merge(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Compare
, __gnu_parallel::sequential_tag
);
442 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename _Compare
>
444 merge(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Compare
);
446 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
448 merge(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
450 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename _Compare
, typename IteratorTag1
, typename IteratorTag2
, typename IteratorTag3
>
452 merge_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Compare
, IteratorTag1
, IteratorTag2
, IteratorTag3
);
454 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename _Compare
>
456 merge_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, _Compare
, random_access_iterator_tag
, random_access_iterator_tag
, random_access_iterator_tag
);
458 template<typename _FIter
>
460 min_element(_FIter
, _FIter
, __gnu_parallel::sequential_tag
);
462 template<typename _FIter
, typename _Compare
>
464 min_element(_FIter
, _FIter
, _Compare
, __gnu_parallel::sequential_tag
);
466 template<typename _FIter
>
468 min_element(_FIter
, _FIter
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
470 template<typename _FIter
, typename _Compare
>
472 min_element(_FIter
, _FIter
, _Compare
, __gnu_parallel::parallelism parallelism_tag
= __gnu_parallel::parallel_balanced
);
474 template<typename _FIter
, typename _Compare
, typename IteratorTag
>
476 min_element_switch(_FIter
, _FIter
, _Compare
, IteratorTag
, __gnu_parallel::parallelism
);
478 template<typename _RAIter
, typename _Compare
>
480 min_element_switch(_RAIter
, _RAIter
, _Compare
, random_access_iterator_tag
, __gnu_parallel::parallelism
);
482 template<typename _RAIter
>
484 nth_element(_RAIter
, _RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
486 template<typename _RAIter
, typename _Compare
>
488 nth_element(_RAIter
, _RAIter
, _RAIter
, _Compare
, __gnu_parallel::sequential_tag
);
490 template<typename _RAIter
, typename _Compare
>
492 nth_element(_RAIter
, _RAIter
, _RAIter
, _Compare
);
494 template<typename _RAIter
>
496 nth_element(_RAIter
, _RAIter
, _RAIter
);
498 template<typename _RAIter
, typename _Compare
>
500 partial_sort(_RAIter
, _RAIter
, _RAIter
, _Compare
, __gnu_parallel::sequential_tag
);
502 template<typename _RAIter
>
504 partial_sort(_RAIter
, _RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
506 template<typename _RAIter
, typename _Compare
>
508 partial_sort(_RAIter
, _RAIter
, _RAIter
, _Compare
);
510 template<typename _RAIter
>
512 partial_sort(_RAIter
, _RAIter
, _RAIter
);
514 template<typename _FIter
, typename Predicate
>
516 partition(_FIter
, _FIter
, Predicate
, __gnu_parallel::sequential_tag
);
518 template<typename _FIter
, typename Predicate
>
520 partition(_FIter
, _FIter
, Predicate
);
522 template<typename _FIter
, typename Predicate
, typename IteratorTag
>
524 partition_switch(_FIter
, _FIter
, Predicate
, IteratorTag
);
526 template<typename _RAIter
, typename Predicate
>
528 partition_switch(_RAIter
, _RAIter
, Predicate
, random_access_iterator_tag
);
530 template<typename _RAIter
>
532 random_shuffle(_RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
534 template<typename _RAIter
, typename RandomNumberGenerator
>
536 random_shuffle(_RAIter
, _RAIter
, RandomNumberGenerator
& rand
, __gnu_parallel::sequential_tag
);
538 template<typename _RAIter
>
540 random_shuffle(_RAIter
, _RAIter
);
542 template<typename _RAIter
, typename RandomNumberGenerator
>
544 random_shuffle(_RAIter
, _RAIter
, RandomNumberGenerator
& rand
);
546 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
548 set_union(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, __gnu_parallel::sequential_tag
);
550 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename Predicate
>
552 set_union(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
, __gnu_parallel::sequential_tag
);
554 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
556 set_union(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
558 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename Predicate
>
560 set_union(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
);
562 template<typename _IIter1
, typename _IIter2
, typename Predicate
, typename _OIter
, typename IteratorTag1
, typename IteratorTag2
, typename IteratorTag3
>
564 set_union_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
, IteratorTag1
, IteratorTag2
, IteratorTag3
);
566 template<typename _RAIter1
, typename _RAIter2
, typename Output_RAIter
, typename Predicate
>
568 set_union_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
, Output_RAIter
, Predicate
, random_access_iterator_tag
, random_access_iterator_tag
, random_access_iterator_tag
);
570 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
572 set_intersection(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, __gnu_parallel::sequential_tag
);
574 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename Predicate
>
576 set_intersection(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
, __gnu_parallel::sequential_tag
);
578 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
580 set_intersection(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
582 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename Predicate
>
584 set_intersection(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
);
586 template<typename _IIter1
, typename _IIter2
, typename Predicate
, typename _OIter
, typename IteratorTag1
, typename IteratorTag2
, typename IteratorTag3
>
588 set_intersection_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
, IteratorTag1
, IteratorTag2
, IteratorTag3
);
590 template<typename _RAIter1
, typename _RAIter2
, typename Output_RAIter
, typename Predicate
>
592 set_intersection_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
, Output_RAIter
, Predicate
, random_access_iterator_tag
, random_access_iterator_tag
, random_access_iterator_tag
);
594 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
596 set_symmetric_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, __gnu_parallel::sequential_tag
);
598 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename Predicate
>
600 set_symmetric_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
, __gnu_parallel::sequential_tag
);
602 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
604 set_symmetric_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
606 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename Predicate
>
608 set_symmetric_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
);
610 template<typename _IIter1
, typename _IIter2
, typename Predicate
, typename _OIter
, typename IteratorTag1
, typename IteratorTag2
, typename IteratorTag3
>
612 set_symmetric_difference_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
, IteratorTag1
, IteratorTag2
, IteratorTag3
);
614 template<typename _RAIter1
, typename _RAIter2
, typename Output_RAIter
, typename Predicate
>
616 set_symmetric_difference_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
, Output_RAIter
, Predicate
, random_access_iterator_tag
, random_access_iterator_tag
, random_access_iterator_tag
);
619 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
621 set_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, __gnu_parallel::sequential_tag
);
623 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename Predicate
>
625 set_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
, __gnu_parallel::sequential_tag
);
627 template<typename _IIter1
, typename _IIter2
, typename _OIter
>
629 set_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
);
631 template<typename _IIter1
, typename _IIter2
, typename _OIter
, typename Predicate
>
633 set_difference(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
);
635 template<typename _IIter1
, typename _IIter2
, typename Predicate
, typename _OIter
, typename IteratorTag1
, typename IteratorTag2
, typename IteratorTag3
>
637 set_difference_switch(_IIter1
, _IIter1
, _IIter2
, _IIter2
, _OIter
, Predicate
, IteratorTag1
, IteratorTag2
, IteratorTag3
);
639 template<typename _RAIter1
, typename _RAIter2
, typename Output_RAIter
, typename Predicate
>
641 set_difference_switch(_RAIter1
, _RAIter1
, _RAIter2
, _RAIter2
, Output_RAIter
, Predicate
, random_access_iterator_tag
, random_access_iterator_tag
, random_access_iterator_tag
);
644 template<typename _RAIter
>
646 sort(_RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
648 template<typename _RAIter
, typename _Compare
>
650 sort(_RAIter
, _RAIter
, _Compare
, __gnu_parallel::sequential_tag
);
652 template<typename _RAIter
>
654 sort(_RAIter
, _RAIter
);
656 template<typename _RAIter
, typename _Compare
>
658 sort(_RAIter
, _RAIter
, _Compare
);
660 template<typename _RAIter
>
662 stable_sort(_RAIter
, _RAIter
, __gnu_parallel::sequential_tag
);
664 template<typename _RAIter
, typename _Compare
>
666 stable_sort(_RAIter
, _RAIter
, _Compare
, __gnu_parallel::sequential_tag
);
668 template<typename _RAIter
>
670 stable_sort(_RAIter
, _RAIter
);
672 template<typename _RAIter
, typename _Compare
>
674 stable_sort(_RAIter
, _RAIter
, _Compare
);
676 template<typename _IIter
, typename _OIter
>
678 unique_copy(_IIter
, _IIter
, _OIter
, __gnu_parallel::sequential_tag
);
680 template<typename _IIter
, typename _OIter
, typename Predicate
>
682 unique_copy(_IIter
, _IIter
, _OIter
, Predicate
, __gnu_parallel::sequential_tag
);
684 template<typename _IIter
, typename _OIter
>
686 unique_copy(_IIter
, _IIter
, _OIter
);
688 template<typename _IIter
, typename _OIter
, typename Predicate
>
690 unique_copy(_IIter
, _IIter
, _OIter
, Predicate
);
692 template<typename _IIter
, typename _OIter
, typename Predicate
, typename IteratorTag1
, typename IteratorTag2
>
694 unique_copy_switch(_IIter
, _IIter
, _OIter
, Predicate
, IteratorTag1
, IteratorTag2
);
696 template<typename _RAIter
, typename RandomAccess_OIter
, typename Predicate
>
698 unique_copy_switch(_RAIter
, _RAIter
, RandomAccess_OIter
, Predicate
, random_access_iterator_tag
, random_access_iterator_tag
);
699 } // end namespace __parallel
700 } // end namespace std
702 // NB: cannot use _GLIBCXX_STD_P directly here, as it is both scoped
703 // (std::__norm) and unscoped (std::).
704 namespace __gnu_sequential
706 #ifdef _GLIBCXX_PARALLEL
707 using std::__norm::partition
;
708 using std::__norm::sort
;
709 using std::__norm::stable_sort
;
710 using std::__norm::random_shuffle
;
712 using std::partition
;
714 using std::stable_sort
;
715 using std::random_shuffle
;