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

Find the extreme values in the view provided (e.g., stapl::min_element()). Defined in stapl/algorithms/algorithm.hpp. More...

+ Collaboration diagram for Extrema Operations:

Classes

class  stapl::algo_details::range_max_element< Comparator >
 Work function invokes sequential (i.e., STL) max_element, returning the index and value of the corresponding element. More...
 
struct  stapl::algo_details::max_element_reduce< T, Comparator >
 Work function which reduces two pairs of index and values, selecting the pair with maximum value. More...
 
class  stapl::algo_details::range_min_element< Comparator >
 Work function invokes sequential (i.e., STL) min_element, returning the index and value of the corresponding element. More...
 
class  stapl::algo_details::min_element_reduce< T, Comparator >
 Work function which reduces two pairs of index and values, selecting the pair with minimumvalue. More...
 
class  stapl::algo_details::range_minmax_element< Comparator >
 Work function invokes sequential (i.e., STL) minmax_element. returning the index and value of both corresponding elements. More...
 
class  stapl::algo_details::minmax_element_reduce< T, Comparator >
 Work function which reduces inputs to select min and max values from ranges and their corresponding indices. More...
 

Functions

template<typename View , typename Comparator >
View::reference stapl::max_element (View const &view, Comparator const &comparator)
 Finds the largest element in the input view (or the first largest if there are multiple), which does not compare less than any other element using the given functor. More...
 
template<typename View >
View::reference stapl::max_element (View const &view)
 Finds the largest element in the input view (or the first largest if there are multiple). More...
 
template<typename View , typename Comparator >
View::value_type stapl::max_value (View const &view, Comparator comparator)
 Finds the largest value in the input view. More...
 
template<typename View >
View::value_type stapl::max_value (View const &view)
 Finds the largest value in the input view. More...
 
template<typename View , typename Comparator >
View::reference stapl::min_element (View const &view, Comparator const &comparator)
 Finds the smallest element in the input view (or the first smallest if there are multiple), which compares less than any other element using the given functor. More...
 
template<typename View >
View::reference stapl::min_element (View const &view)
 Finds the smallest element in the input view (or the first smallest if there are multiple). More...
 
template<typename View , typename Comparator >
View::value_type stapl::min_value (View const &view, Comparator const &comparator)
 Finds the smallest value in the input view. More...
 
template<typename View >
View::value_type stapl::min_value (View const &view)
 Finds the smallest value in the input view. More...
 
template<typename View , typename Comparator >
std::pair< typename View::reference, typename View::reference > stapl::minmax_element (View const &view, Comparator const &comparator)
 Returns a pair containing references to the minimum and maximum elements returned by the given comparator when called on all values in the input view. More...
 
template<typename View >
std::pair< typename View::reference, typename View::reference > stapl::minmax_element (View const &view)
 Returns a pair containing references to the minimum and maximum elements returned when using less as a comparator on all values in the input view. More...
 
template<typename View , typename Comparator >
std::pair< typename View::value_type, typename View::value_type > stapl::minmax_value (View const &view, Comparator const &comparator)
 Returns a pair containing the minimum and maximum values returned by the given comparator when called on all values in the input view. More...
 
template<typename View >
std::pair< typename View::value_type, typename View::value_type > stapl::minmax_value (View const &view)
 Returns a pair containing the minimum and maximum values returned when using less as a comparator. More...
 

Detailed Description

Find the extreme values in the view provided (e.g., stapl::min_element()). Defined in stapl/algorithms/algorithm.hpp.

Function Documentation

◆ max_element() [1/2]

template<typename View , typename Comparator >
View::reference stapl::max_element ( View const &  view,
Comparator const &  comparator 
)

Finds the largest element in the input view (or the first largest if there are multiple), which does not compare less than any other element using the given functor.

Parameters
viewOne-dimensional view of the input.
comparatorBinary functor which implements the less operation.
Returns
Reference to the largest element in the input view.

◆ max_element() [2/2]

template<typename View >
View::reference stapl::max_element ( View const &  view)

Finds the largest element in the input view (or the first largest if there are multiple).

Parameters
viewOne-dimensional view of the input.
Returns
Reference to the largest element in the input view.

◆ max_value() [1/2]

template<typename View , typename Comparator >
View::value_type stapl::max_value ( View const &  view,
Comparator  comparator 
)

Finds the largest value in the input view.

Parameters
viewOne-dimensional view of the input.
comparatorBinary functor used to compare elements.
Returns
The largest value in the input.

◆ max_value() [2/2]

template<typename View >
View::value_type stapl::max_value ( View const &  view)

Finds the largest value in the input view.

Parameters
viewOne-dimensional view of the input.
Returns
The largest value in the input.

◆ min_element() [1/2]

template<typename View , typename Comparator >
View::reference stapl::min_element ( View const &  view,
Comparator const &  comparator 
)

Finds the smallest element in the input view (or the first smallest if there are multiple), which compares less than any other element using the given functor.

Parameters
viewOne-dimensional view of the input.
comparatorBinary functor which implements the less operation.
Returns
Reference to the smallest element in the input view.

◆ min_element() [2/2]

template<typename View >
View::reference stapl::min_element ( View const &  view)

Finds the smallest element in the input view (or the first smallest if there are multiple).

Parameters
viewOne-dimensional view of the input.
Returns
Reference to the smallest element in the input view.

◆ min_value() [1/2]

template<typename View , typename Comparator >
View::value_type stapl::min_value ( View const &  view,
Comparator const &  comparator 
)

Finds the smallest value in the input view.

Parameters
viewOne-dimensional view of the input.
compBinary functor used to compare elements.
Returns
The smallest value in the input.

◆ min_value() [2/2]

template<typename View >
View::value_type stapl::min_value ( View const &  view)

Finds the smallest value in the input view.

Parameters
viewOne-dimensional view of the input.
Returns
The smallest value in the input.

◆ minmax_element() [1/2]

template<typename View , typename Comparator >
std::pair<typename View::reference, typename View::reference> stapl::minmax_element ( View const &  view,
Comparator const &  comparator 
)

Returns a pair containing references to the minimum and maximum elements returned by the given comparator when called on all values in the input view.

Parameters
viewOne-dimensional view of the input.
comparatorBinary functor which implements the less operation.
Returns
A pair containing references to the minimum and maximum elements.

◆ minmax_element() [2/2]

template<typename View >
std::pair<typename View::reference, typename View::reference> stapl::minmax_element ( View const &  view)

Returns a pair containing references to the minimum and maximum elements returned when using less as a comparator on all values in the input view.

Parameters
viewOne-dimensional view of the input.
Returns
A pair containing references to the minimum and maximum elements.

◆ minmax_value() [1/2]

template<typename View , typename Comparator >
std::pair<typename View::value_type, typename View::value_type> stapl::minmax_value ( View const &  view,
Comparator const &  comparator 
)

Returns a pair containing the minimum and maximum values returned by the given comparator when called on all values in the input view.

Parameters
viewOne-dimensional view of the input.
compBinary functor used to compare elements.
Returns
A pair containing the minimum and maximum result values.

◆ minmax_value() [2/2]

template<typename View >
std::pair<typename View::value_type, typename View::value_type> stapl::minmax_value ( View const &  view)

Returns a pair containing the minimum and maximum values returned when using less as a comparator.

Parameters
viewOne-dimensional view of the input.
Returns
A pair containing the minimum and maximum result values.