LibUDB 1.0
Loading...
Searching...
No Matches
Algorithm Class Reference

The Algorithm class. More...

#include <Algorithm.h>

Static Public Member Functions

template<class InputIt, class T = typename std::iterator_traits<InputIt>::value_type>
static InputIt parallelFind (InputIt start, InputIt end, const T &val)
template<class InputIt, class UnaryPred>
static InputIt parallelFindIf (InputIt start, InputIt end, UnaryPred predicate)
template<class InputIt, class UnaryPred>
static void parallelSort (InputIt start, InputIt end, UnaryPred predicate)
template<class InputIt, class T = typename std::iterator_traits<InputIt>::value_type>
static InputIt parallelRemove (InputIt start, InputIt end, const T &val)
template<class InputIt, class UnaryPred, class T = typename std::iterator_traits<InputIt>::value_type>
static InputIt parallelRemoveIf (InputIt start, InputIt end, UnaryPred predicate)

Detailed Description

The Algorithm class.

This class contains some parallelized algorithms for standard containers.

Member Function Documentation

◆ parallelFind()

template<class InputIt, class T = typename std::iterator_traits<InputIt>::value_type>
InputIt Algorithm::parallelFind ( InputIt start,
InputIt end,
const T & val )
inlinestatic

Acts like std::find.

Note
OMP_CANCELLATION system variable should be set to true before program start to achieve maximum effectiveness.
Parameters
startBegin iterator.
endEnd iterator.
valValue to be found.
Returns
Iterarator pointing to found object or end iterator.

◆ parallelFindIf()

template<class InputIt, class UnaryPred>
InputIt Algorithm::parallelFindIf ( InputIt start,
InputIt end,
UnaryPred predicate )
inlinestatic

Acts like std::find_if.

Note
OMP_CANCELLATION system variable should be set to true before program start to achieve maximum effectiveness.
Parameters
startBegin iterator.
endEnd iterator.
predicateMethod used to check conditions.
Returns
Iterator pointing to found element or end iterator.

◆ parallelRemove()

template<class InputIt, class T = typename std::iterator_traits<InputIt>::value_type>
InputIt Algorithm::parallelRemove ( InputIt start,
InputIt end,
const T & val )
inlinestatic

Acts like std::remove.

Parameters
startBegin iterator.
endEnd iterator.
valValue of element to be removed.
Returns
Past-the-end iterator for the new range of values (if this is not end, then it points to an unspecified value, and so do iterators to any values between this iterator and end).

◆ parallelRemoveIf()

template<class InputIt, class UnaryPred, class T = typename std::iterator_traits<InputIt>::value_type>
InputIt Algorithm::parallelRemoveIf ( InputIt start,
InputIt end,
UnaryPred predicate )
inlinestatic

Acts like std::remove_if.

Parameters
startBegin iterator.
endEnd iterator.
predicateMethod to check conditions.
Returns
Past-the-end iterator for the new range of values (if this is not end, then it points to an unspecified value, and so do iterators to any values between this iterator and end).

◆ parallelSort()

template<class InputIt, class UnaryPred>
void Algorithm::parallelSort ( InputIt start,
InputIt end,
UnaryPred predicate )
inlinestatic

Acts like std::sort. Uses quicksort algorithm.

Parameters
startBegin iterator.
endEnd iterator.
predicateMethod used to compare elements.