Thrust
partition.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2013 NVIDIA Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
22 #pragma once
23 
24 #include <thrust/detail/config.h>
25 #include <thrust/detail/execution_policy.h>
26 #include <thrust/pair.h>
27 
28 THRUST_NAMESPACE_BEGIN
29 
95 template<typename DerivedPolicy,
96  typename ForwardIterator,
97  typename Predicate>
98 __host__ __device__
99  ForwardIterator partition(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
100  ForwardIterator first,
101  ForwardIterator last,
102  Predicate pred);
103 
104 
155 template<typename ForwardIterator,
156  typename Predicate>
157  ForwardIterator partition(ForwardIterator first,
158  ForwardIterator last,
159  Predicate pred);
160 
161 
223 template<typename DerivedPolicy,
224  typename ForwardIterator,
225  typename InputIterator,
226  typename Predicate>
227 __host__ __device__
228  ForwardIterator partition(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
229  ForwardIterator first,
230  ForwardIterator last,
231  InputIterator stencil,
232  Predicate pred);
233 
234 
291 template<typename ForwardIterator,
292  typename InputIterator,
293  typename Predicate>
294  ForwardIterator partition(ForwardIterator first,
295  ForwardIterator last,
296  InputIterator stencil,
297  Predicate pred);
298 
299 
367 template<typename DerivedPolicy,
368  typename InputIterator,
369  typename OutputIterator1,
370  typename OutputIterator2,
371  typename Predicate>
372 __host__ __device__
374  partition_copy(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
375  InputIterator first,
376  InputIterator last,
377  OutputIterator1 out_true,
378  OutputIterator2 out_false,
379  Predicate pred);
380 
381 
444 template<typename InputIterator,
445  typename OutputIterator1,
446  typename OutputIterator2,
447  typename Predicate>
449  partition_copy(InputIterator first,
450  InputIterator last,
451  OutputIterator1 out_true,
452  OutputIterator2 out_false,
453  Predicate pred);
454 
455 
521 template<typename DerivedPolicy,
522  typename InputIterator1,
523  typename InputIterator2,
524  typename OutputIterator1,
525  typename OutputIterator2,
526  typename Predicate>
527 __host__ __device__
529  partition_copy(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
530  InputIterator1 first,
531  InputIterator1 last,
532  InputIterator2 stencil,
533  OutputIterator1 out_true,
534  OutputIterator2 out_false,
535  Predicate pred);
536 
537 
597 template<typename InputIterator1,
598  typename InputIterator2,
599  typename OutputIterator1,
600  typename OutputIterator2,
601  typename Predicate>
603  partition_copy(InputIterator1 first,
604  InputIterator1 last,
605  InputIterator2 stencil,
606  OutputIterator1 out_true,
607  OutputIterator2 out_false,
608  Predicate pred);
609 
610 
670 template<typename DerivedPolicy,
671  typename ForwardIterator,
672  typename Predicate>
673 __host__ __device__
674  ForwardIterator stable_partition(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
675  ForwardIterator first,
676  ForwardIterator last,
677  Predicate pred);
678 
679 
733 template<typename ForwardIterator,
734  typename Predicate>
735  ForwardIterator stable_partition(ForwardIterator first,
736  ForwardIterator last,
737  Predicate pred);
738 
739 
803 template<typename DerivedPolicy,
804  typename ForwardIterator,
805  typename InputIterator,
806  typename Predicate>
807 __host__ __device__
808  ForwardIterator stable_partition(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
809  ForwardIterator first,
810  ForwardIterator last,
811  InputIterator stencil,
812  Predicate pred);
813 
814 
873 template<typename ForwardIterator,
874  typename InputIterator,
875  typename Predicate>
876  ForwardIterator stable_partition(ForwardIterator first,
877  ForwardIterator last,
878  InputIterator stencil,
879  Predicate pred);
880 
881 
951 template<typename DerivedPolicy,
952  typename InputIterator,
953  typename OutputIterator1,
954  typename OutputIterator2,
955  typename Predicate>
956 __host__ __device__
958  stable_partition_copy(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
959  InputIterator first,
960  InputIterator last,
961  OutputIterator1 out_true,
962  OutputIterator2 out_false,
963  Predicate pred);
964 
965 
1030 template<typename InputIterator,
1031  typename OutputIterator1,
1032  typename OutputIterator2,
1033  typename Predicate>
1035  stable_partition_copy(InputIterator first,
1036  InputIterator last,
1037  OutputIterator1 out_true,
1038  OutputIterator2 out_false,
1039  Predicate pred);
1040 
1041 
1108 template<typename DerivedPolicy,
1109  typename InputIterator1,
1110  typename InputIterator2,
1111  typename OutputIterator1,
1112  typename OutputIterator2,
1113  typename Predicate>
1114 __host__ __device__
1116  stable_partition_copy(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1117  InputIterator1 first,
1118  InputIterator1 last,
1119  InputIterator2 stencil,
1120  OutputIterator1 out_true,
1121  OutputIterator2 out_false,
1122  Predicate pred);
1123 
1124 
1186 template<typename InputIterator1,
1187  typename InputIterator2,
1188  typename OutputIterator1,
1189  typename OutputIterator2,
1190  typename Predicate>
1192  stable_partition_copy(InputIterator1 first,
1193  InputIterator1 last,
1194  InputIterator2 stencil,
1195  OutputIterator1 out_true,
1196  OutputIterator2 out_false,
1197  Predicate pred);
1198 
1199 
1261 template<typename DerivedPolicy, typename ForwardIterator, typename Predicate>
1262 __host__ __device__
1263  ForwardIterator partition_point(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1264  ForwardIterator first,
1265  ForwardIterator last,
1266  Predicate pred);
1267 
1268 
1313 template<typename ForwardIterator, typename Predicate>
1314  ForwardIterator partition_point(ForwardIterator first,
1315  ForwardIterator last,
1316  Predicate pred);
1317 
1374 template<typename DerivedPolicy, typename InputIterator, typename Predicate>
1375 __host__ __device__
1376  bool is_partitioned(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1377  InputIterator first,
1378  InputIterator last,
1379  Predicate pred);
1380 
1381 
1423 template<typename InputIterator, typename Predicate>
1424  bool is_partitioned(InputIterator first,
1425  InputIterator last,
1426  Predicate pred);
1427 
1428 
1433 THRUST_NAMESPACE_END
1434 
1435 #include <thrust/detail/partition.inl>
1436 
ForwardIterator partition(ForwardIterator first, ForwardIterator last, InputIterator stencil, Predicate pred)
ForwardIterator partition_point(ForwardIterator first, ForwardIterator last, Predicate pred)
Definition: pair.h:48
ForwardIterator stable_partition(ForwardIterator first, ForwardIterator last, InputIterator stencil, Predicate pred)
thrust::pair< OutputIterator1, OutputIterator2 > stable_partition_copy(InputIterator1 first, InputIterator1 last, InputIterator2 stencil, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred)
A type encapsulating a heterogeneous pair of elements.
thrust::pair< OutputIterator1, OutputIterator2 > partition_copy(InputIterator1 first, InputIterator1 last, InputIterator2 stencil, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred)
bool is_partitioned(InputIterator first, InputIterator last, Predicate pred)