STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
Functions

Summarize the number of elements in the view(s) that meet the specified criteria. Defined in stapl/algorithms/algorithm.hpp. More...

+ Collaboration diagram for Counting Operations:

Functions

template<typename View , typename T >
result_of::count< View, T >::type stapl::prototype::count (View const &view, T const &value)
 Computes the number of elements in the input view which compare equal to the given value. More...
 

Detailed Description

Summarize the number of elements in the view(s) that meet the specified criteria. Defined in stapl/algorithms/algorithm.hpp.

Function Documentation

◆ count()

template<typename View , typename T >
result_of::count<View, T>::type stapl::prototype::count ( View const &  view,
T const &  value 
)

Computes the number of elements in the input view which compare equal to the given value.

Parameters
viewOne-dimensional view over the input elements.
valueValue to count the occurrences of in the input.
Returns
The number of occurrences of the given element in the input.

This algorithm is non-mutating.