__gnu_parallel::sequential_tag()); }
// Parallel algorithm for random access iterators.
- template<typename __RAIter, typename _Tp,
- typename _BinaryOperation>
+ template<typename __RAIter, typename _Tp, typename _BinaryOperation>
_Tp
__accumulate_switch(__RAIter __begin, __RAIter __end,
_Tp __init, _BinaryOperation __binary_op,
__my_selector;
__gnu_parallel::
__for_each_template_random_access_ed(__begin, __end,
- __gnu_parallel::_Nothing(),
- __my_selector,
- __gnu_parallel::
- __accumulate_binop_reduct
- <_BinaryOperation>(__binary_op),
- __res, __res, -1);
+ __gnu_parallel::_Nothing(),
+ __my_selector,
+ __gnu_parallel::
+ __accumulate_binop_reduct
+ <_BinaryOperation>(__binary_op),
+ __res, __res, -1);
return __res;
}
else
typedef typename _IteratorTraits::iterator_category _IteratorCategory;
return __accumulate_switch(__begin, __end, __init,
- __gnu_parallel::_Plus<_Tp, _ValueType>(),
- _IteratorCategory(), __parallelism_tag);
+ __gnu_parallel::_Plus<_Tp, _ValueType>(),
+ _IteratorCategory(), __parallelism_tag);
}
template<typename _IIter, typename _Tp>
typedef typename _IteratorTraits::iterator_category _IteratorCategory;
return __accumulate_switch(__begin, __end, __init,
- __gnu_parallel::_Plus<_Tp, _ValueType>(),
- _IteratorCategory());
+ __gnu_parallel::_Plus<_Tp, _ValueType>(),
+ _IteratorCategory());
}
template<typename _IIter, typename _Tp, typename _BinaryOperation>
typedef iterator_traits<_IIter> _IteratorTraits;
typedef typename _IteratorTraits::iterator_category _IteratorCategory;
return __accumulate_switch(__begin, __end, __init, __binary_op,
- _IteratorCategory(), __parallelism_tag);
+ _IteratorCategory(), __parallelism_tag);
}
template<typename _IIter, typename _Tp, typename _BinaryOperation>
typedef iterator_traits<_IIter> _IteratorTraits;
typedef typename _IteratorTraits::iterator_category _IteratorCategory;
return __accumulate_switch(__begin, __end, __init, __binary_op,
- _IteratorCategory());
+ _IteratorCategory());
}
typename _Tp, typename _BinaryFunction1, typename _BinaryFunction2>
_Tp
__inner_product_switch(_RAIter1 __first1,
- _RAIter1 __last1,
- _RAIter2 __first2, _Tp __init,
- _BinaryFunction1 __binary_op1,
- _BinaryFunction2 __binary_op2,
- random_access_iterator_tag,
- random_access_iterator_tag,
- __gnu_parallel::_Parallelism __parallelism_tag
- = __gnu_parallel::parallel_unbalanced)
+ _RAIter1 __last1,
+ _RAIter2 __first2, _Tp __init,
+ _BinaryFunction1 __binary_op1,
+ _BinaryFunction2 __binary_op2,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism __parallelism_tag
+ = __gnu_parallel::parallel_unbalanced)
{
if (_GLIBCXX_PARALLEL_CONDITION((__last1 - __first1)
>= __gnu_parallel::_Settings::get().
typename _IteratorTag1, typename _IteratorTag2>
inline _Tp
__inner_product_switch(_IIter1 __first1, _IIter1 __last1,
- _IIter2 __first2, _Tp __init,
- _BinaryFunction1 __binary_op1,
- _BinaryFunction2 __binary_op2,
- _IteratorTag1, _IteratorTag2)
- { return inner_product(__first1, __last1, __first2, __init,
- __binary_op1, __binary_op2,
- __gnu_parallel::sequential_tag()); }
+ _IIter2 __first2, _Tp __init,
+ _BinaryFunction1 __binary_op1,
+ _BinaryFunction2 __binary_op2,
+ _IteratorTag1, _IteratorTag2)
+ { return inner_product(__first1, __last1, __first2, __init, __binary_op1,
+ __binary_op2, __gnu_parallel::sequential_tag()); }
template<typename _IIter1, typename _IIter2, typename _Tp,
typename _BinaryFunction1, typename _BinaryFunction2>
typedef iterator_traits<_IIter2> _TraitsType2;
typedef typename _TraitsType2::iterator_category _IteratorCategory2;
- return __inner_product_switch(
- __first1, __last1, __first2, __init, __binary_op1,
- __binary_op2, _IteratorCategory1(), _IteratorCategory2(),
- __parallelism_tag);
+ return __inner_product_switch(__first1, __last1, __first2, __init,
+ __binary_op1, __binary_op2,
+ _IteratorCategory1(), _IteratorCategory2(),
+ __parallelism_tag);
}
template<typename _IIter1, typename _IIter2, typename _Tp,
typedef iterator_traits<_IIter2> _TraitsType2;
typedef typename _TraitsType2::iterator_category _IteratorCategory2;
- return __inner_product_switch(
- __first1, __last1, __first2, __init, __binary_op1, __binary_op2,
- _IteratorCategory1(), _IteratorCategory2());
+ return __inner_product_switch(__first1, __last1, __first2, __init,
+ __binary_op1, __binary_op2,
+ _IteratorCategory1(),
+ _IteratorCategory2());
}
template<typename _IIter1, typename _IIter2, typename _Tp>
// Sequential fallback.
template<typename _IIter, typename _OutputIterator,
- typename _BinaryOperation>
+ typename _BinaryOperation>
inline _OutputIterator
partial_sum(_IIter __begin, _IIter __end, _OutputIterator __result,
_BinaryOperation __bin_op, __gnu_parallel::sequential_tag)
typename _IteratorTag2>
inline _OutputIterator
__partial_sum_switch(_IIter __begin, _IIter __end,
- _OutputIterator __result, _BinaryOperation __bin_op,
- _IteratorTag1, _IteratorTag2)
+ _OutputIterator __result, _BinaryOperation __bin_op,
+ _IteratorTag1, _IteratorTag2)
{ return _GLIBCXX_STD_P::partial_sum(__begin, __end, __result, __bin_op); }
// Parallel algorithm for random access iterators.
typename _BinaryOperation>
_OutputIterator
__partial_sum_switch(_IIter __begin, _IIter __end,
- _OutputIterator __result, _BinaryOperation __bin_op,
- random_access_iterator_tag, random_access_iterator_tag)
+ _OutputIterator __result, _BinaryOperation __bin_op,
+ random_access_iterator_tag,
+ random_access_iterator_tag)
{
if (_GLIBCXX_PARALLEL_CONDITION(
static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
>= __gnu_parallel::_Settings::get().partial_sum_minimal_n))
return __gnu_parallel::__parallel_partial_sum(__begin, __end,
- __result, __bin_op);
+ __result, __bin_op);
else
return partial_sum(__begin, __end, __result, __bin_op,
__gnu_parallel::sequential_tag());
typedef typename _OTraitsType::iterator_category _OIterCategory;
return __partial_sum_switch(__begin, __end, __result, __binary_op,
- _IIteratorCategory(), _OIterCategory());
+ _IIteratorCategory(), _OIterCategory());
}
// Sequential fallback.
adjacent_difference(_IIter __begin, _IIter __end,
_OutputIterator __result, _BinaryOperation __bin_op,
__gnu_parallel::sequential_tag)
- { return _GLIBCXX_STD_P::adjacent_difference(
- __begin, __end, __result, __bin_op); }
+ { return _GLIBCXX_STD_P::adjacent_difference(__begin, __end,
+ __result, __bin_op); }
// Sequential fallback for input iterator case.
template<typename _IIter, typename _OutputIterator,
typename _BinaryOperation, typename _IteratorTag1,
typename _IteratorTag2>
inline _OutputIterator
- __adjacent_difference_switch(
- _IIter __begin, _IIter __end, _OutputIterator __result,
- _BinaryOperation __bin_op, _IteratorTag1, _IteratorTag2)
+ __adjacent_difference_switch(_IIter __begin, _IIter __end,
+ _OutputIterator __result,
+ _BinaryOperation __bin_op, _IteratorTag1,
+ _IteratorTag2)
{ return adjacent_difference(__begin, __end, __result, __bin_op,
__gnu_parallel::sequential_tag()); }
template<typename _IIter, typename _OutputIterator,
typename _BinaryOperation>
_OutputIterator
- __adjacent_difference_switch(
- _IIter __begin, _IIter __end, _OutputIterator __result,
- _BinaryOperation __bin_op,
- random_access_iterator_tag, random_access_iterator_tag,
- __gnu_parallel::_Parallelism __parallelism_tag
- = __gnu_parallel::parallel_balanced)
+ __adjacent_difference_switch(_IIter __begin, _IIter __end,
+ _OutputIterator __result,
+ _BinaryOperation __bin_op,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism
+ __parallelism_tag
+ = __gnu_parallel::parallel_balanced)
{
if (_GLIBCXX_PARALLEL_CONDITION(
static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
{
typedef iterator_traits<_IIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
- return adjacent_difference(
- __begin, __end, __result, std::minus<_ValueType>(),
- __parallelism_tag);
+ return adjacent_difference(__begin, __end, __result,
+ std::minus<_ValueType>(),
+ __parallelism_tag);
}
template<typename _IIter, typename _OutputIterator>
typedef iterator_traits<_IIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
return adjacent_difference(__begin, __end, __result,
- std::minus<_ValueType>());
+ std::minus<_ValueType>());
}
template<typename _IIter, typename _OutputIterator,
typedef iterator_traits<_OutputIterator> _OTraitsType;
typedef typename _OTraitsType::iterator_category _OIterCategory;
- return __adjacent_difference_switch(
- __begin, __end, __result, __binary_op,
- _IIteratorCategory(), _OIterCategory(), __parallelism_tag);
+ return __adjacent_difference_switch(__begin, __end, __result,
+ __binary_op,
+ _IIteratorCategory(),
+ _OIterCategory(),
+ __parallelism_tag);
}
template<typename _IIter, typename _OutputIterator,
- typename _BinaryOperation>
+ typename _BinaryOperation>
inline _OutputIterator
adjacent_difference(_IIter __begin, _IIter __end,
- _OutputIterator __result, _BinaryOperation __binary_op)
+ _OutputIterator __result, _BinaryOperation __binary_op)
{
typedef iterator_traits<_IIter> _ITraitsType;
typedef typename _ITraitsType::iterator_category _IIteratorCategory;
typedef iterator_traits<_OutputIterator> _OTraitsType;
typedef typename _OTraitsType::iterator_category _OIterCategory;
- return __adjacent_difference_switch(
- __begin, __end, __result, __binary_op,
- _IIteratorCategory(), _OIterCategory());
+ return __adjacent_difference_switch(__begin, __end, __result,
+ __binary_op,
+ _IIteratorCategory(),
+ _OIterCategory());
}
} // end namespace
} // end namespace