Simple Application Framework  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Functions
Saf::Algo::Selection::Range Namespace Reference

Selection algorithms on sequences. More...

Functions

template<class FwdIter , class Comp >
FwdIter Max (FwdIter begin, FwdIter end, Comp comp)
 Find the iterator max such that for all iterators j in the range [begin, end) it holds that comp(*max, *j) == false.
template<class FwdIter >
FwdIter Max (FwdIter begin, FwdIter end)
 Find the iterator max such that for all iterators j in the range [begin, end) it holds that !(*max < *j).
template<class FwdIter , class Comp >
FwdIter Min (FwdIter begin, FwdIter end, Comp comp)
 Find the iterator min such that for all iterators j in the range [begin, end) it holds that comp(*j, *min) == false.
template<class FwdIter >
FwdIter Min (FwdIter begin, FwdIter end)
 Find the iterator min such that for all iterators j in the range [begin, end) it holds that !(*j < *min).
template<class FwdIter , class Comp >
Collection::Pair< FwdIter,
FwdIter > 
MinMax (FwdIter begin, FwdIter end, Comp comp)
 Find the iterators to the minimum and maximum elements in the range [begin, end).
template<class FwdIter >
Collection::Pair< FwdIter,
FwdIter > 
MinMax (FwdIter begin, FwdIter end)
 Find the iterators to the minimum and maximum elements in the range [begin, end).

Detailed Description

Selection algorithms on sequences.


Function Documentation

template<class FwdIter , class Comp >
FwdIter Saf::Algo::Selection::Range::Max ( FwdIter  begin,
FwdIter  end,
Comp  comp 
) [inline]

Find the iterator max such that for all iterators j in the range [begin, end) it holds that comp(*max, *j) == false.

Properties:

  • Minimum iterator category: Forward.
  • Worst-case time complexity: $ \mathcal{O}(\mathrm{Range::Distance(begin, end)}) $.
Parameters:
[in]beginIterator to the beginning of the sequence.
[in]endIterator to the end of the sequence.
[in]compComparison predicate.
template<class FwdIter >
FwdIter Saf::Algo::Selection::Range::Max ( FwdIter  begin,
FwdIter  end 
) [inline]

Find the iterator max such that for all iterators j in the range [begin, end) it holds that !(*max < *j).

Properties:

  • Minimum iterator category: Forward.
  • Worst-case time complexity: $ \mathcal{O}(\mathrm{Range::Distance(begin, end)}) $.
Parameters:
[in]beginIterator to the beginning of the sequence.
[in]endIterator to the end of the sequence.
template<class FwdIter , class Comp >
FwdIter Saf::Algo::Selection::Range::Min ( FwdIter  begin,
FwdIter  end,
Comp  comp 
) [inline]

Find the iterator min such that for all iterators j in the range [begin, end) it holds that comp(*j, *min) == false.

Properties:

  • Minimum iterator category: Forward.
  • Worst-case time complexity: $ \mathcal{O}(\mathrm{Range::Distance(begin, end)}) $.
Parameters:
[in]beginIterator to the beginning of the sequence.
[in]endIterator to the end of the sequence.
[in]compComparison predicate.
template<class FwdIter >
FwdIter Saf::Algo::Selection::Range::Min ( FwdIter  begin,
FwdIter  end 
) [inline]

Find the iterator min such that for all iterators j in the range [begin, end) it holds that !(*j < *min).

Properties:

  • Minimum iterator category: Forward.
  • Worst-case time complexity: $ \mathcal{O}(\mathrm{Range::Distance(begin, end)}) $.
Parameters:
[in]beginIterator to the beginning of the sequence.
[in]endIterator to the end of the sequence.
template<class FwdIter , class Comp >
Collection::Pair<FwdIter,FwdIter> Saf::Algo::Selection::Range::MinMax ( FwdIter  begin,
FwdIter  end,
Comp  comp 
) [inline]

Find the iterators to the minimum and maximum elements in the range [begin, end).

Returns a pair of iterators imin and imax such that for all iterators j in the range [begin, end) it holds that comp(*j, *imin) == false and comp(*imax, *j) == false.

Properties:

  • Minimum iterator category: Forward.
  • Worst-case time complexity: $ \mathcal{O}(\mathrm{Range::Distance(begin, end)}) $.
Parameters:
[in]beginIterator to the beginning of the sequence.
[in]endIterator to the end of the sequence.
[in]compComparison predicate.
template<class FwdIter >
Collection::Pair<FwdIter,FwdIter> Saf::Algo::Selection::Range::MinMax ( FwdIter  begin,
FwdIter  end 
) [inline]

Find the iterators to the minimum and maximum elements in the range [begin, end).

Returns a pair of iterators imin and imax such that for all iterators j in the range [begin, end) it holds that !(*j < *imin) and !(*imax < *j).

Properties:

  • Minimum iterator category: Forward.
  • Worst-case time complexity: $ \mathcal{O}(\mathrm{Range::Distance(begin, end)}) $.
Parameters:
[in]beginIterator to the beginning of the sequence.
[in]endIterator to the end of the sequence.