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

Algorithms related to sorting elements in views. Defined in stapl/algorithms/sorting.hpp. More...

+ Collaboration diagram for Sorting Related Operations:

Functions

template<typename View , typename View2 , typename Pred >
bool stapl::lexicographical_compare (View const &pview1, View2 const &pview2, Pred const &pred)
 Determines if the first view is lexicographically less than the second view, using the given functor. More...
 
template<typename View , typename View2 >
bool stapl::lexicographical_compare (View const &pview1, View2 const &pview2)
 Determines if the first view is lexicographically less than the second view. More...
 
template<typename View1 , typename View2 , typename MergeView >
void stapl::merge (View1 const &view1, View2 const &view2, MergeView &merged)
 Merges the two sorted input views into the output view in sorted order. More...
 
template<typename View , typename Comp >
bool stapl::is_sorted (View const &view, Comp comp)
 Computes whether the input view is sorted. More...
 
template<typename View >
bool stapl::is_sorted (View const &view)
 Computes whether the input view is sorted. More...
 
template<typename View , typename Comp >
View stapl::is_sorted_until (View const &v, Comp const &c)
 Finds the range of elements in the input which are sorted. More...
 
template<typename View >
View stapl::is_sorted_until (View const &v)
 Finds the range of elements in the input which are sorted. More...
 

Detailed Description

Algorithms related to sorting elements in views. Defined in stapl/algorithms/sorting.hpp.

Function Documentation

◆ lexicographical_compare() [1/2]

template<typename View , typename View2 , typename Pred >
bool stapl::lexicographical_compare ( View const &  pview1,
View2 const &  pview2,
Pred const &  pred 
)

Determines if the first view is lexicographically less than the second view, using the given functor.

Parameters
pview1One-dimensional view of the first input.
pview2One-dimensional view of the second input.
predBinary functor which implements the less operation.
Returns
True if the first input is lexicographically less than the second.

This algorithm is non-mutating.

◆ lexicographical_compare() [2/2]

template<typename View , typename View2 >
bool stapl::lexicographical_compare ( View const &  pview1,
View2 const &  pview2 
)

Determines if the first view is lexicographically less than the second view.

Parameters
pview1One-dimensional view of the first input.
pview2One-dimensional view of the second input.
Returns
True if the first input is lexicographically less than the second.

This version calls the predicated version with a default predicate of stapl::less.

◆ merge()

template<typename View1 , typename View2 , typename MergeView >
void stapl::merge ( View1 const &  view1,
View2 const &  view2,
MergeView &  merged 
)

Merges the two sorted input views into the output view in sorted order.

Parameters
view1One-dimensional view of the first sorted input.
view2One-dimensional view of the second sorted input.
mergedOne-dimensional view of the output.

This algorithm mutates the output.

◆ is_sorted() [1/2]

template<typename View , typename Comp >
bool stapl::is_sorted ( View const &  view,
Comp  comp 
)

Computes whether the input view is sorted.

Parameters
viewOne-dimensional view of the input.
compThe strict weak ordering comparison functor.
Returns
True if the input is sorted, false otherwise.

This algorithm is non-mutating.

◆ is_sorted() [2/2]

template<typename View >
bool stapl::is_sorted ( View const &  view)

Computes whether the input view is sorted.

Parameters
viewOne-dimensional view of the input.
Returns
True if the input is sorted, false otherwise.

This version calls the predicated version with a default predicate of stapl::less.

◆ is_sorted_until() [1/2]

template<typename View , typename Comp >
View stapl::is_sorted_until ( View const &  v,
Comp const &  c 
)

Finds the range of elements in the input which are sorted.

Parameters
vOne-dimensional view of the input.
cThe strict weak ordering comparison functor.
Returns
A view over the sorted range.

This algorithm is non-mutating.

◆ is_sorted_until() [2/2]

template<typename View >
View stapl::is_sorted_until ( View const &  v)

Finds the range of elements in the input which are sorted.

Parameters
vOne-dimensional view of the input.
Returns
A view over the sorted range.

This version calls the predicated version with a default predicate of stapl::less.