STAPL API Reference |
Modules Classes |
Search and query view elements. More...
Classes | |
class | stapl::algo_details::range_all_of< Predicate > |
Work function invokes sequential (i.e., STL) all_of . More... | |
class | stapl::algo_details::range_none_of< Predicate > |
Work function invokes sequential (i.e., STL) none_of . More... | |
class | stapl::algo_details::range_any_of< Predicate > |
Work function invokes sequential (i.e., STL) any_of . More... | |
class | stapl::algo_details::range_count_if< Predicate > |
Work function invokes sequential (i.e., STL) count_if . More... | |
class | stapl::algo_details::range_equal< Predicate > |
Work function invokes sequential (i.e., STL) equal . More... | |
class | stapl::algo_details::range_mismatch< Predicate > |
Work function invokes sequential (i.e., STL) mismatch . More... | |
class | stapl::algo_details::range_find< Predicate > |
Work function invokes sequential (i.e., STL) find . More... | |
class | stapl::algo_details::range_adjacent_find< Predicate > |
Work function invokes sequential (i.e., STL) adjacent_find . More... | |
class | stapl::algo_details::range_find_end< Predicate > |
Work function invokes sequential (i.e., STL) find_end . More... | |
struct | stapl::algo_details::find_end_reduce |
Work function which returns its second argument if non-null, and the first otherwise. More... | |
class | stapl::algo_details::range_find_first_of< Predicate > |
Work function invokes sequential (i.e., STL) find_first_of . More... | |
class | stapl::algo_details::range_search< Predicate > |
Work function invokes sequential (i.e., STL) search . More... | |
class | stapl::algo_details::range_search_n< T, Predicate > |
Work function invokes sequential (i.e., STL) search_n . Returns information about matches found in the range as well as partial matches found at the front and back of the range. More... | |
Modules | |
Search Operations | |
Search for elements in view(s) that meet the specified criteria (e.g. stapl::find()). Defined in stapl/algorithms/algorithm.hpp. | |
Summary Operations | |
Summarize the entire set of elements in the view(s) (e.g., stapl::equal()). | |
Extrema Operations | |
Find the extreme values in the view provided (e.g., stapl::min_element()). Defined in stapl/algorithms/algorithm.hpp. | |
Counting Operations | |
Summarize the number of elements in the view(s) that meet the specified criteria. Defined in stapl/algorithms/algorithm.hpp. | |
Functions | |
template<typename View0 , typename Predicate > | |
bool | stapl::all_of (View0 const &view, Predicate predicate) |
Returns true if the given predicate returns true for all of the elements in the input view. More... | |
template<typename View0 , typename Predicate > | |
bool | stapl::none_of (View0 const &view, Predicate predicate) |
Returns true if the given predicate returns false for all of the elements in the input view, or the view is empty. More... | |
template<typename View0 , typename Predicate > | |
bool | stapl::any_of (View0 const &view, Predicate predicate) |
Returns true if the given predicate returns true for any of the elements in the input view. More... | |
template<typename View , typename Predicate > | |
View::size_type | stapl::count_if (View const &view, Predicate predicate) |
Computes the number of elements in the input view for which the given functor returns true. More... | |
template<typename View , typename T > | |
View::size_type | stapl::count (View const &view, T const &value) |
Computes the number of elements in the input view which compare equal to the given value. More... | |
template<typename View1 , typename View2 , typename Predicate > | |
std::pair< typename View1::reference, typename View2::reference > | stapl::mismatch (View1 const &view1, View2 const &view2, Predicate predicate) |
Given two input views, returns the positions of the first elements which do not match. More... | |
template<typename View1 , typename View2 > | |
std::pair< typename View1::reference, typename View2::reference > | stapl::mismatch (View1 const &view1, View2 const &view2) |
Given two input views, returns the positions of the first elements which do not match. More... | |
template<typename View , typename Predicate > | |
View::reference | stapl::find_if (View const &view, Predicate predicate) |
Finds the first element in the input for which the predicate returns true, or null_reference if none exist. More... | |
template<typename View , typename Predicate > | |
View::reference | stapl::find_if_not (View const &view, Predicate predicate) |
Finds the first element in the input for which the predicate returns false, or null_reference if none exist. More... | |
template<typename View , typename T > | |
View::reference | stapl::find (View const &view, T const &value) |
Finds the first occurrence of the given value in the input, null_reference if it is not found. More... | |
template<typename View , typename Predicate > | |
View::reference | stapl::adjacent_find (View const &view, Predicate predicate) |
Return the position of the first adjacent pair of equal elements. More... | |
template<typename View > | |
View::reference | stapl::adjacent_find (View const &view) |
Return the position of the first adjacent pair of equal elements. More... | |
template<typename View1 , typename View2 , typename Predicate > | |
View1::reference | stapl::find_end (View1 const &sequence, View2 const &pattern, Predicate predicate) |
Finds the last occurrence of the given pattern in the input sequence. More... | |
template<typename View1 , typename View2 > | |
View1::reference | stapl::find_end (View1 const &sequence, View2 const &pattern) |
Finds the last occurrence of the given pattern in the input sequence. More... | |
template<typename View0 , typename View1 , typename Predicate > | |
View0::reference | stapl::find_first_of (View0 const &view0, View1 const &view1, Predicate predicate) |
Finds the first element in the input which matches any of the elements in the given view, according to the given predicate. More... | |
template<typename View0 , typename View1 > | |
View0::reference | stapl::find_first_of (View0 const &view0, View1 const &view1) |
Finds the first element in the input which matches any of the elements in the given view. More... | |
template<typename View1 , typename View2 , typename Predicate > | |
View1::reference | stapl::search (View1 const &v1, View2 const &v2, Predicate predicate) |
Return the position of the first occurrence of the given search sequence within the input, or a null_reference instance if it is not found. More... | |
template<typename View1 , typename View2 > | |
View1::reference | stapl::search (View1 const &v1, View2 const &v2) |
Return the position of the first occurrence of the given sequence within the input, or a null_reference instance if the sequence is not found. More... | |
template<typename View , typename Predicate > | |
View::reference | stapl::search_n (View const &v, size_t count, typename View::value_type value, Predicate predicate) |
Return the position of the first occurrence of a sequence of the given value which is of the given length, or a null_reference instance if it is not found. More... | |
template<typename View1 > | |
View1::reference | stapl::search_n (View1 const &v1, size_t count, typename View1::value_type value) |
Return the position of the first occurrence of a sequence of the given value which is of the given length, or null_reference if none exists. More... | |
template<typename View0 , typename View1 , typename Predicate > | |
bool | stapl::equal (View0 const &view0, View1 const &view1, Predicate predicate) |
Compares the two input views and returns true if all of their elements compare pairwise equal. More... | |
Search and query view elements.
The non-modifying sequence operations do not directly modify the sequences of data they operate on. Each algorithm has two versions, one using operator==
for comparisons, and the other using a user-defined function object.
bool stapl::all_of | ( | View0 const & | view, |
Predicate | predicate | ||
) |
Returns true if the given predicate returns true for all of the elements in the input view.
view | One-dimensional view of the input. |
predicate | Unary functor which is called on the input elements. |
bool stapl::none_of | ( | View0 const & | view, |
Predicate | predicate | ||
) |
Returns true if the given predicate returns false for all of the elements in the input view, or the view is empty.
view | One-dimensional view of the input. |
predicate | Unary functor which is called on the input elements. |
bool stapl::any_of | ( | View0 const & | view, |
Predicate | predicate | ||
) |
Returns true if the given predicate returns true for any of the elements in the input view.
view | One-dimensional view of the input. |
predicate | Unary functor which is called on the input elements. |
View::size_type stapl::count_if | ( | View const & | view, |
Predicate | predicate | ||
) |
Computes the number of elements in the input view for which the given functor returns true.
view | One-dimensional view over the input elements. |
predicate | Functor which is used to test the elements for counting. |
View::size_type stapl::count | ( | View const & | view, |
T const & | value | ||
) |
Computes the number of elements in the input view which compare equal to the given value.
view | One-dimensional view over the input elements. |
value | Value to count the occurrences of in the input. |
std::pair<typename View1::reference, typename View2::reference> stapl::mismatch | ( | View1 const & | view1, |
View2 const & | view2, | ||
Predicate | predicate | ||
) |
Given two input views, returns the positions of the first elements which do not match.
view1 | One-dimensional view of input. |
view2 | One-dimensional view of input. |
predicate | Functor that evaluates whether elements match. |
std::pair<typename View1::reference, typename View2::reference> stapl::mismatch | ( | View1 const & | view1, |
View2 const & | view2 | ||
) |
Given two input views, returns the positions of the first elements which do not match.
view1 | One-dimensional view of input. |
view2 | One-dimensional view of input. |
View::reference stapl::find_if | ( | View const & | view, |
Predicate | predicate | ||
) |
Finds the first element in the input for which the predicate returns true, or null_reference if none exist.
view | One-dimensional view of the input. |
predicate | Functor used to test the elements. |
View::reference stapl::find_if_not | ( | View const & | view, |
Predicate | predicate | ||
) |
Finds the first element in the input for which the predicate returns false, or null_reference if none exist.
view | One-dimensional view of the input. |
predicate | Functor used to test the elements. |
View::reference stapl::find | ( | View const & | view, |
T const & | value | ||
) |
Finds the first occurrence of the given value in the input, null_reference if it is not found.
view | One-dimensional view of the input. |
value | Value to find. |
View::reference stapl::adjacent_find | ( | View const & | view, |
Predicate | predicate | ||
) |
Return the position of the first adjacent pair of equal elements.
view | One-dimensional view of the input elements. |
predicate | Predicate functor which implements the equal operation. |
View::reference stapl::adjacent_find | ( | View const & | view | ) |
Return the position of the first adjacent pair of equal elements.
view | One-dimensional view of the input elements. |
View1::reference stapl::find_end | ( | View1 const & | sequence, |
View2 const & | pattern, | ||
Predicate | predicate | ||
) |
Finds the last occurrence of the given pattern in the input sequence.
sequence | A one-dimensional view of the input. |
pattern | The pattern to search for in the input. |
predicate | Functor which implements the equal operation. |
View1::reference stapl::find_end | ( | View1 const & | sequence, |
View2 const & | pattern | ||
) |
Finds the last occurrence of the given pattern in the input sequence.
sequence | A one-dimensional view of the input. |
pattern | The pattern to search for in the input. |
View0::reference stapl::find_first_of | ( | View0 const & | view0, |
View1 const & | view1, | ||
Predicate | predicate | ||
) |
Finds the first element in the input which matches any of the elements in the given view, according to the given predicate.
view0 | One-dimensional view of the input. |
view1 | One-dimensional view of the elements to find. |
predicate | Binary functor which implements the less operation. |
View0::reference stapl::find_first_of | ( | View0 const & | view0, |
View1 const & | view1 | ||
) |
Finds the first element in the input which matches any of the elements in the given view.
view0 | One-dimensional view of the input. |
view1 | One-dimensional view of the elements to find. |
View1::reference stapl::search | ( | View1 const & | v1, |
View2 const & | v2, | ||
Predicate | predicate | ||
) |
Return the position of the first occurrence of the given search sequence within the input, or a null_reference instance if it is not found.
v1 | One-dimensional view of the input elements. |
v2 | One-dimensional view of the search sequence. |
predicate | Functor that evaluates whether elements are equal. |
View1::reference stapl::search | ( | View1 const & | v1, |
View2 const & | v2 | ||
) |
Return the position of the first occurrence of the given sequence within the input, or a null_reference instance if the sequence is not found.
v1 | One-dimensional view of the input elements. |
v2 | One-dimensional view of the search sequence. |
View::reference stapl::search_n | ( | View const & | v, |
size_t | count, | ||
typename View::value_type | value, | ||
Predicate | predicate | ||
) |
Return the position of the first occurrence of a sequence of the given value which is of the given length, or a null_reference instance if it is not found.
v | One-dimensional view of input elements. |
count | Length of sequence of repeated elements to find. |
value | Value which is repeated in the searched sequence. |
predicate | Functor which implements the equality operation. |
View1::reference stapl::search_n | ( | View1 const & | v1, |
size_t | count, | ||
typename View1::value_type | value | ||
) |
Return the position of the first occurrence of a sequence of the given value which is of the given length, or null_reference if none exists.
v1 | One-dimensional view of input elements. |
count | Length of sequence of repeated elements to search. |
value | Value which is repeated in the searched sequence. |
bool stapl::equal | ( | View0 const & | view0, |
View1 const & | view1, | ||
Predicate | predicate | ||
) |
Compares the two input views and returns true if all of their elements compare pairwise equal.
view0 | One-dimensional input view. |
view1 | One-dimensional input view. |
predicate | Binary functor which implements equality. |