Bolt
1.3
C++ template library with support for OpenCL
|
Functions | |
template<typename RandomAccessIterator > | |
void | bolt::cl::stable_sort (RandomAccessIterator first, RandomAccessIterator last, const std::string &cl_code="") |
template<typename RandomAccessIterator , typename StrictWeakOrdering > | |
void | bolt::cl::stable_sort (RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp, const std::string &cl_code="") |
template<typename RandomAccessIterator > | |
void | bolt::cl::stable_sort (bolt::cl::control &ctl, RandomAccessIterator first, RandomAccessIterator last, const std::string &cl_code="") |
template<typename RandomAccessIterator , typename StrictWeakOrdering > | |
void | bolt::cl::stable_sort (bolt::cl::control &ctl, RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp, const std::string &cl_code="") |
void bolt::cl::stable_sort | ( | RandomAccessIterator | first, |
RandomAccessIterator | last, | ||
const std::string & | cl_code = "" |
||
) |
Stable_sort
returns the sorted result of all the elements in the range specified between the the first and last RandomAccessIterator
iterators. This routine arranges the elements in ascending order assuming that an operator < exists for the value_type given by the iterator.
The stable_sort
operation is analogus to the std::stable_sort function. It is a stable operation with respect to the input data, in that if two elements are equivalent in the input range, and element X appears before element Y, then element X has to maintain that relationship and appear before element Y after the sorting operation. In general, stable sorts are usually prefered over unstable sorting algorithms, but may sacrifice a little performance to maintain this relationship.
first | Defines the beginning of the range to be sorted |
last | Defines the end of the range to be sorted |
cl_code | Optional OpenCL ™ code to be passed to the OpenCL compiler. The cl_code is inserted first in the generated code, before the cl_code traits. This can be used for any extra cl code to be passed when compiling the OpenCl Kernel. |
RandomAccessIterator | models a random access iterator The following code example shows the use of \p stable_sort to sort the elements in ascending order #include "bolt/cl/stablesort.h"
int a[ 10 ] = { 2, 9, 3, 7, 5, 6, 3, 8, 9, 0 };
bolt::cl::stable_sort( a, a + 10 );
\\ results a[] = { 0, 2, 3, 3, 5, 6, 7, 8, 9, 9 }
\\ The 3s and the 9s kept their respective ordering from the original input
|
void bolt::cl::stable_sort | ( | RandomAccessIterator | first, |
RandomAccessIterator | last, | ||
StrictWeakOrdering | comp, | ||
const std::string & | cl_code = "" |
||
) |
Stable_sort
returns the sorted result of all the elements in the range specified between the the first and last RandomAccessIterator
iterators. This routine arranges the elements in ascending order assuming that an operator < exists for the value_type given by the iterator.
The stable_sort
operation is analogus to the std::stable_sort function. It is a stable operation with respect to the input data, in that if two elements are equivalent in the input range, and element X appears before element Y, then element X has to maintain that relationship and appear before element Y after the sorting operation. In general, stable sorts are usually prefered over unstable sorting algorithms, but may sacrifice a little performance to maintain this relationship. This overload of stable_sort accepts an additional comparator functor that allows the user to specify the comparison operator to use.
first | Defines the beginning of the range to be sorted |
last | Defines the end of the range to be sorted |
comp | A user defined comparison function or functor that models a strict weak < operator |
cl_code | Optional OpenCL ™ code to be passed to the OpenCL compiler. The cl_code is inserted first in the generated code, before the cl_code traits. This can be used for any extra cl code to be passed when compiling the OpenCl Kernel. |
RandomAccessIterator | models a random access iterator |
StrictWeakOrdering | models a binary predicate which returns true if the first element is 'less than' the second The following code example shows the use of \p stable_sort to sort the elements in ascending order #include "bolt/cl/stablesort.h"
int a[ 10 ] = { 2, 9, 3, 7, 5, 6, 3, 8, 9, 0 };
bolt::cl::stable_sort( a, a + 10, bolt::cl::greater< int >( ) );
\\ results a[] = { 9, 9, 8, 7, 6, 5, 3, 3, 2, 0 }
|
void bolt::cl::stable_sort | ( | bolt::cl::control & | ctl, |
RandomAccessIterator | first, | ||
RandomAccessIterator | last, | ||
const std::string & | cl_code = "" |
||
) |
Stable_sort
returns the sorted result of all the elements in the range specified between the the first and last RandomAccessIterator
iterators. This routine arranges the elements in ascending order assuming that an operator < exists for the value_type given by the iterator.
The stable_sort
operation is analogus to the std::stable_sort function. It is a stable operation with respect to the input data, in that if two elements are equivalent in the input range, and element X appears before element Y, then element X has to maintain that relationship and appear before element Y after the sorting operation. In general, stable sorts are usually prefered over unstable sorting algorithms, but may sacrifice a little performance to maintain this relationship. This overload of stable_sort accepts an additional bolt::cl::control object that allows the user to change the state that the function uses to make runtime decisions.
ctl | A control object passed into stable_sort that the function uses to make runtime decisions |
first | Defines the beginning of the range to be sorted |
last | Defines the end of the range to be sorted |
cl_code | Optional OpenCL ™ code to be passed to the OpenCL compiler. The cl_code is inserted first in the generated code, before the cl_code traits. This can be used for any extra cl code to be passed when compiling the OpenCl Kernel. |
RandomAccessIterator | models a random access iterator The following code example shows the use of \p stable_sort to sort the elements in ascending order #include "bolt/cl/stablesort.h"
int a[ 10 ] = { 2, 9, 3, 7, 5, 6, 3, 8, 9, 0 };
bolt::cl::stable_sort( a, a + 10, bolt::cl::greater< int >( ) );
\\ results a[] = { 9, 9, 8, 7, 6, 5, 3, 3, 2, 0 }
|
void bolt::cl::stable_sort | ( | bolt::cl::control & | ctl, |
RandomAccessIterator | first, | ||
RandomAccessIterator | last, | ||
StrictWeakOrdering | comp, | ||
const std::string & | cl_code = "" |
||
) |
Stable_sort
returns the sorted result of all the elements in the range specified between the the first and last RandomAccessIterator
iterators. This routine arranges the elements in ascending order assuming that an operator < exists for the value_type given by the iterator.
The stable_sort
operation is analogus to the std::stable_sort function. It is a stable operation with respect to the input data, in that if two elements are equivalent in the input range, and element X appears before element Y, then element X has to maintain that relationship and appear before element Y after the sorting operation. In general, stable sorts are usually prefered over unstable sorting algorithms, but may sacrifice a little performance to maintain this relationship. This overload of stable_sort accepts an additional comparator functor that allows the user to specify the comparison operator to use. This overload also accepts an additional bolt::cl::control object that allows the user to change the state that the function uses to make runtime decisions.
ctl | A control object passed into stable_sort that the function uses to make runtime decisions |
first | Defines the beginning of the range to be sorted |
last | Defines the end of the range to be sorted |
comp | A user defined comparison function or functor that models a strict weak < operator |
cl_code | Optional OpenCL ™ code to be passed to the OpenCL compiler. The cl_code is inserted first in the generated code, before the cl_code traits. This can be used for any extra cl code to be passed when compiling the OpenCl Kernel. |
RandomAccessIterator | models a random access iterator |
StrictWeakOrdering | models a binary predicate which returns true if the first element is 'less than' the second The following code example shows the use of \p stable_sort to sort the elements in ascending order #include "bolt/cl/stablesort.h"
int a[ 10 ] = { 2, 9, 3, 7, 5, 6, 3, 8, 9, 0 };
bolt::cl::stable_sort( a, a + 10, bolt::cl::greater< int >( ) );
\\ results a[] = { 9, 9, 8, 7, 6, 5, 3, 3, 2, 0 }
|