MCPcopy Create free account
hub / github.com/boostorg/compute / binary_search

Function binary_search

include/boost/compute/algorithm/binary_search.hpp:29–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27/// Space complexity: \Omega(1)
28template<class InputIterator, class T>
29inline bool binary_search(InputIterator first,
30 InputIterator last,
31 const T &value,
32 command_queue &queue = system::default_queue())
33{
34 BOOST_STATIC_ASSERT(is_device_iterator<InputIterator>::value);
35 InputIterator position = lower_bound(first, last, value, queue);
36
37 return position != last && position.read(queue) == value;
38}
39
40} // end compute namespace
41} // end boost namespace

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

lower_boundFunction · 0.85
readMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68