KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::plugin::SampleSort< Comm, DefaultContainerType > Class Template Reference

Plugin that adds a canonical sample sort to the communicator. More...

#include <sort.hpp>

Inheritance diagram for kamping::plugin::SampleSort< Comm, DefaultContainerType >:
Collaboration diagram for kamping::plugin::SampleSort< Comm, DefaultContainerType >:

Public Member Functions

template<typename T , typename Allocator , typename Compare = std::less<T>>
void sort (std::vector< T, Allocator > &data, Compare comp=Compare{})
 Sort the vector based on a binary comparison function (std::less by default).
 
template<typename RandomIt , typename OutputIt , typename Compare = std::less<typename std::iterator_traits<RandomIt>::value_type>>
void sort (RandomIt begin, RandomIt end, OutputIt out, Compare comp=Compare{})
 Sort the elements in [begin, end) using a binary comparison function (std::less by default).
 

Detailed Description

template<typename Comm, template< typename... > typename DefaultContainerType>
class kamping::plugin::SampleSort< Comm, DefaultContainerType >

Plugin that adds a canonical sample sort to the communicator.

Template Parameters
Typeof the communicator that is extended by the plugin.
DefaultContainerTypeDefault container type of the original communicator.

Member Function Documentation

◆ sort() [1/2]

template<typename Comm , template< typename... > typename DefaultContainerType>
template<typename RandomIt , typename OutputIt , typename Compare = std::less<typename std::iterator_traits<RandomIt>::value_type>>
void kamping::plugin::SampleSort< Comm, DefaultContainerType >::sort ( RandomIt begin,
RandomIt end,
OutputIt out,
Compare comp = Compare{} )
inline

Sort the elements in [begin, end) using a binary comparison function (std::less by default).

The order of equal elements in not guaranteed to be preserved. The binary comparison function has to be true if the first argument is less than the second.

Template Parameters
RandomItIterator type of the container containing the elements that are sorted.
OutputItIterator type of the output iterator.
CompareType of the binary comparison function (std::less<> by default).
Parameters
beginStart of the range of elements to sort.
endElement after the last element to be sorted.
outOutput iterator used to output the sorted elements.
compBinary comparison function used to determine the order of elements.

◆ sort() [2/2]

template<typename Comm , template< typename... > typename DefaultContainerType>
template<typename T , typename Allocator , typename Compare = std::less<T>>
void kamping::plugin::SampleSort< Comm, DefaultContainerType >::sort ( std::vector< T, Allocator > & data,
Compare comp = Compare{} )
inline

Sort the vector based on a binary comparison function (std::less by default).

The order of equal elements is not guaranteed to be preserved. The binary comparison function has to be true if the first argument is less than the second.

Template Parameters
TType of elements to be sorted.
AllocatorAllocator of the vector.
CompareType of the binary comparison function (std::less<T> by default).
Parameters
dataVector containing the data to be sorted.
compBinary comparison function used to determine the order of elements.

The documentation for this class was generated from the following file: