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>
59#ifdef PARALLEL_ALGORITHMS_SUPPORTED
60 std::execution::par_unseq,
76 template<
class InputIt,
class UnaryPredicate>
80#ifdef PARALLEL_ALGORITHMS_SUPPORTED
81 std::execution::par_unseq,
97 template<
class InputIt,
class OutputIt>
101#ifdef PARALLEL_ALGORITHMS_SUPPORTED
102 std::execution::par_unseq,
118 template<
class InputIt,
class T>
119 typename std::iterator_traits<InputIt>::difference_type
123#ifdef PARALLEL_ALGORITHMS_SUPPORTED
124 std::execution::par_unseq,
140 template<
class InputIt1,
class InputIt2>
144#ifdef PARALLEL_ALGORITHMS_SUPPORTED
145 std::execution::par_unseq,
162 template<
class InputIt1,
class InputIt2,
class BinaryPredicate>
166#ifdef PARALLEL_ALGORITHMS_SUPPORTED
167 std::execution::par_unseq,
183 template<
class ForwardIt,
class T>
187#ifdef PARALLEL_ALGORITHMS_SUPPORTED
188 std::execution::par_unseq,
205 template<
class InputIt,
class T>
209#ifdef PARALLEL_ALGORITHMS_SUPPORTED
210 std::execution::par_unseq,
225 template<
class InputIt,
class UnaryFunction>
226 void for_each(InputIt first, InputIt last, UnaryFunction
f)
229#ifdef PARALLEL_ALGORITHMS_SUPPORTED
230 std::execution::par_unseq,
245 template<
class ForwardIt>
249#ifdef PARALLEL_ALGORITHMS_SUPPORTED
250 std::execution::par_unseq,
265 template<
class ForwardIt,
class Compare>
269#ifdef PARALLEL_ALGORITHMS_SUPPORTED
270 std::execution::par_unseq,
285 template<
class ForwardIt>
289#ifdef PARALLEL_ALGORITHMS_SUPPORTED
290 std::execution::par_unseq,
305 template<
class ForwardIt,
class Compare>
309#ifdef PARALLEL_ALGORITHMS_SUPPORTED
310 std::execution::par_unseq,
324 template<
class ForwardIt>
328#ifdef PARALLEL_ALGORITHMS_SUPPORTED
329 std::execution::par_unseq,
344 template<
class ForwardIt,
class Compare>
348#ifdef PARALLEL_ALGORITHMS_SUPPORTED
349 std::execution::par_unseq,
364 template<
class ForwardIt>
368#ifdef PARALLEL_ALGORITHMS_SUPPORTED
369 std::execution::par_unseq,
384 template<
class ForwardIt,
class Compare>
388#ifdef PARALLEL_ALGORITHMS_SUPPORTED
389 std::execution::par_unseq,
405 template<
class InputIt,
class UnaryPredicate>
409#ifdef PARALLEL_ALGORITHMS_SUPPORTED
410 std::execution::par_unseq,
425 template<
class RandomIt>
429#ifdef PARALLEL_ALGORITHMS_SUPPORTED
430 std::execution::par_unseq,
446 template<
class RandomIt,
class Compare>
450#ifdef PARALLEL_ALGORITHMS_SUPPORTED
451 std::execution::par_unseq,
468 template<
class ForwardIt,
class T>
472#ifdef PARALLEL_ALGORITHMS_SUPPORTED
473 std::execution::par_unseq,
488 template<
class B
idirIt>
492#ifdef PARALLEL_ALGORITHMS_SUPPORTED
493 std::execution::par_unseq,
507 template<
class ForwardIt>
511#ifdef PARALLEL_ALGORITHMS_SUPPORTED
512 std::execution::par_unseq,
530 template<
class InputIt1,
class InputIt2,
class OutputIt>
531 OutputIt
set_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination)
534#ifdef PARALLEL_ALGORITHMS_SUPPORTED
535 std::execution::par_unseq,
556 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
561 OutputIt destination,
565#ifdef PARALLEL_ALGORITHMS_SUPPORTED
566 std::execution::par_unseq,
587 template<
class InputIt1,
class InputIt2,
class OutputIt>
588 OutputIt
set_intersection(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination)
592#ifdef PARALLEL_ALGORITHMS_SUPPORTED
593 std::execution::par_unseq,
614 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
619 OutputIt destination,
623#ifdef PARALLEL_ALGORITHMS_SUPPORTED
624 std::execution::par_unseq,
645 template<
class InputIt1,
class InputIt2,
class OutputIt>
646 OutputIt
set_union(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination)
650#ifdef PARALLEL_ALGORITHMS_SUPPORTED
651 std::execution::par_unseq,
672 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
674 set_union(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp)
678#ifdef PARALLEL_ALGORITHMS_SUPPORTED
679 std::execution::par_unseq,
696 template<
class RandomIt>
700#ifdef PARALLEL_ALGORITHMS_SUPPORTED
701 std::execution::par_unseq,
715 template<
class RandomIt,
class Compare>
719#ifdef PARALLEL_ALGORITHMS_SUPPORTED
720 std::execution::par_unseq,
734 template<
class RandomIt>
738#ifdef PARALLEL_ALGORITHMS_SUPPORTED
739 std::execution::par_unseq,
753 template<
class RandomIt,
class Compare>
757#ifdef PARALLEL_ALGORITHMS_SUPPORTED
758 std::execution::par_unseq,
775 template<
class InputIt,
class OutputIt,
class UnaryOperation>
776 OutputIt
transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
779#ifdef PARALLEL_ALGORITHMS_SUPPORTED
780 std::execution::par_unseq,
799 template<
class InputIt1,
class InputIt2,
class OutputIt,
class BinaryOperation>
801 transform(InputIt1 first1, InputIt1 last1, InputIt2 first2, OutputIt destination, BinaryOperation unaryFunction)
804#ifdef PARALLEL_ALGORITHMS_SUPPORTED
805 std::execution::par_unseq,
824 template<
class ForwardIt1,
class ForwardIt2,
class T>
828#ifdef PARALLEL_ALGORITHMS_SUPPORTED
829 std::execution::par_unseq,
847 template<
class ForwardIt1,
class ForwardIt2,
class T>
849 transform_reduce(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2,
const std::complex<T>& init)
852#ifdef PARALLEL_ALGORITHMS_SUPPORTED
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>
876#ifdef PARALLEL_ALGORITHMS_SUPPORTED
877 std::execution::par_unseq,
894 template<
class InputIt,
class OutputIt,
class BinaryPredicate>
895 constexpr OutputIt
unique_copy(InputIt first, InputIt last, OutputIt destination, BinaryPredicate binaryFunction)
899#ifdef PARALLEL_ALGORITHMS_SUPPORTED
900 std::execution::par_unseq,
#define CONDITIONAL_NO_EXCEPT
Definition: StlAlgorithms.hpp:41
dtype f(GeneratorType &generator, dtype inDofN, dtype inDofD)
Definition: f.hpp:56
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
bool is_sorted(ForwardIt first, ForwardIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:266
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, Compare comp) noexcept
Definition: StlAlgorithms.hpp:306
ForwardIt max_element(ForwardIt first, ForwardIt last) noexcept
Definition: StlAlgorithms.hpp:286
OutputIt set_union(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp) noexcept
Definition: StlAlgorithms.hpp:674
void stable_sort(RandomIt first, RandomIt last) noexcept
Definition: StlAlgorithms.hpp:735
void sort(RandomIt first, RandomIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:716
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 equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPredicate p) noexcept
Definition: StlAlgorithms.hpp:163
bool all_of(InputIt first, InputIt last, UnaryPredicate p) noexcept
Definition: StlAlgorithms.hpp:56
std::pair< ForwardIt, ForwardIt > minmax_element(ForwardIt first, ForwardIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:385
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
void stable_sort(RandomIt first, RandomIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:754
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, Compare comp) noexcept
Definition: StlAlgorithms.hpp:557
OutputIt set_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination)
Definition: StlAlgorithms.hpp:531
void nth_element(RandomIt first, RandomIt nth, RandomIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:447
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
std::complex< T > transform_reduce(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2, const std::complex< T > &init)
Definition: StlAlgorithms.hpp:849
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
ForwardIt min_element(ForwardIt first, ForwardIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:345
void rotate(ForwardIt first, ForwardIt firstN, ForwardIt last) noexcept
Definition: StlAlgorithms.hpp:508
OutputIt set_intersection(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp) noexcept
Definition: StlAlgorithms.hpp:615
OutputIt copy(InputIt first, InputIt last, OutputIt destination) noexcept
Definition: StlAlgorithms.hpp:98
constexpr OutputIt unique_copy(InputIt first, InputIt last, OutputIt destination, BinaryPredicate binaryFunction) noexcept
Definition: StlAlgorithms.hpp:895
OutputIt transform(InputIt1 first1, InputIt1 last1, InputIt2 first2, OutputIt destination, BinaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:801
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