37 #ifndef _GLIBCXX_PARALLEL_ALGO_H
38 #define _GLIBCXX_PARALLEL_ALGO_H 1
61 namespace std _GLIBCXX_VISIBILITY(default)
66 template<
typename _IIter,
typename _Function>
68 for_each(_IIter __begin, _IIter __end, _Function __f,
70 {
return _GLIBCXX_STD_A::for_each(__begin, __end, __f); }
74 template<
typename _IIter,
typename _Function,
typename _IteratorTag>
76 __for_each_switch(_IIter __begin, _IIter __end, _Function __f,
81 template<
typename _RAIter,
typename _Function>
83 __for_each_switch(_RAIter __begin, _RAIter __end,
89 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
91 && __gnu_parallel::__is_parallel(__parallelism_tag)))
98 __begin, __end, __f, __functionality,
107 template<
typename _Iterator,
typename _Function>
109 for_each(_Iterator __begin, _Iterator __end, _Function __f,
112 typedef std::iterator_traits<_Iterator> _IteratorTraits;
113 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
114 return __for_each_switch(__begin, __end, __f, _IteratorCategory(),
118 template<
typename _Iterator,
typename _Function>
120 for_each(_Iterator __begin, _Iterator __end, _Function __f)
122 typedef std::iterator_traits<_Iterator> _IteratorTraits;
123 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
124 return __for_each_switch(__begin, __end, __f, _IteratorCategory());
129 template<
typename _IIter,
typename _Tp>
131 find(_IIter __begin, _IIter __end,
const _Tp& __val,
133 {
return _GLIBCXX_STD_A::find(__begin, __end, __val); }
136 template<
typename _IIter,
typename _Tp,
typename _IteratorTag>
138 __find_switch(_IIter __begin, _IIter __end,
const _Tp& __val,
140 {
return _GLIBCXX_STD_A::find(__begin, __end, __val); }
143 template<
typename _RAIter,
typename _Tp>
145 __find_switch(_RAIter __begin, _RAIter __end,
148 typedef iterator_traits<_RAIter> _TraitsType;
149 typedef typename _TraitsType::value_type _ValueType;
155 _ValueType,
const _Tp&,
bool>
158 __begin, __end, __begin, __comp,
162 return _GLIBCXX_STD_A::find(__begin, __end, __val);
166 template<
typename _IIter,
typename _Tp>
168 find(_IIter __begin, _IIter __end,
const _Tp& __val)
170 typedef std::iterator_traits<_IIter> _IteratorTraits;
171 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
172 return __find_switch(__begin, __end, __val, _IteratorCategory());
176 template<
typename _IIter,
typename _Predicate>
178 find_if(_IIter __begin, _IIter __end, _Predicate __pred,
180 {
return _GLIBCXX_STD_A::find_if(__begin, __end, __pred); }
183 template<
typename _IIter,
typename _Predicate,
typename _IteratorTag>
185 __find_if_switch(_IIter __begin, _IIter __end, _Predicate __pred,
187 {
return _GLIBCXX_STD_A::find_if(__begin, __end, __pred); }
190 template<
typename _RAIter,
typename _Predicate>
192 __find_if_switch(_RAIter __begin, _RAIter __end,
198 __find_if_selector()).first;
200 return _GLIBCXX_STD_A::find_if(__begin, __end, __pred);
204 template<
typename _IIter,
typename _Predicate>
206 find_if(_IIter __begin, _IIter __end, _Predicate __pred)
208 typedef std::iterator_traits<_IIter> _IteratorTraits;
209 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
210 return __find_if_switch(__begin, __end, __pred, _IteratorCategory());
214 template<
typename _IIter,
typename _FIterator>
216 find_first_of(_IIter __begin1, _IIter __end1,
217 _FIterator __begin2, _FIterator __end2,
219 {
return _GLIBCXX_STD_A::find_first_of(__begin1, __end1, __begin2, __end2);
223 template<
typename _IIter,
typename _FIterator,
224 typename _BinaryPredicate>
226 find_first_of(_IIter __begin1, _IIter __end1,
227 _FIterator __begin2, _FIterator __end2,
229 {
return _GLIBCXX_STD_A::find_first_of(
230 __begin1, __end1, __begin2, __end2, __comp); }
233 template<
typename _IIter,
typename _FIterator,
234 typename _IteratorTag1,
typename _IteratorTag2>
236 __find_first_of_switch(_IIter __begin1, _IIter __end1,
237 _FIterator __begin2, _FIterator __end2,
238 _IteratorTag1, _IteratorTag2)
239 {
return find_first_of(__begin1, __end1, __begin2, __end2,
243 template<
typename _RAIter,
typename _FIterator,
244 typename _BinaryPredicate,
typename _IteratorTag>
246 __find_first_of_switch(_RAIter __begin1,
248 _FIterator __begin2, _FIterator __end2,
255 <_FIterator>(__begin2, __end2)).first;
259 template<
typename _IIter,
typename _FIterator,
260 typename _BinaryPredicate,
typename _IteratorTag1,
261 typename _IteratorTag2>
263 __find_first_of_switch(_IIter __begin1, _IIter __end1,
264 _FIterator __begin2, _FIterator __end2,
265 _BinaryPredicate __comp, _IteratorTag1, _IteratorTag2)
266 {
return find_first_of(__begin1, __end1, __begin2, __end2, __comp,
270 template<
typename _IIter,
typename _FIterator,
271 typename _BinaryPredicate>
273 find_first_of(_IIter __begin1, _IIter __end1,
274 _FIterator __begin2, _FIterator __end2,
275 _BinaryPredicate __comp)
277 typedef std::iterator_traits<_IIter> _IIterTraits;
278 typedef std::iterator_traits<_FIterator> _FIterTraits;
279 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
280 typedef typename _FIterTraits::iterator_category _FIteratorCategory;
282 return __find_first_of_switch(__begin1, __end1, __begin2, __end2, __comp,
283 _IIteratorCategory(), _FIteratorCategory());
287 template<
typename _IIter,
typename _FIterator>
289 find_first_of(_IIter __begin1, _IIter __end1,
290 _FIterator __begin2, _FIterator __end2)
292 typedef std::iterator_traits<_IIter> _IIterTraits;
293 typedef std::iterator_traits<_FIterator> _FIterTraits;
294 typedef typename _IIterTraits::value_type _IValueType;
295 typedef typename _FIterTraits::value_type _FValueType;
297 return __gnu_parallel::find_first_of(__begin1, __end1, __begin2, __end2,
302 template<
typename _IIter,
typename _OutputIterator>
303 inline _OutputIterator
304 unique_copy(_IIter __begin1, _IIter __end1, _OutputIterator __out,
306 {
return _GLIBCXX_STD_A::unique_copy(__begin1, __end1, __out); }
309 template<
typename _IIter,
typename _OutputIterator,
311 inline _OutputIterator
312 unique_copy(_IIter __begin1, _IIter __end1, _OutputIterator __out,
314 {
return _GLIBCXX_STD_A::unique_copy(__begin1, __end1, __out, __pred); }
317 template<
typename _IIter,
typename _OutputIterator,
318 typename _Predicate,
typename _IteratorTag1,
typename _IteratorTag2>
319 inline _OutputIterator
320 __unique_copy_switch(_IIter __begin, _IIter __last,
321 _OutputIterator __out, _Predicate __pred,
322 _IteratorTag1, _IteratorTag2)
323 {
return _GLIBCXX_STD_A::unique_copy(__begin, __last, __out, __pred); }
326 template<
typename _RAIter,
typename RandomAccessOutputIterator,
328 RandomAccessOutputIterator
329 __unique_copy_switch(_RAIter __begin, _RAIter __last,
330 RandomAccessOutputIterator __out, _Predicate __pred,
334 static_cast<__gnu_parallel::_SequenceIndex>(__last - __begin)
337 __begin, __last, __out, __pred);
339 return _GLIBCXX_STD_A::unique_copy(__begin, __last, __out, __pred);
343 template<
typename _IIter,
typename _OutputIterator>
344 inline _OutputIterator
345 unique_copy(_IIter __begin1, _IIter __end1, _OutputIterator __out)
347 typedef std::iterator_traits<_IIter> _IIterTraits;
348 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
349 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
350 typedef typename _IIterTraits::value_type _ValueType;
351 typedef typename _OIterTraits::iterator_category _OIterCategory;
353 return __unique_copy_switch(
355 _IIteratorCategory(), _OIterCategory());
359 template<
typename _IIter,
typename _OutputIterator,
typename _Predicate>
360 inline _OutputIterator
361 unique_copy(_IIter __begin1, _IIter __end1, _OutputIterator __out,
364 typedef std::iterator_traits<_IIter> _IIterTraits;
365 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
366 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
367 typedef typename _OIterTraits::iterator_category _OIterCategory;
369 return __unique_copy_switch(
370 __begin1, __end1, __out, __pred,
371 _IIteratorCategory(), _OIterCategory());
375 template<
typename _IIter1,
typename _IIter2,
376 typename _OutputIterator>
377 inline _OutputIterator
378 set_union(_IIter1 __begin1, _IIter1 __end1,
379 _IIter2 __begin2, _IIter2 __end2,
381 {
return _GLIBCXX_STD_A::set_union(
382 __begin1, __end1, __begin2, __end2, __out); }
385 template<
typename _IIter1,
typename _IIter2,
386 typename _OutputIterator,
typename _Predicate>
387 inline _OutputIterator
388 set_union(_IIter1 __begin1, _IIter1 __end1,
389 _IIter2 __begin2, _IIter2 __end2,
390 _OutputIterator __out, _Predicate __pred,
392 {
return _GLIBCXX_STD_A::set_union(__begin1, __end1,
393 __begin2, __end2, __out, __pred); }
396 template<
typename _IIter1,
typename _IIter2,
typename _Predicate,
397 typename _OutputIterator,
typename _IteratorTag1,
398 typename _IteratorTag2,
typename _IteratorTag3>
399 inline _OutputIterator
401 _IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2, _IIter2 __end2,
402 _OutputIterator __result, _Predicate __pred,
403 _IteratorTag1, _IteratorTag2, _IteratorTag3)
404 {
return _GLIBCXX_STD_A::set_union(__begin1, __end1,
405 __begin2, __end2, __result, __pred); }
408 template<
typename _RAIter1,
typename _RAIter2,
409 typename _Output_RAIter,
typename _Predicate>
411 __set_union_switch(_RAIter1 __begin1, _RAIter1 __end1,
412 _RAIter2 __begin2, _RAIter2 __end2,
413 _Output_RAIter __result, _Predicate __pred,
418 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
420 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
422 return __gnu_parallel::__parallel_set_union(
423 __begin1, __end1, __begin2, __end2, __result, __pred);
425 return _GLIBCXX_STD_A::set_union(__begin1, __end1,
426 __begin2, __end2, __result, __pred);
430 template<
typename _IIter1,
typename _IIter2,
431 typename _OutputIterator>
432 inline _OutputIterator
433 set_union(_IIter1 __begin1, _IIter1 __end1,
434 _IIter2 __begin2, _IIter2 __end2, _OutputIterator __out)
436 typedef std::iterator_traits<_IIter1> _IIterTraits1;
437 typedef std::iterator_traits<_IIter2> _IIterTraits2;
438 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
439 typedef typename _IIterTraits1::iterator_category
441 typedef typename _IIterTraits2::iterator_category
443 typedef typename _OIterTraits::iterator_category _OIterCategory;
444 typedef typename _IIterTraits1::value_type _ValueType1;
445 typedef typename _IIterTraits2::value_type _ValueType2;
447 return __set_union_switch(
448 __begin1, __end1, __begin2, __end2, __out,
450 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
454 template<
typename _IIter1,
typename _IIter2,
455 typename _OutputIterator,
typename _Predicate>
456 inline _OutputIterator
457 set_union(_IIter1 __begin1, _IIter1 __end1,
458 _IIter2 __begin2, _IIter2 __end2,
459 _OutputIterator __out, _Predicate __pred)
461 typedef std::iterator_traits<_IIter1> _IIterTraits1;
462 typedef std::iterator_traits<_IIter2> _IIterTraits2;
463 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
464 typedef typename _IIterTraits1::iterator_category
466 typedef typename _IIterTraits2::iterator_category
468 typedef typename _OIterTraits::iterator_category _OIterCategory;
470 return __set_union_switch(
471 __begin1, __end1, __begin2, __end2, __out, __pred,
472 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
476 template<
typename _IIter1,
typename _IIter2,
477 typename _OutputIterator>
478 inline _OutputIterator
479 set_intersection(_IIter1 __begin1, _IIter1 __end1,
480 _IIter2 __begin2, _IIter2 __end2,
482 {
return _GLIBCXX_STD_A::set_intersection(__begin1, __end1,
483 __begin2, __end2, __out); }
486 template<
typename _IIter1,
typename _IIter2,
487 typename _OutputIterator,
typename _Predicate>
488 inline _OutputIterator
489 set_intersection(_IIter1 __begin1, _IIter1 __end1,
490 _IIter2 __begin2, _IIter2 __end2,
491 _OutputIterator __out, _Predicate __pred,
493 {
return _GLIBCXX_STD_A::set_intersection(
494 __begin1, __end1, __begin2, __end2, __out, __pred); }
497 template<
typename _IIter1,
typename _IIter2,
498 typename _Predicate,
typename _OutputIterator,
499 typename _IteratorTag1,
typename _IteratorTag2,
500 typename _IteratorTag3>
501 inline _OutputIterator
502 __set_intersection_switch(_IIter1 __begin1, _IIter1 __end1,
503 _IIter2 __begin2, _IIter2 __end2,
504 _OutputIterator __result, _Predicate __pred,
505 _IteratorTag1, _IteratorTag2, _IteratorTag3)
506 {
return _GLIBCXX_STD_A::set_intersection(__begin1, __end1, __begin2,
507 __end2, __result, __pred); }
510 template<
typename _RAIter1,
typename _RAIter2,
511 typename _Output_RAIter,
typename _Predicate>
513 __set_intersection_switch(_RAIter1 __begin1,
517 _Output_RAIter __result,
524 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
526 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
528 return __gnu_parallel::__parallel_set_intersection(
529 __begin1, __end1, __begin2, __end2, __result, __pred);
531 return _GLIBCXX_STD_A::set_intersection(
532 __begin1, __end1, __begin2, __end2, __result, __pred);
536 template<
typename _IIter1,
typename _IIter2,
537 typename _OutputIterator>
538 inline _OutputIterator
539 set_intersection(_IIter1 __begin1, _IIter1 __end1,
540 _IIter2 __begin2, _IIter2 __end2,
541 _OutputIterator __out)
543 typedef std::iterator_traits<_IIter1> _IIterTraits1;
544 typedef std::iterator_traits<_IIter2> _IIterTraits2;
545 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
546 typedef typename _IIterTraits1::iterator_category
548 typedef typename _IIterTraits2::iterator_category
550 typedef typename _OIterTraits::iterator_category _OIterCategory;
551 typedef typename _IIterTraits1::value_type _ValueType1;
552 typedef typename _IIterTraits2::value_type _ValueType2;
554 return __set_intersection_switch(
555 __begin1, __end1, __begin2, __end2, __out,
557 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
560 template<
typename _IIter1,
typename _IIter2,
561 typename _OutputIterator,
typename _Predicate>
562 inline _OutputIterator
563 set_intersection(_IIter1 __begin1, _IIter1 __end1,
564 _IIter2 __begin2, _IIter2 __end2,
565 _OutputIterator __out, _Predicate __pred)
567 typedef std::iterator_traits<_IIter1> _IIterTraits1;
568 typedef std::iterator_traits<_IIter2> _IIterTraits2;
569 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
570 typedef typename _IIterTraits1::iterator_category
572 typedef typename _IIterTraits2::iterator_category
574 typedef typename _OIterTraits::iterator_category _OIterCategory;
576 return __set_intersection_switch(
577 __begin1, __end1, __begin2, __end2, __out, __pred,
578 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
582 template<
typename _IIter1,
typename _IIter2,
583 typename _OutputIterator>
584 inline _OutputIterator
585 set_symmetric_difference(_IIter1 __begin1, _IIter1 __end1,
586 _IIter2 __begin2, _IIter2 __end2,
587 _OutputIterator __out,
589 {
return _GLIBCXX_STD_A::set_symmetric_difference(
590 __begin1, __end1, __begin2, __end2, __out); }
593 template<
typename _IIter1,
typename _IIter2,
594 typename _OutputIterator,
typename _Predicate>
595 inline _OutputIterator
596 set_symmetric_difference(_IIter1 __begin1, _IIter1 __end1,
597 _IIter2 __begin2, _IIter2 __end2,
598 _OutputIterator __out, _Predicate __pred,
600 {
return _GLIBCXX_STD_A::set_symmetric_difference(
601 __begin1, __end1, __begin2, __end2, __out, __pred); }
604 template<
typename _IIter1,
typename _IIter2,
605 typename _Predicate,
typename _OutputIterator,
606 typename _IteratorTag1,
typename _IteratorTag2,
607 typename _IteratorTag3>
608 inline _OutputIterator
609 __set_symmetric_difference_switch(
610 _IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2, _IIter2 __end2,
611 _OutputIterator __result, _Predicate __pred,
612 _IteratorTag1, _IteratorTag2, _IteratorTag3)
613 {
return _GLIBCXX_STD_A::set_symmetric_difference(
614 __begin1, __end1, __begin2, __end2, __result, __pred); }
617 template<
typename _RAIter1,
typename _RAIter2,
618 typename _Output_RAIter,
typename _Predicate>
620 __set_symmetric_difference_switch(_RAIter1 __begin1,
624 _Output_RAIter __result,
631 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
633 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
635 return __gnu_parallel::__parallel_set_symmetric_difference(
636 __begin1, __end1, __begin2, __end2, __result, __pred);
638 return _GLIBCXX_STD_A::set_symmetric_difference(
639 __begin1, __end1, __begin2, __end2, __result, __pred);
643 template<
typename _IIter1,
typename _IIter2,
644 typename _OutputIterator>
645 inline _OutputIterator
646 set_symmetric_difference(_IIter1 __begin1, _IIter1 __end1,
647 _IIter2 __begin2, _IIter2 __end2,
648 _OutputIterator __out)
650 typedef std::iterator_traits<_IIter1> _IIterTraits1;
651 typedef std::iterator_traits<_IIter2> _IIterTraits2;
652 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
653 typedef typename _IIterTraits1::iterator_category
655 typedef typename _IIterTraits2::iterator_category
657 typedef typename _OIterTraits::iterator_category _OIterCategory;
658 typedef typename _IIterTraits1::value_type _ValueType1;
659 typedef typename _IIterTraits2::value_type _ValueType2;
661 return __set_symmetric_difference_switch(
662 __begin1, __end1, __begin2, __end2, __out,
664 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
668 template<
typename _IIter1,
typename _IIter2,
669 typename _OutputIterator,
typename _Predicate>
670 inline _OutputIterator
671 set_symmetric_difference(_IIter1 __begin1, _IIter1 __end1,
672 _IIter2 __begin2, _IIter2 __end2,
673 _OutputIterator __out, _Predicate __pred)
675 typedef std::iterator_traits<_IIter1> _IIterTraits1;
676 typedef std::iterator_traits<_IIter2> _IIterTraits2;
677 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
678 typedef typename _IIterTraits1::iterator_category
680 typedef typename _IIterTraits2::iterator_category
682 typedef typename _OIterTraits::iterator_category _OIterCategory;
684 return __set_symmetric_difference_switch(
685 __begin1, __end1, __begin2, __end2, __out, __pred,
686 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
690 template<
typename _IIter1,
typename _IIter2,
691 typename _OutputIterator>
692 inline _OutputIterator
693 set_difference(_IIter1 __begin1, _IIter1 __end1,
694 _IIter2 __begin2, _IIter2 __end2,
696 {
return _GLIBCXX_STD_A::set_difference(
697 __begin1,__end1, __begin2, __end2, __out); }
700 template<
typename _IIter1,
typename _IIter2,
701 typename _OutputIterator,
typename _Predicate>
702 inline _OutputIterator
703 set_difference(_IIter1 __begin1, _IIter1 __end1,
704 _IIter2 __begin2, _IIter2 __end2,
705 _OutputIterator __out, _Predicate __pred,
707 {
return _GLIBCXX_STD_A::set_difference(__begin1, __end1,
708 __begin2, __end2, __out, __pred); }
711 template<
typename _IIter1,
typename _IIter2,
typename _Predicate,
712 typename _OutputIterator,
typename _IteratorTag1,
713 typename _IteratorTag2,
typename _IteratorTag3>
714 inline _OutputIterator
715 __set_difference_switch(_IIter1 __begin1, _IIter1 __end1,
716 _IIter2 __begin2, _IIter2 __end2,
717 _OutputIterator __result, _Predicate __pred,
718 _IteratorTag1, _IteratorTag2, _IteratorTag3)
719 {
return _GLIBCXX_STD_A::set_difference(
720 __begin1, __end1, __begin2, __end2, __result, __pred); }
723 template<
typename _RAIter1,
typename _RAIter2,
724 typename _Output_RAIter,
typename _Predicate>
726 __set_difference_switch(_RAIter1 __begin1,
730 _Output_RAIter __result, _Predicate __pred,
736 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
738 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
740 return __gnu_parallel::__parallel_set_difference(
741 __begin1, __end1, __begin2, __end2, __result, __pred);
743 return _GLIBCXX_STD_A::set_difference(
744 __begin1, __end1, __begin2, __end2, __result, __pred);
748 template<
typename _IIter1,
typename _IIter2,
749 typename _OutputIterator>
750 inline _OutputIterator
751 set_difference(_IIter1 __begin1, _IIter1 __end1,
752 _IIter2 __begin2, _IIter2 __end2,
753 _OutputIterator __out)
755 typedef std::iterator_traits<_IIter1> _IIterTraits1;
756 typedef std::iterator_traits<_IIter2> _IIterTraits2;
757 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
758 typedef typename _IIterTraits1::iterator_category
760 typedef typename _IIterTraits2::iterator_category
762 typedef typename _OIterTraits::iterator_category _OIterCategory;
763 typedef typename _IIterTraits1::value_type _ValueType1;
764 typedef typename _IIterTraits2::value_type _ValueType2;
766 return __set_difference_switch(
767 __begin1, __end1, __begin2, __end2, __out,
769 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
773 template<
typename _IIter1,
typename _IIter2,
774 typename _OutputIterator,
typename _Predicate>
775 inline _OutputIterator
776 set_difference(_IIter1 __begin1, _IIter1 __end1,
777 _IIter2 __begin2, _IIter2 __end2,
778 _OutputIterator __out, _Predicate __pred)
780 typedef std::iterator_traits<_IIter1> _IIterTraits1;
781 typedef std::iterator_traits<_IIter2> _IIterTraits2;
782 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
783 typedef typename _IIterTraits1::iterator_category
785 typedef typename _IIterTraits2::iterator_category
787 typedef typename _OIterTraits::iterator_category _OIterCategory;
789 return __set_difference_switch(
790 __begin1, __end1, __begin2, __end2, __out, __pred,
791 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
795 template<
typename _FIterator>
797 adjacent_find(_FIterator __begin, _FIterator __end,
799 {
return _GLIBCXX_STD_A::adjacent_find(__begin, __end); }
802 template<
typename _FIterator,
typename _BinaryPredicate>
804 adjacent_find(_FIterator __begin, _FIterator __end,
805 _BinaryPredicate __binary_pred,
807 {
return _GLIBCXX_STD_A::adjacent_find(__begin, __end, __binary_pred); }
810 template<
typename _RAIter>
812 __adjacent_find_switch(_RAIter __begin, _RAIter __end,
815 typedef iterator_traits<_RAIter> _TraitsType;
816 typedef typename _TraitsType::value_type _ValueType;
825 if (__spot == (__end - 1))
835 template<
typename _FIterator,
typename _IteratorTag>
837 __adjacent_find_switch(_FIterator __begin, _FIterator __end,
842 template<
typename _FIterator>
844 adjacent_find(_FIterator __begin, _FIterator __end)
846 typedef iterator_traits<_FIterator> _TraitsType;
847 typedef typename _TraitsType::iterator_category _IteratorCategory;
848 return __adjacent_find_switch(__begin, __end, _IteratorCategory());
852 template<
typename _FIterator,
typename _BinaryPredicate,
853 typename _IteratorTag>
855 __adjacent_find_switch(_FIterator __begin, _FIterator __end,
856 _BinaryPredicate __pred, _IteratorTag)
857 {
return adjacent_find(__begin, __end, __pred,
861 template<
typename _RAIter,
typename _BinaryPredicate>
863 __adjacent_find_switch(_RAIter __begin, _RAIter __end,
869 __adjacent_find_selector()).first;
871 return adjacent_find(__begin, __end, __pred,
876 template<
typename _FIterator,
typename _BinaryPredicate>
878 adjacent_find(_FIterator __begin, _FIterator __end,
879 _BinaryPredicate __pred)
881 typedef iterator_traits<_FIterator> _TraitsType;
882 typedef typename _TraitsType::iterator_category _IteratorCategory;
883 return __adjacent_find_switch(__begin, __end, __pred,
884 _IteratorCategory());
888 template<
typename _IIter,
typename _Tp>
889 inline typename iterator_traits<_IIter>::difference_type
890 count(_IIter __begin, _IIter __end,
const _Tp& __value,
895 template<
typename _RAIter,
typename _Tp>
896 typename iterator_traits<_RAIter>::difference_type
897 __count_switch(_RAIter __begin, _RAIter __end,
902 typedef iterator_traits<_RAIter> _TraitsType;
903 typedef typename _TraitsType::value_type _ValueType;
904 typedef typename _TraitsType::difference_type _DifferenceType;
908 static_cast<_SequenceIndex>(__end - __begin)
910 && __gnu_parallel::__is_parallel(__parallelism_tag)))
914 _DifferenceType __res = 0;
917 __begin, __end, __value, __functionality,
923 return count(__begin, __end, __value,
928 template<
typename _IIter,
typename _Tp,
typename _IteratorTag>
929 inline typename iterator_traits<_IIter>::difference_type
930 __count_switch(_IIter __begin, _IIter __end,
const _Tp& __value,
936 template<
typename _IIter,
typename _Tp>
937 inline typename iterator_traits<_IIter>::difference_type
938 count(_IIter __begin, _IIter __end,
const _Tp& __value,
941 typedef iterator_traits<_IIter> _TraitsType;
942 typedef typename _TraitsType::iterator_category _IteratorCategory;
943 return __count_switch(__begin, __end, __value, _IteratorCategory(),
947 template<
typename _IIter,
typename _Tp>
948 inline typename iterator_traits<_IIter>::difference_type
949 count(_IIter __begin, _IIter __end,
const _Tp& __value)
951 typedef iterator_traits<_IIter> _TraitsType;
952 typedef typename _TraitsType::iterator_category _IteratorCategory;
953 return __count_switch(__begin, __end, __value, _IteratorCategory());
958 template<
typename _IIter,
typename _Predicate>
959 inline typename iterator_traits<_IIter>::difference_type
960 count_if(_IIter __begin, _IIter __end, _Predicate __pred,
962 {
return _GLIBCXX_STD_A::count_if(__begin, __end, __pred); }
965 template<
typename _RAIter,
typename _Predicate>
966 typename iterator_traits<_RAIter>::difference_type
967 __count_if_switch(_RAIter __begin, _RAIter __end,
972 typedef iterator_traits<_RAIter> _TraitsType;
973 typedef typename _TraitsType::value_type _ValueType;
974 typedef typename _TraitsType::difference_type _DifferenceType;
978 static_cast<_SequenceIndex>(__end - __begin)
980 && __gnu_parallel::__is_parallel(__parallelism_tag)))
982 _DifferenceType __res = 0;
988 __begin, __end, __pred, __functionality,
994 return count_if(__begin, __end, __pred,
999 template<
typename _IIter,
typename _Predicate,
typename _IteratorTag>
1000 inline typename iterator_traits<_IIter>::difference_type
1001 __count_if_switch(_IIter __begin, _IIter __end, _Predicate __pred,
1003 {
return count_if(__begin, __end, __pred,
1007 template<
typename _IIter,
typename _Predicate>
1008 inline typename iterator_traits<_IIter>::difference_type
1009 count_if(_IIter __begin, _IIter __end, _Predicate __pred,
1012 typedef iterator_traits<_IIter> _TraitsType;
1013 typedef typename _TraitsType::iterator_category _IteratorCategory;
1014 return __count_if_switch(__begin, __end, __pred, _IteratorCategory(),
1018 template<
typename _IIter,
typename _Predicate>
1019 inline typename iterator_traits<_IIter>::difference_type
1020 count_if(_IIter __begin, _IIter __end, _Predicate __pred)
1022 typedef iterator_traits<_IIter> _TraitsType;
1023 typedef typename _TraitsType::iterator_category _IteratorCategory;
1024 return __count_if_switch(__begin, __end, __pred, _IteratorCategory());
1029 template<
typename _FIterator1,
typename _FIterator2>
1031 search(_FIterator1 __begin1, _FIterator1 __end1,
1032 _FIterator2 __begin2, _FIterator2 __end2,
1034 {
return _GLIBCXX_STD_A::search(__begin1, __end1, __begin2, __end2); }
1037 template<
typename _RAIter1,
typename _RAIter2>
1039 __search_switch(_RAIter1 __begin1, _RAIter1 __end1,
1040 _RAIter2 __begin2, _RAIter2 __end2,
1043 typedef std::iterator_traits<_RAIter1> _Iterator1Traits;
1044 typedef typename _Iterator1Traits::value_type _ValueType1;
1045 typedef std::iterator_traits<_RAIter2> _Iterator2Traits;
1046 typedef typename _Iterator2Traits::value_type _ValueType2;
1049 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
1053 __begin1, __end1, __begin2, __end2,
1056 return search(__begin1, __end1, __begin2, __end2,
1061 template<
typename _FIterator1,
typename _FIterator2,
1062 typename _IteratorTag1,
typename _IteratorTag2>
1064 __search_switch(_FIterator1 __begin1, _FIterator1 __end1,
1065 _FIterator2 __begin2, _FIterator2 __end2,
1066 _IteratorTag1, _IteratorTag2)
1067 {
return search(__begin1, __end1, __begin2, __end2,
1071 template<
typename _FIterator1,
typename _FIterator2>
1073 search(_FIterator1 __begin1, _FIterator1 __end1,
1074 _FIterator2 __begin2, _FIterator2 __end2)
1076 typedef std::iterator_traits<_FIterator1> _Iterator1Traits;
1077 typedef typename _Iterator1Traits::iterator_category _IteratorCategory1;
1078 typedef std::iterator_traits<_FIterator2> _Iterator2Traits;
1079 typedef typename _Iterator2Traits::iterator_category _IteratorCategory2;
1081 return __search_switch(__begin1, __end1, __begin2, __end2,
1082 _IteratorCategory1(), _IteratorCategory2());
1086 template<
typename _FIterator1,
typename _FIterator2,
1087 typename _BinaryPredicate>
1089 search(_FIterator1 __begin1, _FIterator1 __end1,
1090 _FIterator2 __begin2, _FIterator2 __end2,
1092 {
return _GLIBCXX_STD_A::search(
1093 __begin1, __end1, __begin2, __end2, __pred); }
1096 template<
typename _RAIter1,
typename _RAIter2,
1097 typename _BinaryPredicate>
1099 __search_switch(_RAIter1 __begin1, _RAIter1 __end1,
1100 _RAIter2 __begin2, _RAIter2 __end2,
1101 _BinaryPredicate __pred,
1105 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
1108 __begin2, __end2, __pred);
1110 return search(__begin1, __end1, __begin2, __end2, __pred,
1115 template<
typename _FIterator1,
typename _FIterator2,
1116 typename _BinaryPredicate,
typename _IteratorTag1,
1117 typename _IteratorTag2>
1119 __search_switch(_FIterator1 __begin1, _FIterator1 __end1,
1120 _FIterator2 __begin2, _FIterator2 __end2,
1121 _BinaryPredicate __pred, _IteratorTag1, _IteratorTag2)
1122 {
return search(__begin1, __end1, __begin2, __end2, __pred,
1126 template<
typename _FIterator1,
typename _FIterator2,
1127 typename _BinaryPredicate>
1129 search(_FIterator1 __begin1, _FIterator1 __end1,
1130 _FIterator2 __begin2, _FIterator2 __end2,
1131 _BinaryPredicate __pred)
1133 typedef std::iterator_traits<_FIterator1> _Iterator1Traits;
1134 typedef typename _Iterator1Traits::iterator_category _IteratorCategory1;
1135 typedef std::iterator_traits<_FIterator2> _Iterator2Traits;
1136 typedef typename _Iterator2Traits::iterator_category _IteratorCategory2;
1137 return __search_switch(__begin1, __end1, __begin2, __end2, __pred,
1138 _IteratorCategory1(), _IteratorCategory2());
1142 template<
typename _FIterator,
typename _Integer,
typename _Tp>
1144 search_n(_FIterator __begin, _FIterator __end, _Integer __count,
1146 {
return _GLIBCXX_STD_A::search_n(__begin, __end, __count, __val); }
1149 template<
typename _FIterator,
typename _Integer,
typename _Tp,
1150 typename _BinaryPredicate>
1152 search_n(_FIterator __begin, _FIterator __end, _Integer __count,
1153 const _Tp& __val, _BinaryPredicate __binary_pred,
1155 {
return _GLIBCXX_STD_A::search_n(
1156 __begin, __end, __count, __val, __binary_pred); }
1159 template<
typename _FIterator,
typename _Integer,
typename _Tp>
1161 search_n(_FIterator __begin, _FIterator __end, _Integer __count,
1164 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
1165 return __gnu_parallel::search_n(__begin, __end, __count, __val,
1170 template<
typename _RAIter,
typename _Integer,
1171 typename _Tp,
typename _BinaryPredicate>
1173 __search_n_switch(_RAIter __begin, _RAIter __end, _Integer __count,
1174 const _Tp& __val, _BinaryPredicate __binary_pred,
1178 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1183 __begin, __end, __ps.
begin(), __ps.
end(), __binary_pred);
1186 return _GLIBCXX_STD_A::search_n(__begin, __end, __count, __val,
1191 template<
typename _FIterator,
typename _Integer,
typename _Tp,
1192 typename _BinaryPredicate,
typename _IteratorTag>
1194 __search_n_switch(_FIterator __begin, _FIterator __end, _Integer __count,
1195 const _Tp& __val, _BinaryPredicate __binary_pred,
1197 {
return _GLIBCXX_STD_A::search_n(__begin, __end, __count, __val,
1201 template<
typename _FIterator,
typename _Integer,
typename _Tp,
1202 typename _BinaryPredicate>
1204 search_n(_FIterator __begin, _FIterator __end, _Integer __count,
1205 const _Tp& __val, _BinaryPredicate __binary_pred)
1207 return __search_n_switch(__begin, __end, __count, __val, __binary_pred,
1208 typename std::iterator_traits<_FIterator>::
1209 iterator_category());
1214 template<
typename _IIter,
typename _OutputIterator,
1215 typename _UnaryOperation>
1216 inline _OutputIterator
1217 transform(_IIter __begin, _IIter __end, _OutputIterator __result,
1219 {
return _GLIBCXX_STD_A::transform(__begin, __end, __result, __unary_op); }
1222 template<
typename _RAIter1,
typename _RAIter2,
1223 typename _UnaryOperation>
1225 __transform1_switch(_RAIter1 __begin, _RAIter1 __end,
1226 _RAIter2 __result, _UnaryOperation __unary_op,
1232 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1234 && __gnu_parallel::__is_parallel(__parallelism_tag)))
1236 bool __dummy =
true;
1239 _ItTrip __begin_pair(__begin, __result),
1240 __end_pair(__end, __result + (__end - __begin));
1244 __begin_pair, __end_pair, __unary_op, __functionality,
1246 __dummy, __dummy, -1, __parallelism_tag);
1250 return transform(__begin, __end, __result, __unary_op,
1255 template<
typename _RAIter1,
typename _RAIter2,
1256 typename _UnaryOperation,
typename _IteratorTag1,
1257 typename _IteratorTag2>
1259 __transform1_switch(_RAIter1 __begin, _RAIter1 __end,
1260 _RAIter2 __result, _UnaryOperation __unary_op,
1261 _IteratorTag1, _IteratorTag2)
1262 {
return transform(__begin, __end, __result, __unary_op,
1266 template<
typename _IIter,
typename _OutputIterator,
1267 typename _UnaryOperation>
1268 inline _OutputIterator
1269 transform(_IIter __begin, _IIter __end, _OutputIterator __result,
1270 _UnaryOperation __unary_op,
1273 typedef std::iterator_traits<_IIter> _IIterTraits;
1274 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
1275 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
1276 typedef typename _OIterTraits::iterator_category _OIterCategory;
1278 return __transform1_switch(__begin, __end, __result, __unary_op,
1279 _IIteratorCategory(), _OIterCategory(),
1283 template<
typename _IIter,
typename _OutputIterator,
1284 typename _UnaryOperation>
1285 inline _OutputIterator
1286 transform(_IIter __begin, _IIter __end, _OutputIterator __result,
1287 _UnaryOperation __unary_op)
1289 typedef std::iterator_traits<_IIter> _IIterTraits;
1290 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
1291 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
1292 typedef typename _OIterTraits::iterator_category _OIterCategory;
1294 return __transform1_switch(__begin, __end, __result, __unary_op,
1295 _IIteratorCategory(), _OIterCategory());
1300 template<
typename _IIter1,
typename _IIter2,
1301 typename _OutputIterator,
typename _BinaryOperation>
1302 inline _OutputIterator
1303 transform(_IIter1 __begin1, _IIter1 __end1,
1304 _IIter2 __begin2, _OutputIterator __result,
1306 {
return _GLIBCXX_STD_A::transform(__begin1, __end1,
1307 __begin2, __result, __binary_op); }
1310 template<
typename _RAIter1,
typename _RAIter2,
1311 typename _RAIter3,
typename _BinaryOperation>
1313 __transform2_switch(_RAIter1 __begin1, _RAIter1 __end1,
1315 _RAIter3 __result, _BinaryOperation __binary_op,
1322 (__end1 - __begin1) >=
1324 && __gnu_parallel::__is_parallel(__parallelism_tag)))
1326 bool __dummy =
true;
1330 _ItTrip __begin_triple(__begin1, __begin2, __result),
1331 __end_triple(__end1, __begin2 + (__end1 - __begin1),
1332 __result + (__end1 - __begin1));
1336 __binary_op, __functionality,
1338 __dummy, __dummy, -1,
1343 return transform(__begin1, __end1, __begin2, __result, __binary_op,
1348 template<
typename _IIter1,
typename _IIter2,
1349 typename _OutputIterator,
typename _BinaryOperation,
1350 typename _Tag1,
typename _Tag2,
typename _Tag3>
1351 inline _OutputIterator
1352 __transform2_switch(_IIter1 __begin1, _IIter1 __end1,
1353 _IIter2 __begin2, _OutputIterator __result,
1354 _BinaryOperation __binary_op, _Tag1, _Tag2, _Tag3)
1355 {
return transform(__begin1, __end1, __begin2, __result, __binary_op,
1359 template<
typename _IIter1,
typename _IIter2,
1360 typename _OutputIterator,
typename _BinaryOperation>
1361 inline _OutputIterator
1362 transform(_IIter1 __begin1, _IIter1 __end1,
1363 _IIter2 __begin2, _OutputIterator __result,
1364 _BinaryOperation __binary_op,
1367 typedef std::iterator_traits<_IIter1> _IIterTraits1;
1368 typedef typename _IIterTraits1::iterator_category
1370 typedef std::iterator_traits<_IIter2> _IIterTraits2;
1371 typedef typename _IIterTraits2::iterator_category
1373 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
1374 typedef typename _OIterTraits::iterator_category _OIterCategory;
1376 return __transform2_switch(
1377 __begin1, __end1, __begin2, __result, __binary_op,
1378 _IIterCategory1(), _IIterCategory2(), _OIterCategory(),
1382 template<
typename _IIter1,
typename _IIter2,
1383 typename _OutputIterator,
typename _BinaryOperation>
1384 inline _OutputIterator
1385 transform(_IIter1 __begin1, _IIter1 __end1,
1386 _IIter2 __begin2, _OutputIterator __result,
1387 _BinaryOperation __binary_op)
1389 typedef std::iterator_traits<_IIter1> _IIterTraits1;
1390 typedef typename _IIterTraits1::iterator_category
1392 typedef std::iterator_traits<_IIter2> _IIterTraits2;
1393 typedef typename _IIterTraits2::iterator_category
1395 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
1396 typedef typename _OIterTraits::iterator_category _OIterCategory;
1398 return __transform2_switch(
1399 __begin1, __end1, __begin2, __result, __binary_op,
1400 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
1404 template<
typename _FIterator,
typename _Tp>
1406 replace(_FIterator __begin, _FIterator __end,
const _Tp& __old_value,
1408 { _GLIBCXX_STD_A::replace(__begin, __end, __old_value, __new_value); }
1411 template<
typename _FIterator,
typename _Tp,
typename _IteratorTag>
1413 __replace_switch(_FIterator __begin, _FIterator __end,
1414 const _Tp& __old_value,
const _Tp& __new_value,
1416 { replace(__begin, __end, __old_value, __new_value,
1420 template<
typename _RAIter,
typename _Tp>
1422 __replace_switch(_RAIter __begin, _RAIter __end,
1423 const _Tp& __old_value,
const _Tp& __new_value,
1429 replace(__begin, __end, __old_value, __new_value,
1434 template<
typename _FIterator,
typename _Tp>
1436 replace(_FIterator __begin, _FIterator __end,
const _Tp& __old_value,
1437 const _Tp& __new_value,
1440 typedef iterator_traits<_FIterator> _TraitsType;
1441 typedef typename _TraitsType::iterator_category _IteratorCategory;
1442 __replace_switch(__begin, __end, __old_value, __new_value,
1443 _IteratorCategory(),
1447 template<
typename _FIterator,
typename _Tp>
1449 replace(_FIterator __begin, _FIterator __end,
const _Tp& __old_value,
1450 const _Tp& __new_value)
1452 typedef iterator_traits<_FIterator> _TraitsType;
1453 typedef typename _TraitsType::iterator_category _IteratorCategory;
1454 __replace_switch(__begin, __end, __old_value, __new_value,
1455 _IteratorCategory());
1460 template<
typename _FIterator,
typename _Predicate,
typename _Tp>
1462 replace_if(_FIterator __begin, _FIterator __end, _Predicate __pred,
1464 { _GLIBCXX_STD_A::replace_if(__begin, __end, __pred, __new_value); }
1467 template<
typename _FIterator,
typename _Predicate,
typename _Tp,
1468 typename _IteratorTag>
1470 __replace_if_switch(_FIterator __begin, _FIterator __end,
1471 _Predicate __pred,
const _Tp& __new_value, _IteratorTag)
1472 { replace_if(__begin, __end, __pred, __new_value,
1476 template<
typename _RAIter,
typename _Predicate,
typename _Tp>
1478 __replace_if_switch(_RAIter __begin, _RAIter __end,
1479 _Predicate __pred,
const _Tp& __new_value,
1485 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1487 && __gnu_parallel::__is_parallel(__parallelism_tag)))
1492 __functionality(__new_value);
1495 __begin, __end, __pred, __functionality,
1497 true, __dummy, -1, __parallelism_tag);
1500 replace_if(__begin, __end, __pred, __new_value,
1505 template<
typename _FIterator,
typename _Predicate,
typename _Tp>
1507 replace_if(_FIterator __begin, _FIterator __end,
1508 _Predicate __pred,
const _Tp& __new_value,
1511 typedef std::iterator_traits<_FIterator> _IteratorTraits;
1512 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1513 __replace_if_switch(__begin, __end, __pred, __new_value,
1514 _IteratorCategory(), __parallelism_tag);
1517 template<
typename _FIterator,
typename _Predicate,
typename _Tp>
1519 replace_if(_FIterator __begin, _FIterator __end,
1520 _Predicate __pred,
const _Tp& __new_value)
1522 typedef std::iterator_traits<_FIterator> _IteratorTraits;
1523 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1524 __replace_if_switch(__begin, __end, __pred, __new_value,
1525 _IteratorCategory());
1529 template<
typename _FIterator,
typename _Generator>
1531 generate(_FIterator __begin, _FIterator __end, _Generator __gen,
1533 { _GLIBCXX_STD_A::generate(__begin, __end, __gen); }
1536 template<
typename _FIterator,
typename _Generator,
typename _IteratorTag>
1538 __generate_switch(_FIterator __begin, _FIterator __end, _Generator __gen,
1543 template<
typename _RAIter,
typename _Generator>
1545 __generate_switch(_RAIter __begin, _RAIter __end,
1551 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1553 && __gnu_parallel::__is_parallel(__parallelism_tag)))
1560 __begin, __end, __gen, __functionality,
1562 true, __dummy, -1, __parallelism_tag);
1569 template<
typename _FIterator,
typename _Generator>
1571 generate(_FIterator __begin, _FIterator __end,
1574 typedef std::iterator_traits<_FIterator> _IteratorTraits;
1575 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1576 __generate_switch(__begin, __end, __gen, _IteratorCategory(),
1580 template<
typename _FIterator,
typename _Generator>
1582 generate(_FIterator __begin, _FIterator __end, _Generator __gen)
1584 typedef std::iterator_traits<_FIterator> _IteratorTraits;
1585 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1586 __generate_switch(__begin, __end, __gen, _IteratorCategory());
1591 template<
typename _OutputIterator,
typename _Size,
typename _Generator>
1592 inline _OutputIterator
1593 generate_n(_OutputIterator __begin, _Size __n, _Generator __gen,
1595 {
return _GLIBCXX_STD_A::generate_n(__begin, __n, __gen); }
1598 template<
typename _OutputIterator,
typename _Size,
typename _Generator,
1599 typename _IteratorTag>
1600 inline _OutputIterator
1601 __generate_n_switch(_OutputIterator __begin, _Size __n, _Generator __gen,
1603 {
return generate_n(__begin, __n, __gen,
1607 template<
typename _RAIter,
typename _Size,
typename _Generator>
1609 __generate_n_switch(_RAIter __begin, _Size __n, _Generator __gen,
1619 template<
typename _OutputIterator,
typename _Size,
typename _Generator>
1620 inline _OutputIterator
1621 generate_n(_OutputIterator __begin, _Size __n, _Generator __gen,
1624 typedef std::iterator_traits<_OutputIterator> _IteratorTraits;
1625 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1626 return __generate_n_switch(__begin, __n, __gen, _IteratorCategory(),
1630 template<
typename _OutputIterator,
typename _Size,
typename _Generator>
1631 inline _OutputIterator
1632 generate_n(_OutputIterator __begin, _Size __n, _Generator __gen)
1634 typedef std::iterator_traits<_OutputIterator> _IteratorTraits;
1635 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1636 return __generate_n_switch(__begin, __n, __gen, _IteratorCategory());
1641 template<
typename _RAIter>
1643 random_shuffle(_RAIter __begin, _RAIter __end,
1645 { _GLIBCXX_STD_A::random_shuffle(__begin, __end); }
1648 template<
typename _RAIter,
typename _RandomNumberGenerator>
1650 random_shuffle(_RAIter __begin, _RAIter __end,
1651 _RandomNumberGenerator& __rand,
1653 { _GLIBCXX_STD_A::random_shuffle(__begin, __end, __rand); }
1657 template<
typename _MustBeInt =
int>
1661 operator()(
int __limit)
1662 {
return rand() % __limit; }
1666 template<
typename _RAIter>
1668 random_shuffle(_RAIter __begin, _RAIter __end)
1672 __gnu_parallel::random_shuffle(__begin, __end, __r);
1676 template<
typename _RAIter,
typename _RandomNumberGenerator>
1678 random_shuffle(_RAIter __begin, _RAIter __end,
1679 #
if __cplusplus >= 201103L
1680 _RandomNumberGenerator&& __rand)
1682 _RandomNumberGenerator& __rand)
1685 if (__begin == __end)
1688 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1696 template<
typename _FIterator,
typename _Predicate>
1698 partition(_FIterator __begin, _FIterator __end,
1700 {
return _GLIBCXX_STD_A::partition(__begin, __end, __pred); }
1703 template<
typename _FIterator,
typename _Predicate,
typename _IteratorTag>
1705 __partition_switch(_FIterator __begin, _FIterator __end,
1706 _Predicate __pred, _IteratorTag)
1707 {
return partition(__begin, __end, __pred,
1711 template<
typename _RAIter,
typename _Predicate>
1713 __partition_switch(_RAIter __begin, _RAIter __end,
1714 _Predicate __pred, random_access_iterator_tag)
1717 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1720 typedef typename std::iterator_traits<_RAIter>::
1721 difference_type _DifferenceType;
1724 __gnu_parallel::__get_max_threads());
1725 return __begin + __middle;
1728 return partition(__begin, __end, __pred,
1733 template<
typename _FIterator,
typename _Predicate>
1735 partition(_FIterator __begin, _FIterator __end, _Predicate __pred)
1737 typedef iterator_traits<_FIterator> _TraitsType;
1738 typedef typename _TraitsType::iterator_category _IteratorCategory;
1739 return __partition_switch(__begin, __end, __pred, _IteratorCategory());
1745 template<
typename _RAIter>
1747 sort(_RAIter __begin, _RAIter __end,
1749 { _GLIBCXX_STD_A::sort(__begin, __end); }
1752 template<
typename _RAIter,
typename _Compare>
1754 sort(_RAIter __begin, _RAIter __end, _Compare __comp,
1756 { _GLIBCXX_STD_A::sort<_RAIter, _Compare>(__begin, __end,
1760 template<
typename _RAIter,
typename _Compare,
1763 sort(_RAIter __begin, _RAIter __end, _Compare __comp,
1766 typedef iterator_traits<_RAIter> _TraitsType;
1767 typedef typename _TraitsType::value_type _ValueType;
1769 if (__begin != __end)
1772 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) >=
1774 __gnu_parallel::__parallel_sort<false>(
1775 __begin, __end, __comp, __parallelism);
1782 template<
typename _RAIter>
1784 sort(_RAIter __begin, _RAIter __end)
1786 typedef iterator_traits<_RAIter> _TraitsType;
1787 typedef typename _TraitsType::value_type _ValueType;
1793 template<
typename _RAIter>
1795 sort(_RAIter __begin, _RAIter __end,
1798 typedef iterator_traits<_RAIter> _TraitsType;
1799 typedef typename _TraitsType::value_type _ValueType;
1804 template<
typename _RAIter>
1806 sort(_RAIter __begin, _RAIter __end,
1809 typedef iterator_traits<_RAIter> _TraitsType;
1810 typedef typename _TraitsType::value_type _ValueType;
1815 template<
typename _RAIter>
1817 sort(_RAIter __begin, _RAIter __end,
1820 typedef iterator_traits<_RAIter> _TraitsType;
1821 typedef typename _TraitsType::value_type _ValueType;
1826 template<
typename _RAIter>
1828 sort(_RAIter __begin, _RAIter __end,
1831 typedef iterator_traits<_RAIter> _TraitsType;
1832 typedef typename _TraitsType::value_type _ValueType;
1837 template<
typename _RAIter>
1839 sort(_RAIter __begin, _RAIter __end,
1842 typedef iterator_traits<_RAIter> _TraitsType;
1843 typedef typename _TraitsType::value_type _ValueType;
1848 template<
typename _RAIter>
1850 sort(_RAIter __begin, _RAIter __end,
1853 typedef iterator_traits<_RAIter> _TraitsType;
1854 typedef typename _TraitsType::value_type _ValueType;
1859 template<
typename _RAIter>
1861 sort(_RAIter __begin, _RAIter __end,
1864 typedef iterator_traits<_RAIter> _TraitsType;
1865 typedef typename _TraitsType::value_type _ValueType;
1870 template<
typename _RAIter,
typename _Compare>
1872 sort(_RAIter __begin, _RAIter __end, _Compare __comp)
1874 typedef iterator_traits<_RAIter> _TraitsType;
1875 typedef typename _TraitsType::value_type _ValueType;
1884 template<
typename _RAIter>
1886 stable_sort(_RAIter __begin, _RAIter __end,
1888 { _GLIBCXX_STD_A::stable_sort(__begin, __end); }
1891 template<
typename _RAIter,
typename _Compare>
1893 stable_sort(_RAIter __begin, _RAIter __end,
1895 { _GLIBCXX_STD_A::stable_sort<_RAIter, _Compare>(
1896 __begin, __end, __comp); }
1899 template<
typename _RAIter,
typename _Compare,
1902 stable_sort(_RAIter __begin, _RAIter __end,
1905 typedef iterator_traits<_RAIter> _TraitsType;
1906 typedef typename _TraitsType::value_type _ValueType;
1908 if (__begin != __end)
1911 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) >=
1913 __gnu_parallel::__parallel_sort<true>(
1914 __begin, __end, __comp, __parallelism);
1916 stable_sort(__begin, __end, __comp,
1922 template<
typename _RAIter>
1924 stable_sort(_RAIter __begin, _RAIter __end)
1926 typedef iterator_traits<_RAIter> _TraitsType;
1927 typedef typename _TraitsType::value_type _ValueType;
1933 template<
typename _RAIter>
1935 stable_sort(_RAIter __begin, _RAIter __end,
1938 typedef iterator_traits<_RAIter> _TraitsType;
1939 typedef typename _TraitsType::value_type _ValueType;
1944 template<
typename _RAIter>
1946 stable_sort(_RAIter __begin, _RAIter __end,
1949 typedef iterator_traits<_RAIter> _TraitsType;
1950 typedef typename _TraitsType::value_type _ValueType;
1955 template<
typename _RAIter>
1957 stable_sort(_RAIter __begin, _RAIter __end,
1960 typedef iterator_traits<_RAIter> _TraitsType;
1961 typedef typename _TraitsType::value_type _ValueType;
1966 template<
typename _RAIter>
1968 stable_sort(_RAIter __begin, _RAIter __end,
1971 typedef iterator_traits<_RAIter> _TraitsType;
1972 typedef typename _TraitsType::value_type _ValueType;
1977 template<
typename _RAIter>
1979 stable_sort(_RAIter __begin, _RAIter __end,
1982 typedef iterator_traits<_RAIter> _TraitsType;
1983 typedef typename _TraitsType::value_type _ValueType;
1988 template<
typename _RAIter,
typename _Compare>
1990 stable_sort(_RAIter __begin, _RAIter __end,
1993 typedef iterator_traits<_RAIter> _TraitsType;
1994 typedef typename _TraitsType::value_type _ValueType;
2000 template<
typename _IIter1,
typename _IIter2,
2001 typename _OutputIterator>
2002 inline _OutputIterator
2003 merge(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
2004 _IIter2 __end2, _OutputIterator __result,
2006 {
return _GLIBCXX_STD_A::merge(
2007 __begin1, __end1, __begin2, __end2, __result); }
2010 template<
typename _IIter1,
typename _IIter2,
2011 typename _OutputIterator,
typename _Compare>
2012 inline _OutputIterator
2013 merge(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
2014 _IIter2 __end2, _OutputIterator __result, _Compare __comp,
2016 {
return _GLIBCXX_STD_A::merge(
2017 __begin1, __end1, __begin2, __end2, __result, __comp); }
2020 template<
typename _IIter1,
typename _IIter2,
typename _OutputIterator,
2021 typename _Compare,
typename _IteratorTag1,
2022 typename _IteratorTag2,
typename _IteratorTag3>
2023 inline _OutputIterator
2024 __merge_switch(_IIter1 __begin1, _IIter1 __end1,
2025 _IIter2 __begin2, _IIter2 __end2,
2026 _OutputIterator __result, _Compare __comp,
2027 _IteratorTag1, _IteratorTag2, _IteratorTag3)
2028 {
return _GLIBCXX_STD_A::merge(__begin1, __end1, __begin2, __end2,
2029 __result, __comp); }
2032 template<
typename _IIter1,
typename _IIter2,
2033 typename _OutputIterator,
typename _Compare>
2035 __merge_switch(_IIter1 __begin1, _IIter1 __end1,
2036 _IIter2 __begin2, _IIter2 __end2,
2037 _OutputIterator __result, _Compare __comp,
2038 random_access_iterator_tag, random_access_iterator_tag,
2039 random_access_iterator_tag)
2042 (static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
2044 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
2047 __begin1, __end1, __begin2, __end2, __result,
2048 (__end1 - __begin1) + (__end2 - __begin2), __comp);
2051 __begin1, __end1, __begin2, __end2, __result,
2052 (__end1 - __begin1) + (__end2 - __begin2), __comp);
2056 template<
typename _IIter1,
typename _IIter2,
2057 typename _OutputIterator,
typename _Compare>
2058 inline _OutputIterator
2059 merge(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
2060 _IIter2 __end2, _OutputIterator __result, _Compare __comp)
2062 typedef typename iterator_traits<_IIter1>::value_type _ValueType;
2064 typedef std::iterator_traits<_IIter1> _IIterTraits1;
2065 typedef std::iterator_traits<_IIter2> _IIterTraits2;
2066 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
2067 typedef typename _IIterTraits1::iterator_category
2069 typedef typename _IIterTraits2::iterator_category
2071 typedef typename _OIterTraits::iterator_category _OIterCategory;
2073 return __merge_switch(
2074 __begin1, __end1, __begin2, __end2, __result, __comp,
2075 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
2080 template<
typename _IIter1,
typename _IIter2,
2081 typename _OutputIterator>
2082 inline _OutputIterator
2083 merge(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
2084 _IIter2 __end2, _OutputIterator __result)
2086 typedef std::iterator_traits<_IIter1> _Iterator1Traits;
2087 typedef std::iterator_traits<_IIter2> _Iterator2Traits;
2088 typedef typename _Iterator1Traits::value_type _ValueType1;
2089 typedef typename _Iterator2Traits::value_type _ValueType2;
2091 return __gnu_parallel::merge(__begin1, __end1, __begin2, __end2,
2096 template<
typename _RAIter>
2098 nth_element(_RAIter __begin, _RAIter __nth,
2100 {
return _GLIBCXX_STD_A::nth_element(__begin, __nth, __end); }
2103 template<
typename _RAIter,
typename _Compare>
2105 nth_element(_RAIter __begin, _RAIter __nth,
2106 _RAIter __end, _Compare __comp,
2108 {
return _GLIBCXX_STD_A::nth_element(__begin, __nth, __end, __comp); }
2111 template<
typename _RAIter,
typename _Compare>
2113 nth_element(_RAIter __begin, _RAIter __nth,
2114 _RAIter __end, _Compare __comp)
2117 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
2121 nth_element(__begin, __nth, __end, __comp,
2126 template<
typename _RAIter>
2128 nth_element(_RAIter __begin, _RAIter __nth,
2131 typedef iterator_traits<_RAIter> _TraitsType;
2132 typedef typename _TraitsType::value_type _ValueType;
2133 __gnu_parallel::nth_element(__begin, __nth, __end,
2138 template<
typename _RAIter,
typename _Compare>
2140 partial_sort(_RAIter __begin, _RAIter __middle,
2141 _RAIter __end, _Compare __comp,
2143 { _GLIBCXX_STD_A::partial_sort(__begin, __middle, __end, __comp); }
2146 template<
typename _RAIter>
2148 partial_sort(_RAIter __begin, _RAIter __middle,
2150 { _GLIBCXX_STD_A::partial_sort(__begin, __middle, __end); }
2153 template<
typename _RAIter,
typename _Compare>
2155 partial_sort(_RAIter __begin, _RAIter __middle,
2156 _RAIter __end, _Compare __comp)
2159 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
2164 partial_sort(__begin, __middle, __end, __comp,
2169 template<
typename _RAIter>
2171 partial_sort(_RAIter __begin, _RAIter __middle,
2174 typedef iterator_traits<_RAIter> _TraitsType;
2175 typedef typename _TraitsType::value_type _ValueType;
2176 __gnu_parallel::partial_sort(__begin, __middle, __end,
2181 template<
typename _FIterator>
2183 max_element(_FIterator __begin, _FIterator __end,
2185 {
return _GLIBCXX_STD_A::max_element(__begin, __end); }
2188 template<
typename _FIterator,
typename _Compare>
2190 max_element(_FIterator __begin, _FIterator __end, _Compare __comp,
2192 {
return _GLIBCXX_STD_A::max_element(__begin, __end, __comp); }
2195 template<
typename _FIterator,
typename _Compare,
typename _IteratorTag>
2197 __max_element_switch(_FIterator __begin, _FIterator __end,
2198 _Compare __comp, _IteratorTag)
2199 {
return max_element(__begin, __end, __comp,
2203 template<
typename _RAIter,
typename _Compare>
2205 __max_element_switch(_RAIter __begin, _RAIter __end,
2206 _Compare __comp, random_access_iterator_tag,
2211 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
2213 && __gnu_parallel::__is_parallel(__parallelism_tag)))
2215 _RAIter __res(__begin);
2222 __res, __res, -1, __parallelism_tag);
2226 return max_element(__begin, __end, __comp,
2231 template<
typename _FIterator>
2233 max_element(_FIterator __begin, _FIterator __end,
2236 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
2241 template<
typename _FIterator>
2243 max_element(_FIterator __begin, _FIterator __end)
2245 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
2246 return __gnu_parallel::max_element(__begin, __end,
2251 template<
typename _FIterator,
typename _Compare>
2253 max_element(_FIterator __begin, _FIterator __end, _Compare __comp,
2256 typedef iterator_traits<_FIterator> _TraitsType;
2257 typedef typename _TraitsType::iterator_category _IteratorCategory;
2258 return __max_element_switch(__begin, __end, __comp, _IteratorCategory(),
2262 template<
typename _FIterator,
typename _Compare>
2264 max_element(_FIterator __begin, _FIterator __end, _Compare __comp)
2266 typedef iterator_traits<_FIterator> _TraitsType;
2267 typedef typename _TraitsType::iterator_category _IteratorCategory;
2268 return __max_element_switch(__begin, __end, __comp, _IteratorCategory());
2273 template<
typename _FIterator>
2275 min_element(_FIterator __begin, _FIterator __end,
2277 {
return _GLIBCXX_STD_A::min_element(__begin, __end); }
2280 template<
typename _FIterator,
typename _Compare>
2282 min_element(_FIterator __begin, _FIterator __end, _Compare __comp,
2284 {
return _GLIBCXX_STD_A::min_element(__begin, __end, __comp); }
2287 template<
typename _FIterator,
typename _Compare,
typename _IteratorTag>
2289 __min_element_switch(_FIterator __begin, _FIterator __end,
2290 _Compare __comp, _IteratorTag)
2291 {
return min_element(__begin, __end, __comp,
2295 template<
typename _RAIter,
typename _Compare>
2297 __min_element_switch(_RAIter __begin, _RAIter __end,
2298 _Compare __comp, random_access_iterator_tag,
2303 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
2305 && __gnu_parallel::__is_parallel(__parallelism_tag)))
2307 _RAIter __res(__begin);
2314 __res, __res, -1, __parallelism_tag);
2318 return min_element(__begin, __end, __comp,
2323 template<
typename _FIterator>
2325 min_element(_FIterator __begin, _FIterator __end,
2328 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
2333 template<
typename _FIterator>
2335 min_element(_FIterator __begin, _FIterator __end)
2337 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
2338 return __gnu_parallel::min_element(__begin, __end,
2343 template<
typename _FIterator,
typename _Compare>
2345 min_element(_FIterator __begin, _FIterator __end, _Compare __comp,
2348 typedef iterator_traits<_FIterator> _TraitsType;
2349 typedef typename _TraitsType::iterator_category _IteratorCategory;
2350 return __min_element_switch(__begin, __end, __comp, _IteratorCategory(),
2354 template<
typename _FIterator,
typename _Compare>
2356 min_element(_FIterator __begin, _FIterator __end, _Compare __comp)
2358 typedef iterator_traits<_FIterator> _TraitsType;
2359 typedef typename _TraitsType::iterator_category _IteratorCategory;
2360 return __min_element_switch(__begin, __end, __comp, _IteratorCategory());
Parallelization of embarrassingly parallel execution by means of equal splitting. This file is a GNU ...
static const _Settings & get()
Get the global settings.
_OutputIterator __merge_advance(_RAIter1 &__begin1, _RAIter1 __end1, _RAIter2 &__begin2, _RAIter2 __end2, _OutputIterator __target, _DifferenceTp __max_length, _Compare __comp)
Merge routine being able to merge only the __max_length smallest elements.
iterator end() const
End iterator.
std::transform() __selector, one input sequence variant.
__RAIter1 __search_template(__RAIter1 __begin1, __RAIter1 __end1, __RAIter2 __begin2, __RAIter2 __end2, _Pred __pred)
Parallel std::search.
Forces parallel sorting using balanced quicksort at compile time.
Sequential helper functions. This file is a GNU parallel extension to the Standard C++ Library...
Reduction function doing nothing.
Parallel implementations of std::unique_copy(). This file is a GNU parallel extension to the Standard...
Test predicate on several elements.
_OutputIterator __parallel_unique_copy(_IIter __first, _IIter __last, _OutputIterator __result, _BinaryPredicate __binary_pred)
Parallel std::unique_copy(), w/__o explicit equality predicate.
iterator begin() const
Begin iterator.
Forces parallel sorting using multiway mergesort with exact splitting at compile time.
Main interface for embarrassingly parallel functions.
std::iterator_traits< _RAIter >::difference_type __parallel_partition(_RAIter __begin, _RAIter __end, _Predicate __pred, _ThreadIndex __num_threads)
Parallel implementation of std::partition.
std::transform() __selector, two input sequences variant.
void __parallel_random_shuffle(_RAIter __begin, _RAIter __end, _RandomNumberGenerator __rng=_RandomNumber())
Parallel random public call.
Parallelization of embarrassingly parallel execution by means of an OpenMP for loop. This file is a GNU parallel extension to the Standard C++ Library.
Forces sequential execution at compile time.
Parallel sorting algorithm switch. This file is a GNU parallel extension to the Standard C++ Library...
Forces parallel sorting using unbalanced quicksort at compile time.
void __parallel_partial_sort(_RAIter __begin, _RAIter __middle, _RAIter __end, _Compare __comp)
Parallel implementation of std::partial_sort().
#define _GLIBCXX_PARALLEL_CONDITION(__c)
Determine at compile(?)-time if the parallel variant of an algorithm should be called.
Similar to std::binder2nd, but giving the argument types explicitly.
std::generate() selector.
_It _M_finish_iterator
_Iterator on last element processed; needed for some algorithms (e. g. std::transform()).
Random-access iterators support a superset of bidirectional iterator operations.
Selector that just returns the passed iterator.
uint64_t _SequenceIndex
Unsigned integer to index __elements. The total number of elements for each algorithm must fit into t...
One of the math functors.
Parallelization of embarrassingly parallel execution by means of an OpenMP for loop with static sched...
_Parallelism
Run-time equivalents for the compile-time tags.
One of the comparison functors.
Helper iterator classes for the std::transform() functions. This file is a GNU parallel extension to ...
Parallel implementation of std::random_shuffle(). This file is a GNU parallel extension to the Standa...
Reduction for finding the maximum element, using a comparator.
std::count_if () selector.
size_t count() const noexcept
Returns the number of bits which are set.
Similar to std::equal_to, but allows two different types.
Recommends parallel execution at compile time, optionally using a user-specified number of threads...
Parallel implementation base for std::search() and std::search_n(). This file is a GNU parallel exten...
Similar to std::less, but allows two different types.
std::for_each() selector.
_Function objects representing different tasks to be plugged into the parallel find algorithm...
Functor wrapper for std::rand().
A triple of iterators. The usual iterator operations are applied to all three child iterators...
void __parallel_nth_element(_RAIter __begin, _RAIter __nth, _RAIter __end, _Compare __comp)
Parallel implementation of std::nth_element().
Forces parallel sorting using multiway mergesort at compile time.
std::pair< _RAIter1, _RAIter2 > __find_template(_RAIter1 __begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred, _Selector __selector)
Parallel std::find, switch for different algorithms.
_UserOp __for_each_template_random_access(_IIter __begin, _IIter __end, _UserOp __user_op, _Functionality &__functionality, _Red __reduction, _Result __reduction_start, _Result &__output, typename std::iterator_traits< _IIter >::difference_type __bound, _Parallelism __parallelism_tag)
Chose the desired algorithm by evaluating __parallelism_tag.
Reduction for finding the maximum element, using a comparator.
Sequence that conceptually consists of multiple copies of the same element. The copies are not stored...
_RAIter3 __parallel_merge_advance(_RAIter1 &__begin1, _RAIter1 __end1, _RAIter2 &__begin2, _RAIter2 __end2, _RAIter3 __target, typename std::iterator_traits< _RAIter1 >::difference_type __max_length, _Compare __comp)
Merge routine fallback to sequential in case the iterators of the two input sequences are of differen...
A pair of iterators. The usual iterator operations are applied to both child iterators.
Parallel balanced (work-stealing).
Parallel implementation of std::merge(). This file is a GNU parallel extension to the Standard C++ Li...
Forces parallel sorting using multiway mergesort with splitting by sampling at compile time...
Parallel implementations of set operations for random-access iterators. This file is a GNU parallel e...
Parallelization of embarrassingly parallel execution by means of work-stealing.
Parallel implementation of std::partition(), std::nth_element(), and std::partial_sort(). This file is a GNU parallel extension to the Standard C++ Library.
Parallel unbalanced (equal-sized chunks).
One of the comparison functors.
Test predicate on two adjacent elements.
Test predicate on a single element, used for std::find() and std::find_if ().
Parallel implementation base for std::find(), std::equal() and related functions. This file is a GNU ...
Functors representing different tasks to be plugged into the generic parallelization methods for emba...
void __sequential_random_shuffle(_RAIter __begin, _RAIter __end, _RandomNumberGenerator &__rng)
Sequential cache-efficient random shuffle.
Recommends parallel execution using the default parallel algorithm.