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,
88 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
90 && __gnu_parallel::__is_parallel(__parallelism_tag)))
97 __begin, __end, __f, __functionality,
106 template<
typename _Iterator,
typename _Function>
108 for_each(_Iterator __begin, _Iterator __end, _Function __f,
111 typedef std::iterator_traits<_Iterator> _IteratorTraits;
112 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
113 return __for_each_switch(__begin, __end, __f, _IteratorCategory(),
117 template<
typename _Iterator,
typename _Function>
119 for_each(_Iterator __begin, _Iterator __end, _Function __f)
121 typedef std::iterator_traits<_Iterator> _IteratorTraits;
122 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
123 return __for_each_switch(__begin, __end, __f, _IteratorCategory());
128 template<
typename _IIter,
typename _Tp>
130 find(_IIter __begin, _IIter __end,
const _Tp& __val,
132 {
return _GLIBCXX_STD_A::find(__begin, __end, __val); }
135 template<
typename _IIter,
typename _Tp,
typename _IteratorTag>
137 __find_switch(_IIter __begin, _IIter __end,
const _Tp& __val,
139 {
return _GLIBCXX_STD_A::find(__begin, __end, __val); }
142 template<
typename _RAIter,
typename _Tp>
144 __find_switch(_RAIter __begin, _RAIter __end,
147 typedef iterator_traits<_RAIter> _TraitsType;
148 typedef typename _TraitsType::value_type _ValueType;
154 _ValueType,
const _Tp&,
bool>
157 __begin, __end, __begin, __comp,
161 return _GLIBCXX_STD_A::find(__begin, __end, __val);
165 template<
typename _IIter,
typename _Tp>
167 find(_IIter __begin, _IIter __end,
const _Tp& __val)
169 typedef std::iterator_traits<_IIter> _IteratorTraits;
170 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
171 return __find_switch(__begin, __end, __val, _IteratorCategory());
175 template<
typename _IIter,
typename _Predicate>
177 find_if(_IIter __begin, _IIter __end, _Predicate __pred,
179 {
return _GLIBCXX_STD_A::find_if(__begin, __end, __pred); }
182 template<
typename _IIter,
typename _Predicate,
typename _IteratorTag>
184 __find_if_switch(_IIter __begin, _IIter __end, _Predicate __pred,
186 {
return _GLIBCXX_STD_A::find_if(__begin, __end, __pred); }
189 template<
typename _RAIter,
typename _Predicate>
191 __find_if_switch(_RAIter __begin, _RAIter __end,
197 __find_if_selector()).first;
199 return _GLIBCXX_STD_A::find_if(__begin, __end, __pred);
203 template<
typename _IIter,
typename _Predicate>
205 find_if(_IIter __begin, _IIter __end, _Predicate __pred)
207 typedef std::iterator_traits<_IIter> _IteratorTraits;
208 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
209 return __find_if_switch(__begin, __end, __pred, _IteratorCategory());
213 template<
typename _IIter,
typename _FIterator>
215 find_first_of(_IIter __begin1, _IIter __end1,
216 _FIterator __begin2, _FIterator __end2,
218 {
return _GLIBCXX_STD_A::find_first_of(__begin1, __end1, __begin2, __end2);
222 template<
typename _IIter,
typename _FIterator,
223 typename _BinaryPredicate>
225 find_first_of(_IIter __begin1, _IIter __end1,
226 _FIterator __begin2, _FIterator __end2,
228 {
return _GLIBCXX_STD_A::find_first_of(
229 __begin1, __end1, __begin2, __end2, __comp); }
232 template<
typename _IIter,
typename _FIterator,
233 typename _IteratorTag1,
typename _IteratorTag2>
235 __find_first_of_switch(_IIter __begin1, _IIter __end1,
236 _FIterator __begin2, _FIterator __end2,
237 _IteratorTag1, _IteratorTag2)
238 {
return find_first_of(__begin1, __end1, __begin2, __end2,
242 template<
typename _RAIter,
typename _FIterator,
243 typename _BinaryPredicate,
typename _IteratorTag>
245 __find_first_of_switch(_RAIter __begin1,
247 _FIterator __begin2, _FIterator __end2,
254 <_FIterator>(__begin2, __end2)).first;
258 template<
typename _IIter,
typename _FIterator,
259 typename _BinaryPredicate,
typename _IteratorTag1,
260 typename _IteratorTag2>
262 __find_first_of_switch(_IIter __begin1, _IIter __end1,
263 _FIterator __begin2, _FIterator __end2,
264 _BinaryPredicate __comp, _IteratorTag1, _IteratorTag2)
265 {
return find_first_of(__begin1, __end1, __begin2, __end2, __comp,
269 template<
typename _IIter,
typename _FIterator,
270 typename _BinaryPredicate>
272 find_first_of(_IIter __begin1, _IIter __end1,
273 _FIterator __begin2, _FIterator __end2,
274 _BinaryPredicate __comp)
276 typedef std::iterator_traits<_IIter> _IIterTraits;
277 typedef std::iterator_traits<_FIterator> _FIterTraits;
278 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
279 typedef typename _FIterTraits::iterator_category _FIteratorCategory;
281 return __find_first_of_switch(__begin1, __end1, __begin2, __end2, __comp,
282 _IIteratorCategory(), _FIteratorCategory());
286 template<
typename _IIter,
typename _FIterator>
288 find_first_of(_IIter __begin1, _IIter __end1,
289 _FIterator __begin2, _FIterator __end2)
291 typedef std::iterator_traits<_IIter> _IIterTraits;
292 typedef std::iterator_traits<_FIterator> _FIterTraits;
293 typedef typename _IIterTraits::value_type _IValueType;
294 typedef typename _FIterTraits::value_type _FValueType;
296 return __gnu_parallel::find_first_of(__begin1, __end1, __begin2, __end2,
301 template<
typename _IIter,
typename _OutputIterator>
302 inline _OutputIterator
303 unique_copy(_IIter __begin1, _IIter __end1, _OutputIterator __out,
305 {
return _GLIBCXX_STD_A::unique_copy(__begin1, __end1, __out); }
308 template<
typename _IIter,
typename _OutputIterator,
310 inline _OutputIterator
311 unique_copy(_IIter __begin1, _IIter __end1, _OutputIterator __out,
313 {
return _GLIBCXX_STD_A::unique_copy(__begin1, __end1, __out, __pred); }
316 template<
typename _IIter,
typename _OutputIterator,
317 typename _Predicate,
typename _IteratorTag1,
typename _IteratorTag2>
318 inline _OutputIterator
319 __unique_copy_switch(_IIter __begin, _IIter __last,
320 _OutputIterator __out, _Predicate __pred,
321 _IteratorTag1, _IteratorTag2)
322 {
return _GLIBCXX_STD_A::unique_copy(__begin, __last, __out, __pred); }
325 template<
typename _RAIter,
typename RandomAccessOutputIterator,
327 RandomAccessOutputIterator
328 __unique_copy_switch(_RAIter __begin, _RAIter __last,
329 RandomAccessOutputIterator __out, _Predicate __pred,
333 static_cast<__gnu_parallel::_SequenceIndex>(__last - __begin)
336 __begin, __last, __out, __pred);
338 return _GLIBCXX_STD_A::unique_copy(__begin, __last, __out, __pred);
342 template<
typename _IIter,
typename _OutputIterator>
343 inline _OutputIterator
344 unique_copy(_IIter __begin1, _IIter __end1, _OutputIterator __out)
346 typedef std::iterator_traits<_IIter> _IIterTraits;
347 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
348 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
349 typedef typename _IIterTraits::value_type _ValueType;
350 typedef typename _OIterTraits::iterator_category _OIterCategory;
352 return __unique_copy_switch(
354 _IIteratorCategory(), _OIterCategory());
358 template<
typename _IIter,
typename _OutputIterator,
typename _Predicate>
359 inline _OutputIterator
360 unique_copy(_IIter __begin1, _IIter __end1, _OutputIterator __out,
363 typedef std::iterator_traits<_IIter> _IIterTraits;
364 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
365 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
366 typedef typename _OIterTraits::iterator_category _OIterCategory;
368 return __unique_copy_switch(
369 __begin1, __end1, __out, __pred,
370 _IIteratorCategory(), _OIterCategory());
374 template<
typename _IIter1,
typename _IIter2,
375 typename _OutputIterator>
376 inline _OutputIterator
377 set_union(_IIter1 __begin1, _IIter1 __end1,
378 _IIter2 __begin2, _IIter2 __end2,
380 {
return _GLIBCXX_STD_A::set_union(
381 __begin1, __end1, __begin2, __end2, __out); }
384 template<
typename _IIter1,
typename _IIter2,
385 typename _OutputIterator,
typename _Predicate>
386 inline _OutputIterator
387 set_union(_IIter1 __begin1, _IIter1 __end1,
388 _IIter2 __begin2, _IIter2 __end2,
389 _OutputIterator __out, _Predicate __pred,
391 {
return _GLIBCXX_STD_A::set_union(__begin1, __end1,
392 __begin2, __end2, __out, __pred); }
395 template<
typename _IIter1,
typename _IIter2,
typename _Predicate,
396 typename _OutputIterator,
typename _IteratorTag1,
397 typename _IteratorTag2,
typename _IteratorTag3>
398 inline _OutputIterator
400 _IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2, _IIter2 __end2,
401 _OutputIterator __result, _Predicate __pred,
402 _IteratorTag1, _IteratorTag2, _IteratorTag3)
403 {
return _GLIBCXX_STD_A::set_union(__begin1, __end1,
404 __begin2, __end2, __result, __pred); }
407 template<
typename _RAIter1,
typename _RAIter2,
408 typename _Output_RAIter,
typename _Predicate>
410 __set_union_switch(_RAIter1 __begin1, _RAIter1 __end1,
411 _RAIter2 __begin2, _RAIter2 __end2,
412 _Output_RAIter __result, _Predicate __pred,
417 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
419 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
421 return __gnu_parallel::__parallel_set_union(
422 __begin1, __end1, __begin2, __end2, __result, __pred);
424 return _GLIBCXX_STD_A::set_union(__begin1, __end1,
425 __begin2, __end2, __result, __pred);
429 template<
typename _IIter1,
typename _IIter2,
430 typename _OutputIterator>
431 inline _OutputIterator
432 set_union(_IIter1 __begin1, _IIter1 __end1,
433 _IIter2 __begin2, _IIter2 __end2, _OutputIterator __out)
435 typedef std::iterator_traits<_IIter1> _IIterTraits1;
436 typedef std::iterator_traits<_IIter2> _IIterTraits2;
437 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
438 typedef typename _IIterTraits1::iterator_category
440 typedef typename _IIterTraits2::iterator_category
442 typedef typename _OIterTraits::iterator_category _OIterCategory;
443 typedef typename _IIterTraits1::value_type _ValueType1;
444 typedef typename _IIterTraits2::value_type _ValueType2;
446 return __set_union_switch(
447 __begin1, __end1, __begin2, __end2, __out,
449 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
453 template<
typename _IIter1,
typename _IIter2,
454 typename _OutputIterator,
typename _Predicate>
455 inline _OutputIterator
456 set_union(_IIter1 __begin1, _IIter1 __end1,
457 _IIter2 __begin2, _IIter2 __end2,
458 _OutputIterator __out, _Predicate __pred)
460 typedef std::iterator_traits<_IIter1> _IIterTraits1;
461 typedef std::iterator_traits<_IIter2> _IIterTraits2;
462 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
463 typedef typename _IIterTraits1::iterator_category
465 typedef typename _IIterTraits2::iterator_category
467 typedef typename _OIterTraits::iterator_category _OIterCategory;
469 return __set_union_switch(
470 __begin1, __end1, __begin2, __end2, __out, __pred,
471 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
475 template<
typename _IIter1,
typename _IIter2,
476 typename _OutputIterator>
477 inline _OutputIterator
478 set_intersection(_IIter1 __begin1, _IIter1 __end1,
479 _IIter2 __begin2, _IIter2 __end2,
481 {
return _GLIBCXX_STD_A::set_intersection(__begin1, __end1,
482 __begin2, __end2, __out); }
485 template<
typename _IIter1,
typename _IIter2,
486 typename _OutputIterator,
typename _Predicate>
487 inline _OutputIterator
488 set_intersection(_IIter1 __begin1, _IIter1 __end1,
489 _IIter2 __begin2, _IIter2 __end2,
490 _OutputIterator __out, _Predicate __pred,
492 {
return _GLIBCXX_STD_A::set_intersection(
493 __begin1, __end1, __begin2, __end2, __out, __pred); }
496 template<
typename _IIter1,
typename _IIter2,
497 typename _Predicate,
typename _OutputIterator,
498 typename _IteratorTag1,
typename _IteratorTag2,
499 typename _IteratorTag3>
500 inline _OutputIterator
501 __set_intersection_switch(_IIter1 __begin1, _IIter1 __end1,
502 _IIter2 __begin2, _IIter2 __end2,
503 _OutputIterator __result, _Predicate __pred,
504 _IteratorTag1, _IteratorTag2, _IteratorTag3)
505 {
return _GLIBCXX_STD_A::set_intersection(__begin1, __end1, __begin2,
506 __end2, __result, __pred); }
509 template<
typename _RAIter1,
typename _RAIter2,
510 typename _Output_RAIter,
typename _Predicate>
512 __set_intersection_switch(_RAIter1 __begin1,
516 _Output_RAIter __result,
523 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
525 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
527 return __gnu_parallel::__parallel_set_intersection(
528 __begin1, __end1, __begin2, __end2, __result, __pred);
530 return _GLIBCXX_STD_A::set_intersection(
531 __begin1, __end1, __begin2, __end2, __result, __pred);
535 template<
typename _IIter1,
typename _IIter2,
536 typename _OutputIterator>
537 inline _OutputIterator
538 set_intersection(_IIter1 __begin1, _IIter1 __end1,
539 _IIter2 __begin2, _IIter2 __end2,
540 _OutputIterator __out)
542 typedef std::iterator_traits<_IIter1> _IIterTraits1;
543 typedef std::iterator_traits<_IIter2> _IIterTraits2;
544 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
545 typedef typename _IIterTraits1::iterator_category
547 typedef typename _IIterTraits2::iterator_category
549 typedef typename _OIterTraits::iterator_category _OIterCategory;
550 typedef typename _IIterTraits1::value_type _ValueType1;
551 typedef typename _IIterTraits2::value_type _ValueType2;
553 return __set_intersection_switch(
554 __begin1, __end1, __begin2, __end2, __out,
556 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
559 template<
typename _IIter1,
typename _IIter2,
560 typename _OutputIterator,
typename _Predicate>
561 inline _OutputIterator
562 set_intersection(_IIter1 __begin1, _IIter1 __end1,
563 _IIter2 __begin2, _IIter2 __end2,
564 _OutputIterator __out, _Predicate __pred)
566 typedef std::iterator_traits<_IIter1> _IIterTraits1;
567 typedef std::iterator_traits<_IIter2> _IIterTraits2;
568 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
569 typedef typename _IIterTraits1::iterator_category
571 typedef typename _IIterTraits2::iterator_category
573 typedef typename _OIterTraits::iterator_category _OIterCategory;
575 return __set_intersection_switch(
576 __begin1, __end1, __begin2, __end2, __out, __pred,
577 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
581 template<
typename _IIter1,
typename _IIter2,
582 typename _OutputIterator>
583 inline _OutputIterator
584 set_symmetric_difference(_IIter1 __begin1, _IIter1 __end1,
585 _IIter2 __begin2, _IIter2 __end2,
586 _OutputIterator __out,
588 {
return _GLIBCXX_STD_A::set_symmetric_difference(
589 __begin1, __end1, __begin2, __end2, __out); }
592 template<
typename _IIter1,
typename _IIter2,
593 typename _OutputIterator,
typename _Predicate>
594 inline _OutputIterator
595 set_symmetric_difference(_IIter1 __begin1, _IIter1 __end1,
596 _IIter2 __begin2, _IIter2 __end2,
597 _OutputIterator __out, _Predicate __pred,
599 {
return _GLIBCXX_STD_A::set_symmetric_difference(
600 __begin1, __end1, __begin2, __end2, __out, __pred); }
603 template<
typename _IIter1,
typename _IIter2,
604 typename _Predicate,
typename _OutputIterator,
605 typename _IteratorTag1,
typename _IteratorTag2,
606 typename _IteratorTag3>
607 inline _OutputIterator
608 __set_symmetric_difference_switch(
609 _IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2, _IIter2 __end2,
610 _OutputIterator __result, _Predicate __pred,
611 _IteratorTag1, _IteratorTag2, _IteratorTag3)
612 {
return _GLIBCXX_STD_A::set_symmetric_difference(
613 __begin1, __end1, __begin2, __end2, __result, __pred); }
616 template<
typename _RAIter1,
typename _RAIter2,
617 typename _Output_RAIter,
typename _Predicate>
619 __set_symmetric_difference_switch(_RAIter1 __begin1,
623 _Output_RAIter __result,
630 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
632 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
634 return __gnu_parallel::__parallel_set_symmetric_difference(
635 __begin1, __end1, __begin2, __end2, __result, __pred);
637 return _GLIBCXX_STD_A::set_symmetric_difference(
638 __begin1, __end1, __begin2, __end2, __result, __pred);
642 template<
typename _IIter1,
typename _IIter2,
643 typename _OutputIterator>
644 inline _OutputIterator
645 set_symmetric_difference(_IIter1 __begin1, _IIter1 __end1,
646 _IIter2 __begin2, _IIter2 __end2,
647 _OutputIterator __out)
649 typedef std::iterator_traits<_IIter1> _IIterTraits1;
650 typedef std::iterator_traits<_IIter2> _IIterTraits2;
651 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
652 typedef typename _IIterTraits1::iterator_category
654 typedef typename _IIterTraits2::iterator_category
656 typedef typename _OIterTraits::iterator_category _OIterCategory;
657 typedef typename _IIterTraits1::value_type _ValueType1;
658 typedef typename _IIterTraits2::value_type _ValueType2;
660 return __set_symmetric_difference_switch(
661 __begin1, __end1, __begin2, __end2, __out,
663 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
667 template<
typename _IIter1,
typename _IIter2,
668 typename _OutputIterator,
typename _Predicate>
669 inline _OutputIterator
670 set_symmetric_difference(_IIter1 __begin1, _IIter1 __end1,
671 _IIter2 __begin2, _IIter2 __end2,
672 _OutputIterator __out, _Predicate __pred)
674 typedef std::iterator_traits<_IIter1> _IIterTraits1;
675 typedef std::iterator_traits<_IIter2> _IIterTraits2;
676 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
677 typedef typename _IIterTraits1::iterator_category
679 typedef typename _IIterTraits2::iterator_category
681 typedef typename _OIterTraits::iterator_category _OIterCategory;
683 return __set_symmetric_difference_switch(
684 __begin1, __end1, __begin2, __end2, __out, __pred,
685 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
689 template<
typename _IIter1,
typename _IIter2,
690 typename _OutputIterator>
691 inline _OutputIterator
692 set_difference(_IIter1 __begin1, _IIter1 __end1,
693 _IIter2 __begin2, _IIter2 __end2,
695 {
return _GLIBCXX_STD_A::set_difference(
696 __begin1,__end1, __begin2, __end2, __out); }
699 template<
typename _IIter1,
typename _IIter2,
700 typename _OutputIterator,
typename _Predicate>
701 inline _OutputIterator
702 set_difference(_IIter1 __begin1, _IIter1 __end1,
703 _IIter2 __begin2, _IIter2 __end2,
704 _OutputIterator __out, _Predicate __pred,
706 {
return _GLIBCXX_STD_A::set_difference(__begin1, __end1,
707 __begin2, __end2, __out, __pred); }
710 template<
typename _IIter1,
typename _IIter2,
typename _Predicate,
711 typename _OutputIterator,
typename _IteratorTag1,
712 typename _IteratorTag2,
typename _IteratorTag3>
713 inline _OutputIterator
714 __set_difference_switch(_IIter1 __begin1, _IIter1 __end1,
715 _IIter2 __begin2, _IIter2 __end2,
716 _OutputIterator __result, _Predicate __pred,
717 _IteratorTag1, _IteratorTag2, _IteratorTag3)
718 {
return _GLIBCXX_STD_A::set_difference(
719 __begin1, __end1, __begin2, __end2, __result, __pred); }
722 template<
typename _RAIter1,
typename _RAIter2,
723 typename _Output_RAIter,
typename _Predicate>
725 __set_difference_switch(_RAIter1 __begin1,
729 _Output_RAIter __result, _Predicate __pred,
735 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
737 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
739 return __gnu_parallel::__parallel_set_difference(
740 __begin1, __end1, __begin2, __end2, __result, __pred);
742 return _GLIBCXX_STD_A::set_difference(
743 __begin1, __end1, __begin2, __end2, __result, __pred);
747 template<
typename _IIter1,
typename _IIter2,
748 typename _OutputIterator>
749 inline _OutputIterator
750 set_difference(_IIter1 __begin1, _IIter1 __end1,
751 _IIter2 __begin2, _IIter2 __end2,
752 _OutputIterator __out)
754 typedef std::iterator_traits<_IIter1> _IIterTraits1;
755 typedef std::iterator_traits<_IIter2> _IIterTraits2;
756 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
757 typedef typename _IIterTraits1::iterator_category
759 typedef typename _IIterTraits2::iterator_category
761 typedef typename _OIterTraits::iterator_category _OIterCategory;
762 typedef typename _IIterTraits1::value_type _ValueType1;
763 typedef typename _IIterTraits2::value_type _ValueType2;
765 return __set_difference_switch(
766 __begin1, __end1, __begin2, __end2, __out,
768 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
772 template<
typename _IIter1,
typename _IIter2,
773 typename _OutputIterator,
typename _Predicate>
774 inline _OutputIterator
775 set_difference(_IIter1 __begin1, _IIter1 __end1,
776 _IIter2 __begin2, _IIter2 __end2,
777 _OutputIterator __out, _Predicate __pred)
779 typedef std::iterator_traits<_IIter1> _IIterTraits1;
780 typedef std::iterator_traits<_IIter2> _IIterTraits2;
781 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
782 typedef typename _IIterTraits1::iterator_category
784 typedef typename _IIterTraits2::iterator_category
786 typedef typename _OIterTraits::iterator_category _OIterCategory;
788 return __set_difference_switch(
789 __begin1, __end1, __begin2, __end2, __out, __pred,
790 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
794 template<
typename _FIterator>
796 adjacent_find(_FIterator __begin, _FIterator __end,
798 {
return _GLIBCXX_STD_A::adjacent_find(__begin, __end); }
801 template<
typename _FIterator,
typename _BinaryPredicate>
803 adjacent_find(_FIterator __begin, _FIterator __end,
804 _BinaryPredicate __binary_pred,
806 {
return _GLIBCXX_STD_A::adjacent_find(__begin, __end, __binary_pred); }
809 template<
typename _RAIter>
811 __adjacent_find_switch(_RAIter __begin, _RAIter __end,
814 typedef iterator_traits<_RAIter> _TraitsType;
815 typedef typename _TraitsType::value_type _ValueType;
824 if (__spot == (__end - 1))
834 template<
typename _FIterator,
typename _IteratorTag>
836 __adjacent_find_switch(_FIterator __begin, _FIterator __end,
841 template<
typename _FIterator>
843 adjacent_find(_FIterator __begin, _FIterator __end)
845 typedef iterator_traits<_FIterator> _TraitsType;
846 typedef typename _TraitsType::iterator_category _IteratorCategory;
847 return __adjacent_find_switch(__begin, __end, _IteratorCategory());
851 template<
typename _FIterator,
typename _BinaryPredicate,
852 typename _IteratorTag>
854 __adjacent_find_switch(_FIterator __begin, _FIterator __end,
855 _BinaryPredicate __pred, _IteratorTag)
856 {
return adjacent_find(__begin, __end, __pred,
860 template<
typename _RAIter,
typename _BinaryPredicate>
862 __adjacent_find_switch(_RAIter __begin, _RAIter __end,
868 __adjacent_find_selector()).first;
870 return adjacent_find(__begin, __end, __pred,
875 template<
typename _FIterator,
typename _BinaryPredicate>
877 adjacent_find(_FIterator __begin, _FIterator __end,
878 _BinaryPredicate __pred)
880 typedef iterator_traits<_FIterator> _TraitsType;
881 typedef typename _TraitsType::iterator_category _IteratorCategory;
882 return __adjacent_find_switch(__begin, __end, __pred,
883 _IteratorCategory());
887 template<
typename _IIter,
typename _Tp>
888 inline typename iterator_traits<_IIter>::difference_type
889 count(_IIter __begin, _IIter __end,
const _Tp& __value,
891 {
return _GLIBCXX_STD_A::count(__begin, __end, __value); }
894 template<
typename _RAIter,
typename _Tp>
895 typename iterator_traits<_RAIter>::difference_type
896 __count_switch(_RAIter __begin, _RAIter __end,
900 typedef iterator_traits<_RAIter> _TraitsType;
901 typedef typename _TraitsType::value_type _ValueType;
902 typedef typename _TraitsType::difference_type _DifferenceType;
906 static_cast<_SequenceIndex>(__end - __begin)
908 && __gnu_parallel::__is_parallel(__parallelism_tag)))
912 _DifferenceType __res = 0;
915 __begin, __end, __value, __functionality,
921 return count(__begin, __end, __value,
926 template<
typename _IIter,
typename _Tp,
typename _IteratorTag>
927 inline typename iterator_traits<_IIter>::difference_type
928 __count_switch(_IIter __begin, _IIter __end,
const _Tp& __value,
934 template<
typename _IIter,
typename _Tp>
935 inline typename iterator_traits<_IIter>::difference_type
936 count(_IIter __begin, _IIter __end,
const _Tp& __value,
939 typedef iterator_traits<_IIter> _TraitsType;
940 typedef typename _TraitsType::iterator_category _IteratorCategory;
941 return __count_switch(__begin, __end, __value, _IteratorCategory(),
945 template<
typename _IIter,
typename _Tp>
946 inline typename iterator_traits<_IIter>::difference_type
947 count(_IIter __begin, _IIter __end,
const _Tp& __value)
949 typedef iterator_traits<_IIter> _TraitsType;
950 typedef typename _TraitsType::iterator_category _IteratorCategory;
951 return __count_switch(__begin, __end, __value, _IteratorCategory());
956 template<
typename _IIter,
typename _Predicate>
957 inline typename iterator_traits<_IIter>::difference_type
958 count_if(_IIter __begin, _IIter __end, _Predicate __pred,
960 {
return _GLIBCXX_STD_A::count_if(__begin, __end, __pred); }
963 template<
typename _RAIter,
typename _Predicate>
964 typename iterator_traits<_RAIter>::difference_type
965 __count_if_switch(_RAIter __begin, _RAIter __end,
969 typedef iterator_traits<_RAIter> _TraitsType;
970 typedef typename _TraitsType::value_type _ValueType;
971 typedef typename _TraitsType::difference_type _DifferenceType;
975 static_cast<_SequenceIndex>(__end - __begin)
977 && __gnu_parallel::__is_parallel(__parallelism_tag)))
979 _DifferenceType __res = 0;
981 __count_if_selector<_RAIter, _DifferenceType>
985 __begin, __end, __pred, __functionality,
991 return count_if(__begin, __end, __pred,
996 template<
typename _IIter,
typename _Predicate,
typename _IteratorTag>
997 inline typename iterator_traits<_IIter>::difference_type
998 __count_if_switch(_IIter __begin, _IIter __end, _Predicate __pred,
1000 {
return count_if(__begin, __end, __pred,
1004 template<
typename _IIter,
typename _Predicate>
1005 inline typename iterator_traits<_IIter>::difference_type
1006 count_if(_IIter __begin, _IIter __end, _Predicate __pred,
1009 typedef iterator_traits<_IIter> _TraitsType;
1010 typedef typename _TraitsType::iterator_category _IteratorCategory;
1011 return __count_if_switch(__begin, __end, __pred, _IteratorCategory(),
1015 template<
typename _IIter,
typename _Predicate>
1016 inline typename iterator_traits<_IIter>::difference_type
1017 count_if(_IIter __begin, _IIter __end, _Predicate __pred)
1019 typedef iterator_traits<_IIter> _TraitsType;
1020 typedef typename _TraitsType::iterator_category _IteratorCategory;
1021 return __count_if_switch(__begin, __end, __pred, _IteratorCategory());
1026 template<
typename _FIterator1,
typename _FIterator2>
1028 search(_FIterator1 __begin1, _FIterator1 __end1,
1029 _FIterator2 __begin2, _FIterator2 __end2,
1031 {
return _GLIBCXX_STD_A::search(__begin1, __end1, __begin2, __end2); }
1034 template<
typename _RAIter1,
typename _RAIter2>
1036 __search_switch(_RAIter1 __begin1, _RAIter1 __end1,
1037 _RAIter2 __begin2, _RAIter2 __end2,
1040 typedef std::iterator_traits<_RAIter1> _Iterator1Traits;
1041 typedef typename _Iterator1Traits::value_type _ValueType1;
1042 typedef std::iterator_traits<_RAIter2> _Iterator2Traits;
1043 typedef typename _Iterator2Traits::value_type _ValueType2;
1046 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
1050 __begin1, __end1, __begin2, __end2,
1053 return search(__begin1, __end1, __begin2, __end2,
1058 template<
typename _FIterator1,
typename _FIterator2,
1059 typename _IteratorTag1,
typename _IteratorTag2>
1061 __search_switch(_FIterator1 __begin1, _FIterator1 __end1,
1062 _FIterator2 __begin2, _FIterator2 __end2,
1063 _IteratorTag1, _IteratorTag2)
1064 {
return search(__begin1, __end1, __begin2, __end2,
1068 template<
typename _FIterator1,
typename _FIterator2>
1070 search(_FIterator1 __begin1, _FIterator1 __end1,
1071 _FIterator2 __begin2, _FIterator2 __end2)
1073 typedef std::iterator_traits<_FIterator1> _Iterator1Traits;
1074 typedef typename _Iterator1Traits::iterator_category _IteratorCategory1;
1075 typedef std::iterator_traits<_FIterator2> _Iterator2Traits;
1076 typedef typename _Iterator2Traits::iterator_category _IteratorCategory2;
1078 return __search_switch(__begin1, __end1, __begin2, __end2,
1079 _IteratorCategory1(), _IteratorCategory2());
1083 template<
typename _FIterator1,
typename _FIterator2,
1084 typename _BinaryPredicate>
1086 search(_FIterator1 __begin1, _FIterator1 __end1,
1087 _FIterator2 __begin2, _FIterator2 __end2,
1089 {
return _GLIBCXX_STD_A::search(
1090 __begin1, __end1, __begin2, __end2, __pred); }
1093 template<
typename _RAIter1,
typename _RAIter2,
1094 typename _BinaryPredicate>
1096 __search_switch(_RAIter1 __begin1, _RAIter1 __end1,
1097 _RAIter2 __begin2, _RAIter2 __end2,
1098 _BinaryPredicate __pred,
1102 static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
1105 __begin2, __end2, __pred);
1107 return search(__begin1, __end1, __begin2, __end2, __pred,
1112 template<
typename _FIterator1,
typename _FIterator2,
1113 typename _BinaryPredicate,
typename _IteratorTag1,
1114 typename _IteratorTag2>
1116 __search_switch(_FIterator1 __begin1, _FIterator1 __end1,
1117 _FIterator2 __begin2, _FIterator2 __end2,
1118 _BinaryPredicate __pred, _IteratorTag1, _IteratorTag2)
1119 {
return search(__begin1, __end1, __begin2, __end2, __pred,
1123 template<
typename _FIterator1,
typename _FIterator2,
1124 typename _BinaryPredicate>
1126 search(_FIterator1 __begin1, _FIterator1 __end1,
1127 _FIterator2 __begin2, _FIterator2 __end2,
1128 _BinaryPredicate __pred)
1130 typedef std::iterator_traits<_FIterator1> _Iterator1Traits;
1131 typedef typename _Iterator1Traits::iterator_category _IteratorCategory1;
1132 typedef std::iterator_traits<_FIterator2> _Iterator2Traits;
1133 typedef typename _Iterator2Traits::iterator_category _IteratorCategory2;
1134 return __search_switch(__begin1, __end1, __begin2, __end2, __pred,
1135 _IteratorCategory1(), _IteratorCategory2());
1139 template<
typename _FIterator,
typename _Integer,
typename _Tp>
1141 search_n(_FIterator __begin, _FIterator __end, _Integer __count,
1143 {
return _GLIBCXX_STD_A::search_n(__begin, __end, __count, __val); }
1146 template<
typename _FIterator,
typename _Integer,
typename _Tp,
1147 typename _BinaryPredicate>
1149 search_n(_FIterator __begin, _FIterator __end, _Integer __count,
1150 const _Tp& __val, _BinaryPredicate __binary_pred,
1152 {
return _GLIBCXX_STD_A::search_n(
1153 __begin, __end, __count, __val, __binary_pred); }
1156 template<
typename _FIterator,
typename _Integer,
typename _Tp>
1158 search_n(_FIterator __begin, _FIterator __end, _Integer __count,
1161 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
1162 return __gnu_parallel::search_n(__begin, __end, __count, __val,
1167 template<
typename _RAIter,
typename _Integer,
1168 typename _Tp,
typename _BinaryPredicate>
1170 __search_n_switch(_RAIter __begin, _RAIter __end, _Integer __count,
1171 const _Tp& __val, _BinaryPredicate __binary_pred,
1175 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1180 __begin, __end, __ps.
begin(), __ps.
end(), __binary_pred);
1183 return _GLIBCXX_STD_A::search_n(__begin, __end, __count, __val,
1188 template<
typename _FIterator,
typename _Integer,
typename _Tp,
1189 typename _BinaryPredicate,
typename _IteratorTag>
1191 __search_n_switch(_FIterator __begin, _FIterator __end, _Integer __count,
1192 const _Tp& __val, _BinaryPredicate __binary_pred,
1194 {
return _GLIBCXX_STD_A::search_n(__begin, __end, __count, __val,
1198 template<
typename _FIterator,
typename _Integer,
typename _Tp,
1199 typename _BinaryPredicate>
1201 search_n(_FIterator __begin, _FIterator __end, _Integer __count,
1202 const _Tp& __val, _BinaryPredicate __binary_pred)
1204 return __search_n_switch(__begin, __end, __count, __val, __binary_pred,
1205 typename std::iterator_traits<_FIterator>::
1206 iterator_category());
1211 template<
typename _IIter,
typename _OutputIterator,
1212 typename _UnaryOperation>
1213 inline _OutputIterator
1214 transform(_IIter __begin, _IIter __end, _OutputIterator __result,
1216 {
return _GLIBCXX_STD_A::transform(__begin, __end, __result, __unary_op); }
1219 template<
typename _RAIter1,
typename _RAIter2,
1220 typename _UnaryOperation>
1222 __transform1_switch(_RAIter1 __begin, _RAIter1 __end,
1223 _RAIter2 __result, _UnaryOperation __unary_op,
1228 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1230 && __gnu_parallel::__is_parallel(__parallelism_tag)))
1232 bool __dummy =
true;
1235 _ItTrip __begin_pair(__begin, __result),
1236 __end_pair(__end, __result + (__end - __begin));
1240 __begin_pair, __end_pair, __unary_op, __functionality,
1242 __dummy, __dummy, -1, __parallelism_tag);
1246 return transform(__begin, __end, __result, __unary_op,
1251 template<
typename _RAIter1,
typename _RAIter2,
1252 typename _UnaryOperation,
typename _IteratorTag1,
1253 typename _IteratorTag2>
1255 __transform1_switch(_RAIter1 __begin, _RAIter1 __end,
1256 _RAIter2 __result, _UnaryOperation __unary_op,
1257 _IteratorTag1, _IteratorTag2)
1258 {
return transform(__begin, __end, __result, __unary_op,
1262 template<
typename _IIter,
typename _OutputIterator,
1263 typename _UnaryOperation>
1264 inline _OutputIterator
1265 transform(_IIter __begin, _IIter __end, _OutputIterator __result,
1266 _UnaryOperation __unary_op,
1269 typedef std::iterator_traits<_IIter> _IIterTraits;
1270 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
1271 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
1272 typedef typename _OIterTraits::iterator_category _OIterCategory;
1274 return __transform1_switch(__begin, __end, __result, __unary_op,
1275 _IIteratorCategory(), _OIterCategory(),
1279 template<
typename _IIter,
typename _OutputIterator,
1280 typename _UnaryOperation>
1281 inline _OutputIterator
1282 transform(_IIter __begin, _IIter __end, _OutputIterator __result,
1283 _UnaryOperation __unary_op)
1285 typedef std::iterator_traits<_IIter> _IIterTraits;
1286 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
1287 typedef typename _IIterTraits::iterator_category _IIteratorCategory;
1288 typedef typename _OIterTraits::iterator_category _OIterCategory;
1290 return __transform1_switch(__begin, __end, __result, __unary_op,
1291 _IIteratorCategory(), _OIterCategory());
1296 template<
typename _IIter1,
typename _IIter2,
1297 typename _OutputIterator,
typename _BinaryOperation>
1298 inline _OutputIterator
1299 transform(_IIter1 __begin1, _IIter1 __end1,
1300 _IIter2 __begin2, _OutputIterator __result,
1302 {
return _GLIBCXX_STD_A::transform(__begin1, __end1,
1303 __begin2, __result, __binary_op); }
1306 template<
typename _RAIter1,
typename _RAIter2,
1307 typename _RAIter3,
typename _BinaryOperation>
1309 __transform2_switch(_RAIter1 __begin1, _RAIter1 __end1,
1311 _RAIter3 __result, _BinaryOperation __binary_op,
1317 (__end1 - __begin1) >=
1319 && __gnu_parallel::__is_parallel(__parallelism_tag)))
1321 bool __dummy =
true;
1325 _ItTrip __begin_triple(__begin1, __begin2, __result),
1326 __end_triple(__end1, __begin2 + (__end1 - __begin1),
1327 __result + (__end1 - __begin1));
1331 __binary_op, __functionality,
1333 __dummy, __dummy, -1,
1338 return transform(__begin1, __end1, __begin2, __result, __binary_op,
1343 template<
typename _IIter1,
typename _IIter2,
1344 typename _OutputIterator,
typename _BinaryOperation,
1345 typename _Tag1,
typename _Tag2,
typename _Tag3>
1346 inline _OutputIterator
1347 __transform2_switch(_IIter1 __begin1, _IIter1 __end1,
1348 _IIter2 __begin2, _OutputIterator __result,
1349 _BinaryOperation __binary_op, _Tag1, _Tag2, _Tag3)
1350 {
return transform(__begin1, __end1, __begin2, __result, __binary_op,
1354 template<
typename _IIter1,
typename _IIter2,
1355 typename _OutputIterator,
typename _BinaryOperation>
1356 inline _OutputIterator
1357 transform(_IIter1 __begin1, _IIter1 __end1,
1358 _IIter2 __begin2, _OutputIterator __result,
1359 _BinaryOperation __binary_op,
1362 typedef std::iterator_traits<_IIter1> _IIterTraits1;
1363 typedef typename _IIterTraits1::iterator_category
1365 typedef std::iterator_traits<_IIter2> _IIterTraits2;
1366 typedef typename _IIterTraits2::iterator_category
1368 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
1369 typedef typename _OIterTraits::iterator_category _OIterCategory;
1371 return __transform2_switch(
1372 __begin1, __end1, __begin2, __result, __binary_op,
1373 _IIterCategory1(), _IIterCategory2(), _OIterCategory(),
1377 template<
typename _IIter1,
typename _IIter2,
1378 typename _OutputIterator,
typename _BinaryOperation>
1379 inline _OutputIterator
1380 transform(_IIter1 __begin1, _IIter1 __end1,
1381 _IIter2 __begin2, _OutputIterator __result,
1382 _BinaryOperation __binary_op)
1384 typedef std::iterator_traits<_IIter1> _IIterTraits1;
1385 typedef typename _IIterTraits1::iterator_category
1387 typedef std::iterator_traits<_IIter2> _IIterTraits2;
1388 typedef typename _IIterTraits2::iterator_category
1390 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
1391 typedef typename _OIterTraits::iterator_category _OIterCategory;
1393 return __transform2_switch(
1394 __begin1, __end1, __begin2, __result, __binary_op,
1395 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
1399 template<
typename _FIterator,
typename _Tp>
1401 replace(_FIterator __begin, _FIterator __end,
const _Tp& __old_value,
1403 { _GLIBCXX_STD_A::replace(__begin, __end, __old_value, __new_value); }
1406 template<
typename _FIterator,
typename _Tp,
typename _IteratorTag>
1408 __replace_switch(_FIterator __begin, _FIterator __end,
1409 const _Tp& __old_value,
const _Tp& __new_value,
1411 { replace(__begin, __end, __old_value, __new_value,
1415 template<
typename _RAIter,
typename _Tp>
1417 __replace_switch(_RAIter __begin, _RAIter __end,
1418 const _Tp& __old_value,
const _Tp& __new_value,
1423 replace(__begin, __end, __old_value, __new_value,
1428 template<
typename _FIterator,
typename _Tp>
1430 replace(_FIterator __begin, _FIterator __end,
const _Tp& __old_value,
1431 const _Tp& __new_value,
1434 typedef iterator_traits<_FIterator> _TraitsType;
1435 typedef typename _TraitsType::iterator_category _IteratorCategory;
1436 __replace_switch(__begin, __end, __old_value, __new_value,
1437 _IteratorCategory(),
1441 template<
typename _FIterator,
typename _Tp>
1443 replace(_FIterator __begin, _FIterator __end,
const _Tp& __old_value,
1444 const _Tp& __new_value)
1446 typedef iterator_traits<_FIterator> _TraitsType;
1447 typedef typename _TraitsType::iterator_category _IteratorCategory;
1448 __replace_switch(__begin, __end, __old_value, __new_value,
1449 _IteratorCategory());
1454 template<
typename _FIterator,
typename _Predicate,
typename _Tp>
1456 replace_if(_FIterator __begin, _FIterator __end, _Predicate __pred,
1458 { _GLIBCXX_STD_A::replace_if(__begin, __end, __pred, __new_value); }
1461 template<
typename _FIterator,
typename _Predicate,
typename _Tp,
1462 typename _IteratorTag>
1464 __replace_if_switch(_FIterator __begin, _FIterator __end,
1465 _Predicate __pred,
const _Tp& __new_value, _IteratorTag)
1466 { replace_if(__begin, __end, __pred, __new_value,
1470 template<
typename _RAIter,
typename _Predicate,
typename _Tp>
1472 __replace_if_switch(_RAIter __begin, _RAIter __end,
1473 _Predicate __pred,
const _Tp& __new_value,
1478 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1480 && __gnu_parallel::__is_parallel(__parallelism_tag)))
1484 __replace_if_selector<_RAIter, _Predicate, _Tp>
1485 __functionality(__new_value);
1488 __begin, __end, __pred, __functionality,
1490 true, __dummy, -1, __parallelism_tag);
1493 replace_if(__begin, __end, __pred, __new_value,
1498 template<
typename _FIterator,
typename _Predicate,
typename _Tp>
1500 replace_if(_FIterator __begin, _FIterator __end,
1501 _Predicate __pred,
const _Tp& __new_value,
1504 typedef std::iterator_traits<_FIterator> _IteratorTraits;
1505 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1506 __replace_if_switch(__begin, __end, __pred, __new_value,
1507 _IteratorCategory(), __parallelism_tag);
1510 template<
typename _FIterator,
typename _Predicate,
typename _Tp>
1512 replace_if(_FIterator __begin, _FIterator __end,
1513 _Predicate __pred,
const _Tp& __new_value)
1515 typedef std::iterator_traits<_FIterator> _IteratorTraits;
1516 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1517 __replace_if_switch(__begin, __end, __pred, __new_value,
1518 _IteratorCategory());
1522 template<
typename _FIterator,
typename _Generator>
1524 generate(_FIterator __begin, _FIterator __end, _Generator __gen,
1526 { _GLIBCXX_STD_A::generate(__begin, __end, __gen); }
1529 template<
typename _FIterator,
typename _Generator,
typename _IteratorTag>
1531 __generate_switch(_FIterator __begin, _FIterator __end, _Generator __gen,
1536 template<
typename _RAIter,
typename _Generator>
1538 __generate_switch(_RAIter __begin, _RAIter __end,
1543 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1545 && __gnu_parallel::__is_parallel(__parallelism_tag)))
1552 __begin, __end, __gen, __functionality,
1554 true, __dummy, -1, __parallelism_tag);
1561 template<
typename _FIterator,
typename _Generator>
1563 generate(_FIterator __begin, _FIterator __end,
1566 typedef std::iterator_traits<_FIterator> _IteratorTraits;
1567 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1568 __generate_switch(__begin, __end, __gen, _IteratorCategory(),
1572 template<
typename _FIterator,
typename _Generator>
1574 generate(_FIterator __begin, _FIterator __end, _Generator __gen)
1576 typedef std::iterator_traits<_FIterator> _IteratorTraits;
1577 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1578 __generate_switch(__begin, __end, __gen, _IteratorCategory());
1583 template<
typename _OutputIterator,
typename _Size,
typename _Generator>
1584 inline _OutputIterator
1585 generate_n(_OutputIterator __begin, _Size __n, _Generator __gen,
1587 {
return _GLIBCXX_STD_A::generate_n(__begin, __n, __gen); }
1590 template<
typename _OutputIterator,
typename _Size,
typename _Generator,
1591 typename _IteratorTag>
1592 inline _OutputIterator
1593 __generate_n_switch(_OutputIterator __begin, _Size __n, _Generator __gen,
1595 {
return generate_n(__begin, __n, __gen,
1599 template<
typename _RAIter,
typename _Size,
typename _Generator>
1601 __generate_n_switch(_RAIter __begin, _Size __n, _Generator __gen,
1610 template<
typename _OutputIterator,
typename _Size,
typename _Generator>
1611 inline _OutputIterator
1612 generate_n(_OutputIterator __begin, _Size __n, _Generator __gen,
1615 typedef std::iterator_traits<_OutputIterator> _IteratorTraits;
1616 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1617 return __generate_n_switch(__begin, __n, __gen, _IteratorCategory(),
1621 template<
typename _OutputIterator,
typename _Size,
typename _Generator>
1622 inline _OutputIterator
1623 generate_n(_OutputIterator __begin, _Size __n, _Generator __gen)
1625 typedef std::iterator_traits<_OutputIterator> _IteratorTraits;
1626 typedef typename _IteratorTraits::iterator_category _IteratorCategory;
1627 return __generate_n_switch(__begin, __n, __gen, _IteratorCategory());
1632 template<
typename _RAIter>
1634 random_shuffle(_RAIter __begin, _RAIter __end,
1636 { _GLIBCXX_STD_A::random_shuffle(__begin, __end); }
1639 template<
typename _RAIter,
typename _RandomNumberGenerator>
1641 random_shuffle(_RAIter __begin, _RAIter __end,
1642 _RandomNumberGenerator& __rand,
1644 { _GLIBCXX_STD_A::random_shuffle(__begin, __end, __rand); }
1648 template<
typename _MustBeInt =
int>
1652 operator()(
int __limit)
1653 {
return rand() % __limit; }
1657 template<
typename _RAIter>
1659 random_shuffle(_RAIter __begin, _RAIter __end)
1663 __gnu_parallel::random_shuffle(__begin, __end, __r);
1667 template<
typename _RAIter,
typename _RandomNumberGenerator>
1669 random_shuffle(_RAIter __begin, _RAIter __end,
1670 #
if __cplusplus >= 201103L
1671 _RandomNumberGenerator&& __rand)
1673 _RandomNumberGenerator& __rand)
1676 if (__begin == __end)
1679 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1687 template<
typename _FIterator,
typename _Predicate>
1689 partition(_FIterator __begin, _FIterator __end,
1691 {
return _GLIBCXX_STD_A::partition(__begin, __end, __pred); }
1694 template<
typename _FIterator,
typename _Predicate,
typename _IteratorTag>
1696 __partition_switch(_FIterator __begin, _FIterator __end,
1697 _Predicate __pred, _IteratorTag)
1698 {
return partition(__begin, __end, __pred,
1702 template<
typename _RAIter,
typename _Predicate>
1704 __partition_switch(_RAIter __begin, _RAIter __end,
1708 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
1711 typedef typename std::iterator_traits<_RAIter>::
1712 difference_type _DifferenceType;
1715 __gnu_parallel::__get_max_threads());
1716 return __begin + __middle;
1719 return partition(__begin, __end, __pred,
1724 template<
typename _FIterator,
typename _Predicate>
1726 partition(_FIterator __begin, _FIterator __end, _Predicate __pred)
1728 typedef iterator_traits<_FIterator> _TraitsType;
1729 typedef typename _TraitsType::iterator_category _IteratorCategory;
1730 return __partition_switch(__begin, __end, __pred, _IteratorCategory());
1736 template<
typename _RAIter>
1738 sort(_RAIter __begin, _RAIter __end,
1740 { _GLIBCXX_STD_A::sort(__begin, __end); }
1743 template<
typename _RAIter,
typename _Compare>
1745 sort(_RAIter __begin, _RAIter __end, _Compare __comp,
1747 { _GLIBCXX_STD_A::sort<_RAIter, _Compare>(__begin, __end,
1751 template<
typename _RAIter,
typename _Compare,
1754 sort(_RAIter __begin, _RAIter __end, _Compare __comp,
1757 typedef iterator_traits<_RAIter> _TraitsType;
1758 typedef typename _TraitsType::value_type _ValueType;
1760 if (__begin != __end)
1763 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) >=
1765 __gnu_parallel::__parallel_sort<false>(
1766 __begin, __end, __comp, __parallelism);
1773 template<
typename _RAIter>
1775 sort(_RAIter __begin, _RAIter __end)
1777 typedef iterator_traits<_RAIter> _TraitsType;
1778 typedef typename _TraitsType::value_type _ValueType;
1784 template<
typename _RAIter>
1786 sort(_RAIter __begin, _RAIter __end,
1789 typedef iterator_traits<_RAIter> _TraitsType;
1790 typedef typename _TraitsType::value_type _ValueType;
1795 template<
typename _RAIter>
1797 sort(_RAIter __begin, _RAIter __end,
1800 typedef iterator_traits<_RAIter> _TraitsType;
1801 typedef typename _TraitsType::value_type _ValueType;
1806 template<
typename _RAIter>
1808 sort(_RAIter __begin, _RAIter __end,
1811 typedef iterator_traits<_RAIter> _TraitsType;
1812 typedef typename _TraitsType::value_type _ValueType;
1817 template<
typename _RAIter>
1819 sort(_RAIter __begin, _RAIter __end,
1822 typedef iterator_traits<_RAIter> _TraitsType;
1823 typedef typename _TraitsType::value_type _ValueType;
1828 template<
typename _RAIter>
1830 sort(_RAIter __begin, _RAIter __end,
1833 typedef iterator_traits<_RAIter> _TraitsType;
1834 typedef typename _TraitsType::value_type _ValueType;
1839 template<
typename _RAIter>
1841 sort(_RAIter __begin, _RAIter __end,
1844 typedef iterator_traits<_RAIter> _TraitsType;
1845 typedef typename _TraitsType::value_type _ValueType;
1850 template<
typename _RAIter>
1852 sort(_RAIter __begin, _RAIter __end,
1855 typedef iterator_traits<_RAIter> _TraitsType;
1856 typedef typename _TraitsType::value_type _ValueType;
1861 template<
typename _RAIter,
typename _Compare>
1863 sort(_RAIter __begin, _RAIter __end, _Compare __comp)
1865 typedef iterator_traits<_RAIter> _TraitsType;
1866 typedef typename _TraitsType::value_type _ValueType;
1875 template<
typename _RAIter>
1877 stable_sort(_RAIter __begin, _RAIter __end,
1879 { _GLIBCXX_STD_A::stable_sort(__begin, __end); }
1882 template<
typename _RAIter,
typename _Compare>
1884 stable_sort(_RAIter __begin, _RAIter __end,
1886 { _GLIBCXX_STD_A::stable_sort<_RAIter, _Compare>(
1887 __begin, __end, __comp); }
1890 template<
typename _RAIter,
typename _Compare,
1893 stable_sort(_RAIter __begin, _RAIter __end,
1896 typedef iterator_traits<_RAIter> _TraitsType;
1897 typedef typename _TraitsType::value_type _ValueType;
1899 if (__begin != __end)
1902 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) >=
1904 __gnu_parallel::__parallel_sort<true>(
1905 __begin, __end, __comp, __parallelism);
1907 stable_sort(__begin, __end, __comp,
1913 template<
typename _RAIter>
1915 stable_sort(_RAIter __begin, _RAIter __end)
1917 typedef iterator_traits<_RAIter> _TraitsType;
1918 typedef typename _TraitsType::value_type _ValueType;
1924 template<
typename _RAIter>
1926 stable_sort(_RAIter __begin, _RAIter __end,
1929 typedef iterator_traits<_RAIter> _TraitsType;
1930 typedef typename _TraitsType::value_type _ValueType;
1935 template<
typename _RAIter>
1937 stable_sort(_RAIter __begin, _RAIter __end,
1940 typedef iterator_traits<_RAIter> _TraitsType;
1941 typedef typename _TraitsType::value_type _ValueType;
1946 template<
typename _RAIter>
1948 stable_sort(_RAIter __begin, _RAIter __end,
1951 typedef iterator_traits<_RAIter> _TraitsType;
1952 typedef typename _TraitsType::value_type _ValueType;
1957 template<
typename _RAIter>
1959 stable_sort(_RAIter __begin, _RAIter __end,
1962 typedef iterator_traits<_RAIter> _TraitsType;
1963 typedef typename _TraitsType::value_type _ValueType;
1968 template<
typename _RAIter>
1970 stable_sort(_RAIter __begin, _RAIter __end,
1973 typedef iterator_traits<_RAIter> _TraitsType;
1974 typedef typename _TraitsType::value_type _ValueType;
1979 template<
typename _RAIter,
typename _Compare>
1981 stable_sort(_RAIter __begin, _RAIter __end,
1984 typedef iterator_traits<_RAIter> _TraitsType;
1985 typedef typename _TraitsType::value_type _ValueType;
1991 template<
typename _IIter1,
typename _IIter2,
1992 typename _OutputIterator>
1993 inline _OutputIterator
1994 merge(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
1995 _IIter2 __end2, _OutputIterator __result,
1997 {
return _GLIBCXX_STD_A::merge(
1998 __begin1, __end1, __begin2, __end2, __result); }
2001 template<
typename _IIter1,
typename _IIter2,
2002 typename _OutputIterator,
typename _Compare>
2003 inline _OutputIterator
2004 merge(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
2005 _IIter2 __end2, _OutputIterator __result, _Compare __comp,
2007 {
return _GLIBCXX_STD_A::merge(
2008 __begin1, __end1, __begin2, __end2, __result, __comp); }
2011 template<
typename _IIter1,
typename _IIter2,
typename _OutputIterator,
2012 typename _Compare,
typename _IteratorTag1,
2013 typename _IteratorTag2,
typename _IteratorTag3>
2014 inline _OutputIterator
2015 __merge_switch(_IIter1 __begin1, _IIter1 __end1,
2016 _IIter2 __begin2, _IIter2 __end2,
2017 _OutputIterator __result, _Compare __comp,
2018 _IteratorTag1, _IteratorTag2, _IteratorTag3)
2019 {
return _GLIBCXX_STD_A::merge(__begin1, __end1, __begin2, __end2,
2020 __result, __comp); }
2023 template<
typename _IIter1,
typename _IIter2,
2024 typename _OutputIterator,
typename _Compare>
2026 __merge_switch(_IIter1 __begin1, _IIter1 __end1,
2027 _IIter2 __begin2, _IIter2 __end2,
2028 _OutputIterator __result, _Compare __comp,
2033 (static_cast<__gnu_parallel::_SequenceIndex>(__end1 - __begin1)
2035 || static_cast<__gnu_parallel::_SequenceIndex>(__end2 - __begin2)
2038 __begin1, __end1, __begin2, __end2, __result,
2039 (__end1 - __begin1) + (__end2 - __begin2), __comp);
2042 __begin1, __end1, __begin2, __end2, __result,
2043 (__end1 - __begin1) + (__end2 - __begin2), __comp);
2047 template<
typename _IIter1,
typename _IIter2,
2048 typename _OutputIterator,
typename _Compare>
2049 inline _OutputIterator
2050 merge(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
2051 _IIter2 __end2, _OutputIterator __result, _Compare __comp)
2053 typedef typename iterator_traits<_IIter1>::value_type _ValueType;
2055 typedef std::iterator_traits<_IIter1> _IIterTraits1;
2056 typedef std::iterator_traits<_IIter2> _IIterTraits2;
2057 typedef std::iterator_traits<_OutputIterator> _OIterTraits;
2058 typedef typename _IIterTraits1::iterator_category
2060 typedef typename _IIterTraits2::iterator_category
2062 typedef typename _OIterTraits::iterator_category _OIterCategory;
2064 return __merge_switch(
2065 __begin1, __end1, __begin2, __end2, __result, __comp,
2066 _IIterCategory1(), _IIterCategory2(), _OIterCategory());
2071 template<
typename _IIter1,
typename _IIter2,
2072 typename _OutputIterator>
2073 inline _OutputIterator
2074 merge(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
2075 _IIter2 __end2, _OutputIterator __result)
2077 typedef std::iterator_traits<_IIter1> _Iterator1Traits;
2078 typedef std::iterator_traits<_IIter2> _Iterator2Traits;
2079 typedef typename _Iterator1Traits::value_type _ValueType1;
2080 typedef typename _Iterator2Traits::value_type _ValueType2;
2082 return __gnu_parallel::merge(__begin1, __end1, __begin2, __end2,
2087 template<
typename _RAIter>
2089 nth_element(_RAIter __begin, _RAIter __nth,
2091 {
return _GLIBCXX_STD_A::nth_element(__begin, __nth, __end); }
2094 template<
typename _RAIter,
typename _Compare>
2096 nth_element(_RAIter __begin, _RAIter __nth,
2097 _RAIter __end, _Compare __comp,
2099 {
return _GLIBCXX_STD_A::nth_element(__begin, __nth, __end, __comp); }
2102 template<
typename _RAIter,
typename _Compare>
2104 nth_element(_RAIter __begin, _RAIter __nth,
2105 _RAIter __end, _Compare __comp)
2108 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
2112 nth_element(__begin, __nth, __end, __comp,
2117 template<
typename _RAIter>
2119 nth_element(_RAIter __begin, _RAIter __nth,
2122 typedef iterator_traits<_RAIter> _TraitsType;
2123 typedef typename _TraitsType::value_type _ValueType;
2124 __gnu_parallel::nth_element(__begin, __nth, __end,
2129 template<
typename _RAIter,
typename _Compare>
2131 partial_sort(_RAIter __begin, _RAIter __middle,
2132 _RAIter __end, _Compare __comp,
2134 { _GLIBCXX_STD_A::partial_sort(__begin, __middle, __end, __comp); }
2137 template<
typename _RAIter>
2139 partial_sort(_RAIter __begin, _RAIter __middle,
2141 { _GLIBCXX_STD_A::partial_sort(__begin, __middle, __end); }
2144 template<
typename _RAIter,
typename _Compare>
2146 partial_sort(_RAIter __begin, _RAIter __middle,
2147 _RAIter __end, _Compare __comp)
2150 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
2155 partial_sort(__begin, __middle, __end, __comp,
2160 template<
typename _RAIter>
2162 partial_sort(_RAIter __begin, _RAIter __middle,
2165 typedef iterator_traits<_RAIter> _TraitsType;
2166 typedef typename _TraitsType::value_type _ValueType;
2167 __gnu_parallel::partial_sort(__begin, __middle, __end,
2172 template<
typename _FIterator>
2174 max_element(_FIterator __begin, _FIterator __end,
2176 {
return _GLIBCXX_STD_A::max_element(__begin, __end); }
2179 template<
typename _FIterator,
typename _Compare>
2181 max_element(_FIterator __begin, _FIterator __end, _Compare __comp,
2183 {
return _GLIBCXX_STD_A::max_element(__begin, __end, __comp); }
2186 template<
typename _FIterator,
typename _Compare,
typename _IteratorTag>
2188 __max_element_switch(_FIterator __begin, _FIterator __end,
2189 _Compare __comp, _IteratorTag)
2190 {
return max_element(__begin, __end, __comp,
2194 template<
typename _RAIter,
typename _Compare>
2196 __max_element_switch(_RAIter __begin, _RAIter __end,
2201 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
2203 && __gnu_parallel::__is_parallel(__parallelism_tag)))
2205 _RAIter __res(__begin);
2212 __res, __res, -1, __parallelism_tag);
2216 return max_element(__begin, __end, __comp,
2221 template<
typename _FIterator>
2223 max_element(_FIterator __begin, _FIterator __end,
2226 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
2231 template<
typename _FIterator>
2233 max_element(_FIterator __begin, _FIterator __end)
2235 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
2236 return __gnu_parallel::max_element(__begin, __end,
2241 template<
typename _FIterator,
typename _Compare>
2243 max_element(_FIterator __begin, _FIterator __end, _Compare __comp,
2246 typedef iterator_traits<_FIterator> _TraitsType;
2247 typedef typename _TraitsType::iterator_category _IteratorCategory;
2248 return __max_element_switch(__begin, __end, __comp, _IteratorCategory(),
2252 template<
typename _FIterator,
typename _Compare>
2254 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());
2263 template<
typename _FIterator>
2265 min_element(_FIterator __begin, _FIterator __end,
2267 {
return _GLIBCXX_STD_A::min_element(__begin, __end); }
2270 template<
typename _FIterator,
typename _Compare>
2272 min_element(_FIterator __begin, _FIterator __end, _Compare __comp,
2274 {
return _GLIBCXX_STD_A::min_element(__begin, __end, __comp); }
2277 template<
typename _FIterator,
typename _Compare,
typename _IteratorTag>
2279 __min_element_switch(_FIterator __begin, _FIterator __end,
2280 _Compare __comp, _IteratorTag)
2281 {
return min_element(__begin, __end, __comp,
2285 template<
typename _RAIter,
typename _Compare>
2287 __min_element_switch(_RAIter __begin, _RAIter __end,
2292 static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
2294 && __gnu_parallel::__is_parallel(__parallelism_tag)))
2296 _RAIter __res(__begin);
2303 __res, __res, -1, __parallelism_tag);
2307 return min_element(__begin, __end, __comp,
2312 template<
typename _FIterator>
2314 min_element(_FIterator __begin, _FIterator __end,
2317 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
2322 template<
typename _FIterator>
2324 min_element(_FIterator __begin, _FIterator __end)
2326 typedef typename iterator_traits<_FIterator>::value_type _ValueType;
2327 return __gnu_parallel::min_element(__begin, __end,
2332 template<
typename _FIterator,
typename _Compare>
2334 min_element(_FIterator __begin, _FIterator __end, _Compare __comp,
2337 typedef iterator_traits<_FIterator> _TraitsType;
2338 typedef typename _TraitsType::iterator_category _IteratorCategory;
2339 return __min_element_switch(__begin, __end, __comp, _IteratorCategory(),
2343 template<
typename _FIterator,
typename _Compare>
2345 min_element(_FIterator __begin, _FIterator __end, _Compare __comp)
2347 typedef iterator_traits<_FIterator> _TraitsType;
2348 typedef typename _TraitsType::iterator_category _IteratorCategory;
2349 return __min_element_switch(__begin, __end, __comp, _IteratorCategory());
Functors representing different tasks to be plugged into the generic parallelization methods for emba...
Parallel implementations of set operations for random-access iterators. This file is a GNU parallel e...
void __sequential_random_shuffle(_RAIter __begin, _RAIter __end, _RandomNumberGenerator &__rng)
Sequential cache-efficient random shuffle.
A pair of iterators. The usual iterator operations are applied to both child iterators.
Parallel implementation base for std::search() and std::search_n(). This file is a GNU parallel exten...
Sequential helper functions. This file is a GNU parallel extension to the Standard C++ Library...
Similar to std::less, but allows two different types.
std::transform() __selector, one input sequence variant.
#define _GLIBCXX_PARALLEL_CONDITION(__c)
Determine at compile(?)-time if the parallel variant of an algorithm should be called.
static const _Settings & get()
Get the global settings.
Forces parallel sorting using balanced quicksort at compile time.
Reduction function doing nothing.
Parallelization of embarrassingly parallel execution by means of work-stealing.
uint64_t _SequenceIndex
Unsigned integer to index __elements. The total number of elements for each algorithm must fit into t...
Parallelization of embarrassingly parallel execution by means of an OpenMP for loop. This file is a GNU parallel extension to the Standard C++ Library.
Recommends parallel execution using the default parallel algorithm.
Forces parallel sorting using multiway mergesort with exact splitting at compile time.
_Function objects representing different tasks to be plugged into the parallel find algorithm...
Helper iterator classes for the std::transform() functions. This file is a GNU parallel extension to ...
_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.
One of the comparison functors.
Main interface for embarrassingly parallel functions.
void __parallel_nth_element(_RAIter __begin, _RAIter __nth, _RAIter __end, _Compare __comp)
Parallel implementation of std::nth_element().
Parallel implementations of std::unique_copy(). This file is a GNU parallel extension to the Standard...
Forces parallel sorting using unbalanced quicksort at compile time.
std::generate() selector.
void __parallel_random_shuffle(_RAIter __begin, _RAIter __end, _RandomNumberGenerator __rng=_RandomNumber())
Parallel random public call.
Test predicate on a single element, used for std::find() and std::find_if ().
Selector that just returns the passed iterator.
std::pair< _RAIter1, _RAIter2 > __find_template(_RAIter1 __begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred, _Selector __selector)
Parallel std::find, switch for different algorithms.
Parallel implementation base for std::find(), std::equal() and related functions. This file is a GNU ...
GNU parallel code for public use.
__RAIter1 __search_template(__RAIter1 __begin1, __RAIter1 __end1, __RAIter2 __begin2, __RAIter2 __end2, _Pred __pred)
Parallel std::search.
Test predicate on two adjacent elements.
Parallel implementation of std::partition(), std::nth_element(), and std::partial_sort(). This file is a GNU parallel extension to the Standard C++ Library.
_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.
Parallel sorting algorithm switch. This file is a GNU parallel extension to the Standard C++ Library...
Parallel implementation of std::merge(). This file is a GNU parallel extension to the Standard C++ Li...
Reduction for finding the maximum element, using a comparator.
Similar to std::equal_to, but allows two different types.
iterator end() const
End iterator.
_OutputIterator __parallel_unique_copy(_IIter __first, _IIter __last, _OutputIterator __result, _BinaryPredicate __binary_pred)
Parallel std::unique_copy(), w/__o explicit equality predicate.
One of the comparison functors.
std::for_each() selector.
Functor wrapper for std::rand().
_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...
Random-access iterators support a superset of bidirectional iterator operations.
A triple of iterators. The usual iterator operations are applied to all three child iterators...
Test predicate on several elements.
std::iterator_traits< _RAIter >::difference_type __parallel_partition(_RAIter __begin, _RAIter __end, _Predicate __pred, _ThreadIndex __num_threads)
Parallel implementation of std::partition.
One of the math functors.
Forces parallel sorting using multiway mergesort at compile time.
void __parallel_partial_sort(_RAIter __begin, _RAIter __middle, _RAIter __end, _Compare __comp)
Parallel implementation of std::partial_sort().
std::transform() __selector, two input sequences variant.
Recommends parallel execution at compile time, optionally using a user-specified number of threads...
Parallel implementation of std::random_shuffle(). This file is a GNU parallel extension to the Standa...
_It _M_finish_iterator
_Iterator on last element processed; needed for some algorithms (e. g. std::transform()).
Sequence that conceptually consists of multiple copies of the same element. The copies are not stored...
Parallelization of embarrassingly parallel execution by means of equal splitting. This file is a GNU ...
Forces sequential execution at compile time.
Parallelization of embarrassingly parallel execution by means of an OpenMP for loop with static sched...
ISO C++ entities toplevel namespace is std.
iterator begin() const
Begin iterator.
Forces parallel sorting using multiway mergesort with splitting by sampling at compile time...
Reduction for finding the maximum element, using a comparator.
_Parallelism
Run-time equivalents for the compile-time tags.
Similar to std::binder2nd, but giving the argument types explicitly.