36#if defined(__cpp_lib_parallel_algorithm) && defined(NUMCPP_USE_MULTITHREAD)
37#define PARALLEL_ALGORITHMS_SUPPORTED
38#define CONDITIONAL_NO_EXCEPT
41#define CONDITIONAL_NO_EXCEPT noexcept
55 template<
class InputIt,
class UnaryPredicate>
60 std::execution::par_unseq,
76 template<
class InputIt,
class UnaryPredicate>
81 std::execution::par_unseq,
97 template<
class InputIt,
class OutputIt>
102 std::execution::par_unseq,
118 template<
class InputIt,
class T>
119 typename std::iterator_traits<InputIt>::difference_type
124 std::execution::par_unseq,
140 template<
class InputIt1,
class InputIt2>
145 std::execution::par_unseq,
162 template<
class InputIt1,
class InputIt2,
class BinaryPredicate>
167 std::execution::par_unseq,
183 template<
class ForwardIt,
class T>
188 std::execution::par_unseq,
205 template<
class InputIt,
class T>
210 std::execution::par_unseq,
225 template<
class InputIt,
class UnaryFunction>
230 std::execution::par_unseq,
245 template<
class ForwardIt>
248 return std::is_sorted(
250 std::execution::par_unseq,
265 template<
class ForwardIt,
class Compare>
268 return std::is_sorted(
270 std::execution::par_unseq,
285 template<
class ForwardIt>
288 return std::max_element(
290 std::execution::par_unseq,
305 template<
class ForwardIt,
class Compare>
308 return std::max_element(
310 std::execution::par_unseq,
324 template<
class ForwardIt>
327 return std::min_element(
329 std::execution::par_unseq,
344 template<
class ForwardIt,
class Compare>
347 return std::min_element(
349 std::execution::par_unseq,
364 template<
class ForwardIt>
367 return std::minmax_element(
369 std::execution::par_unseq,
384 template<
class ForwardIt,
class Compare>
387 return std::minmax_element(
389 std::execution::par_unseq,
405 template<
class InputIt,
class UnaryPredicate>
410 std::execution::par_unseq,
425 template<
class RandomIt>
430 std::execution::par_unseq,
446 template<
class RandomIt,
class Compare>
451 std::execution::par_unseq,
468 template<
class ForwardIt,
class T>
473 std::execution::par_unseq,
488 template<
class B
idirIt>
493 std::execution::par_unseq,
507 template<
class ForwardIt>
512 std::execution::par_unseq,
530 template<
class InputIt1,
class InputIt2,
class OutputIt>
533 return std::set_difference(
535 std::execution::par_unseq,
556 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
564 return std::set_difference(
566 std::execution::par_unseq,
587 template<
class InputIt1,
class InputIt2,
class OutputIt>
591 return std::set_intersection(
593 std::execution::par_unseq,
614 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
622 return std::set_intersection(
624 std::execution::par_unseq,
645 template<
class InputIt1,
class InputIt2,
class OutputIt>
649 return std::set_union(
651 std::execution::par_unseq,
672 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
677 return std::set_union(
679 std::execution::par_unseq,
696 template<
class RandomIt>
701 std::execution::par_unseq,
715 template<
class RandomIt,
class Compare>
720 std::execution::par_unseq,
734 template<
class RandomIt>
739 std::execution::par_unseq,
753 template<
class RandomIt,
class Compare>
758 std::execution::par_unseq,
775 template<
class InputIt,
class OutputIt,
class UnaryOperation>
778 return std::transform(
780 std::execution::par_unseq,
799 template<
class InputIt1,
class InputIt2,
class OutputIt,
class BinaryOperation>
803 return std::transform(
805 std::execution::par_unseq,
824 template<
class ForwardIt1,
class ForwardIt2,
class T>
827 return std::transform_reduce(
829 std::execution::par_unseq,
847 template<
class ForwardIt1,
class ForwardIt2,
class T>
851 return std::transform_reduce(
853 std::execution::par_unseq,
859 std::plus<std::complex<T>>(),
860 [](
const auto a,
const auto& b) {
return std::complex<T>(a * b); });
872 template<
class InputIt,
class OutputIt>
875 return std::unique_copy(
877 std::execution::par_unseq,
894 template<
class InputIt,
class OutputIt,
class BinaryPredicate>
898 return std::unique_copy(
900 std::execution::par_unseq,
#define CONDITIONAL_NO_EXCEPT
Definition StlAlgorithms.hpp:41
Definition StlAlgorithms.hpp:45
bool any_of(InputIt first, InputIt last, UnaryPredicate p) noexcept
Definition StlAlgorithms.hpp:77
std::iterator_traits< InputIt >::difference_type count(InputIt first, InputIt last, const T &value) noexcept
Definition StlAlgorithms.hpp:120
T transform_reduce(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2, T init)
Definition StlAlgorithms.hpp:825
void sort(RandomIt first, RandomIt last) noexcept
Definition StlAlgorithms.hpp:697
OutputIt set_union(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination) noexcept
Definition StlAlgorithms.hpp:646
bool none_of(InputIt first, InputIt last, UnaryPredicate p) noexcept
Definition StlAlgorithms.hpp:406
ForwardIt max_element(ForwardIt first, ForwardIt last) noexcept
Definition StlAlgorithms.hpp:286
void stable_sort(RandomIt first, RandomIt last) noexcept
Definition StlAlgorithms.hpp:735
void reverse(BidirIt first, BidirIt last) noexcept
Definition StlAlgorithms.hpp:489
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition StlAlgorithms.hpp:776
bool all_of(InputIt first, InputIt last, UnaryPredicate p) noexcept
Definition StlAlgorithms.hpp:56
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition StlAlgorithms.hpp:226
InputIt find(InputIt first, InputIt last, const T &value) noexcept
Definition StlAlgorithms.hpp:206
constexpr OutputIt unique_copy(InputIt first, InputIt last, OutputIt destination) noexcept
Definition StlAlgorithms.hpp:873
OutputIt set_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination)
Definition StlAlgorithms.hpp:531
void replace(ForwardIt first, ForwardIt last, const T &oldValue, const T &newValue) noexcept
Definition StlAlgorithms.hpp:469
OutputIt set_intersection(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination) noexcept
Definition StlAlgorithms.hpp:588
bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2) noexcept
Definition StlAlgorithms.hpp:141
std::pair< ForwardIt, ForwardIt > minmax_element(ForwardIt first, ForwardIt last) noexcept
Definition StlAlgorithms.hpp:365
bool is_sorted(ForwardIt first, ForwardIt last) noexcept
Definition StlAlgorithms.hpp:246
void rotate(ForwardIt first, ForwardIt firstN, ForwardIt last) noexcept
Definition StlAlgorithms.hpp:508
OutputIt copy(InputIt first, InputIt last, OutputIt destination) noexcept
Definition StlAlgorithms.hpp:98
void nth_element(RandomIt first, RandomIt nth, RandomIt last) noexcept
Definition StlAlgorithms.hpp:426
ForwardIt min_element(ForwardIt first, ForwardIt last) noexcept
Definition StlAlgorithms.hpp:325
void fill(ForwardIt first, ForwardIt last, const T &value) noexcept
Definition StlAlgorithms.hpp:184
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59