35 #if defined(__cpp_lib_execution) && defined(__cpp_lib_parallel_algorithm) && defined(NUMCPP_USE_MULTITHREAD)
36 #define PARALLEL_ALGORITHMS_SUPPORTED
37 #define CONDITIONAL_NO_EXCEPT
40 #define CONDITIONAL_NO_EXCEPT noexcept
45 namespace stl_algorithms
56 template<
class InputIt,
class UnaryPredicate>
60 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
61 std::execution::par_unseq,
75 template<
class InputIt,
class UnaryPredicate>
79 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
80 std::execution::par_unseq,
94 template<
class InputIt,
class OutputIt>
98 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
99 std::execution::par_unseq,
101 first, last, destination);
113 template<
class InputIt,
class T>
114 typename std::iterator_traits<InputIt>::difference_type
118 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
119 std::execution::par_unseq,
134 template<
class InputIt1,
class InputIt2>
138 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
139 std::execution::par_unseq,
141 first1, last1, first2);
154 template<
class InputIt1,
class InputIt2,
class BinaryPredicate>
155 bool equal(InputIt1 first1, InputIt1 last1,
159 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
160 std::execution::par_unseq,
162 first1, last1, first2, p);
173 template<
class ForwardIt,
class T>
177 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
178 std::execution::par_unseq,
194 template<
class InputIt,
class T>
198 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
199 std::execution::par_unseq,
212 template<
class InputIt,
class UnaryFunction>
213 void for_each(InputIt first, InputIt last, UnaryFunction
f)
216 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
217 std::execution::par_unseq,
230 template<
class ForwardIt>
234 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
235 std::execution::par_unseq,
249 template<
class ForwardIt,
class Compare>
253 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
254 std::execution::par_unseq,
267 template<
class ForwardIt>
271 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
272 std::execution::par_unseq,
286 template<
class ForwardIt,
class Compare>
290 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
291 std::execution::par_unseq,
303 template<
class ForwardIt>
307 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
308 std::execution::par_unseq,
322 template<
class ForwardIt,
class Compare>
326 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
327 std::execution::par_unseq,
340 template<
class ForwardIt>
344 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
345 std::execution::par_unseq,
359 template<
class ForwardIt,
class Compare>
363 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
364 std::execution::par_unseq,
378 template<
class InputIt,
class UnaryPredicate>
382 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
383 std::execution::par_unseq,
396 template<
class RandomIt>
400 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
401 std::execution::par_unseq,
415 template<
class RandomIt,
class Compare>
419 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
420 std::execution::par_unseq,
422 first, nth, last, comp);
434 template<
class ForwardIt,
class T>
439 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
440 std::execution::par_unseq,
442 first, last, oldValue, newValue);
452 template<
class B
idirIt>
456 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
457 std::execution::par_unseq,
470 template<
class ForwardIt>
474 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
475 std::execution::par_unseq,
477 first, firstN, last);
491 template<
class InputIt1,
class InputIt2,
class OutputIt>
493 InputIt2 first2, InputIt2 last2,
494 OutputIt destination)
497 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
498 std::execution::par_unseq,
500 first1, last1, first2, last2, destination);
515 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
517 InputIt2 first2, InputIt2 last2,
521 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
522 std::execution::par_unseq,
524 first1, last1, first2, last2, destination, comp);
538 template<
class InputIt1,
class InputIt2,
class OutputIt>
540 InputIt2 first2, InputIt2 last2,
544 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
545 std::execution::par_unseq,
547 first1, last1, first2, last2, destination);
562 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
564 InputIt2 first2, InputIt2 last2,
568 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
569 std::execution::par_unseq,
571 first1, last1, first2, last2, destination, comp);
585 template<
class InputIt1,
class InputIt2,
class OutputIt>
587 InputIt2 first2, InputIt2 last2,
591 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
592 std::execution::par_unseq,
594 first1, last1, first2, last2, destination);
609 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
611 InputIt2 first2, InputIt2 last2,
615 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
616 std::execution::par_unseq,
618 first1, last1, first2, last2, destination, comp);
628 template<
class RandomIt>
632 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
633 std::execution::par_unseq,
646 template<
class RandomIt,
class Compare>
650 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
651 std::execution::par_unseq,
663 template<
class RandomIt>
667 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
668 std::execution::par_unseq,
681 template<
class RandomIt,
class Compare>
685 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
686 std::execution::par_unseq,
701 template<
class InputIt,
class OutputIt,
class UnaryOperation>
702 OutputIt
transform(InputIt first, InputIt last, OutputIt destination,
703 UnaryOperation unaryFunction)
706 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
707 std::execution::par_unseq,
709 first, last, destination, unaryFunction);
723 template<
class InputIt1,
class InputIt2,
class OutputIt,
class BinaryOperation>
724 OutputIt
transform(InputIt1 first1, InputIt1 last1, InputIt2 first2,
725 OutputIt destination, BinaryOperation unaryFunction)
728 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
729 std::execution::par_unseq,
731 first1, last1, first2, destination, unaryFunction);
743 template<
class InputIt,
class OutputIt>
748 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
749 std::execution::par_unseq,
751 first, last, destination);
764 template<
class InputIt,
class OutputIt,
class BinaryPredicate>
769 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
770 std::execution::par_unseq,
772 first, last, destination, binaryFunction);
#define CONDITIONAL_NO_EXCEPT
Definition: StlAlgorithms.hpp:40
dtype f(dtype inDofN, dtype inDofD)
Definition: f.hpp:55
bool any_of(InputIt first, InputIt last, UnaryPredicate p) noexcept
Definition: StlAlgorithms.hpp:76
void sort(RandomIt first, RandomIt last) noexcept
Definition: StlAlgorithms.hpp:629
bool is_sorted(ForwardIt first, ForwardIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:250
std::iterator_traits< InputIt >::difference_type count(InputIt first, InputIt last, const T &value) noexcept
Definition: StlAlgorithms.hpp:115
OutputIt set_union(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination) noexcept
Definition: StlAlgorithms.hpp:586
bool none_of(InputIt first, InputIt last, UnaryPredicate p) noexcept
Definition: StlAlgorithms.hpp:379
ForwardIt max_element(ForwardIt first, ForwardIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:287
ForwardIt max_element(ForwardIt first, ForwardIt last) noexcept
Definition: StlAlgorithms.hpp:268
OutputIt set_union(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp) noexcept
Definition: StlAlgorithms.hpp:610
void stable_sort(RandomIt first, RandomIt last) noexcept
Definition: StlAlgorithms.hpp:664
void sort(RandomIt first, RandomIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:647
void reverse(BidirIt first, BidirIt last) noexcept
Definition: StlAlgorithms.hpp:453
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:702
bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPredicate p) noexcept
Definition: StlAlgorithms.hpp:155
bool all_of(InputIt first, InputIt last, UnaryPredicate p) noexcept
Definition: StlAlgorithms.hpp:57
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:213
InputIt find(InputIt first, InputIt last, const T &value) noexcept
Definition: StlAlgorithms.hpp:195
void stable_sort(RandomIt first, RandomIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:682
constexpr OutputIt unique_copy(InputIt first, InputIt last, OutputIt destination) noexcept
Definition: StlAlgorithms.hpp:744
OutputIt set_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp) noexcept
Definition: StlAlgorithms.hpp:516
OutputIt set_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination)
Definition: StlAlgorithms.hpp:492
std::pair< ForwardIt, ForwardIt > minmax_element(ForwardIt first, ForwardIt last) noexcept
Definition: StlAlgorithms.hpp:341
void nth_element(RandomIt first, RandomIt nth, RandomIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:416
void replace(ForwardIt first, ForwardIt last, const T &oldValue, const T &newValue) noexcept
Definition: StlAlgorithms.hpp:435
OutputIt set_intersection(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination) noexcept
Definition: StlAlgorithms.hpp:539
bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2) noexcept
Definition: StlAlgorithms.hpp:135
bool is_sorted(ForwardIt first, ForwardIt last) noexcept
Definition: StlAlgorithms.hpp:231
ForwardIt min_element(ForwardIt first, ForwardIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:323
void rotate(ForwardIt first, ForwardIt firstN, ForwardIt last) noexcept
Definition: StlAlgorithms.hpp:471
OutputIt set_intersection(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp) noexcept
Definition: StlAlgorithms.hpp:563
std::pair< ForwardIt, ForwardIt > minmax_element(ForwardIt first, ForwardIt last, Compare comp) noexcept
Definition: StlAlgorithms.hpp:360
OutputIt copy(InputIt first, InputIt last, OutputIt destination) noexcept
Definition: StlAlgorithms.hpp:95
constexpr OutputIt unique_copy(InputIt first, InputIt last, OutputIt destination, BinaryPredicate binaryFunction) noexcept
Definition: StlAlgorithms.hpp:765
OutputIt transform(InputIt1 first1, InputIt1 last1, InputIt2 first2, OutputIt destination, BinaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:724
void nth_element(RandomIt first, RandomIt nth, RandomIt last) noexcept
Definition: StlAlgorithms.hpp:397
ForwardIt min_element(ForwardIt first, ForwardIt last) noexcept
Definition: StlAlgorithms.hpp:304
void fill(ForwardIt first, ForwardIt last, const T &value) noexcept
Definition: StlAlgorithms.hpp:174
Definition: Coordinate.hpp:45