]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/compute/algorithm/partition_point.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / compute / algorithm / partition_point.hpp
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2014 Roshan <thisisroshansmail@gmail.com>
3 //
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
7 //
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
10
11 #ifndef BOOST_COMPUTE_ALGORITHM_PARTITION_POINT_HPP
12 #define BOOST_COMPUTE_ALGORITHM_PARTITION_POINT_HPP
13
14 #include <boost/compute/system.hpp>
15 #include <boost/compute/command_queue.hpp>
16 #include <boost/compute/algorithm/detail/binary_find.hpp>
17
18 namespace boost {
19 namespace compute {
20
21 ///
22 /// \brief Partition point algorithm
23 ///
24 /// Finds the end of true values in the partitioned range [first, last)
25 /// \return Iterator pointing to end of true values
26 ///
27 /// \param first Iterator pointing to start of range
28 /// \param last Iterator pointing to end of range
29 /// \param predicate Unary predicate to be applied on each element
30 /// \param queue Queue on which to execute
31 ///
32 /// Space complexity: \Omega(1)
33 ///
34 /// \see partition() and stable_partition()
35 ///
36 template<class InputIterator, class UnaryPredicate>
37 inline InputIterator partition_point(InputIterator first,
38 InputIterator last,
39 UnaryPredicate predicate,
40 command_queue &queue = system::default_queue())
41 {
42 return detail::binary_find(first, last, not1(predicate), queue);
43 }
44
45 } // end compute namespace
46 } // end boost namespace
47
48 #endif // BOOST_COMPUTE_ALGORITHM_PARTITION_POINT_HPP