Bolt
1.3
C++ template library with support for OpenCL
|
Functions | |
template<typename ForwardIterator , typename T > | |
bool | bolt::amp::binary_search (bolt::amp::control &ctl, ForwardIterator first, ForwardIterator last, const T &value) |
This version of binary search returns true if the search value is present within the given input range and false otherwise. The routine requires the elements to be arranged in ascending/descending order. It returns true iff there exists an iterator i in [first, last) such that *i < value and value < *i are both false. | |
template<typename ForwardIterator , typename T > | |
bool | bolt::amp::binary_search (ForwardIterator first, ForwardIterator last, const T &value) |
template<typename ForwardIterator , typename T , typename StrictWeakOrdering > | |
bool | bolt::amp::binary_search (bolt::amp::control &ctl, ForwardIterator first, ForwardIterator last, const T &value, StrictWeakOrdering comp) |
This version of binary search returns true if the search value is present within the given input range and false otherwise. The routine requires the elements to be arranged in ascending/descending order. It returns true iff there exists an iterator i in [first, last) such that comp(*i, value) and comp(value, *i) are both false. | |
template<typename ForwardIterator , typename T , typename StrictWeakOrdering > | |
bool | bolt::amp::binary_search (ForwardIterator first, ForwardIterator last, const T &value, StrictWeakOrdering comp) |
bool bolt::amp::binary_search | ( | bolt::amp::control & | ctl, |
ForwardIterator | first, | ||
ForwardIterator | last, | ||
const T & | value | ||
) |
This version of binary search returns true if the search value is present within the given input range and false otherwise. The routine requires the elements to be arranged in ascending/descending order. It returns true iff there exists an iterator i in [first, last) such that *i < value and value < *i are both false.
The binary_search
operation is analogus to the std::binary_search function.
ctl | Optional Control structure to control accelerator, debug, tuning, etc.See bolt::amp::control. |
first | The first position in the sequence to search. |
last | The last position in the sequence to search. |
value | The value to search. |
ForwardIterator | An iterator that can be dereferenced for an object, and can be incremented to get to the next element in a sequence. |
T | The type of the search element. |
The following code example shows the use of binary_search
on the elements in the ascending order.
bool bolt::amp::binary_search | ( | bolt::amp::control & | ctl, |
ForwardIterator | first, | ||
ForwardIterator | last, | ||
const T & | value, | ||
StrictWeakOrdering | comp | ||
) |
This version of binary search returns true if the search value is present within the given input range and false otherwise. The routine requires the elements to be arranged in ascending/descending order. It returns true iff there exists an iterator i in [first, last) such that comp(*i, value) and comp(value, *i) are both false.
The binary_search
operation is analogus to the std::binary_search function.
ctl | Optional Control structure to control accelerator, debug, tuning, etc.See bolt::amp::control. |
first | The first position in the sequence to search. |
last | The last position in the sequence to search. |
value | The value to search. |
comp | The comparison operation used to compare two values. |
ForwardIterator | An iterator that can be dereferenced for an object, and can be incremented to get to the next element in a sequence. |
T | The type of the search element. |
The following code example shows the use of binary_search
on the elements in the descending order.