sort.cpp File Reference
#include "sort.h"
#include <common.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <boost/static_assert.hpp>
Go to the source code of this file.
|
Defines |
| #define | FLIP_FLOAT(f) (f) ^ (-((f) >> 31) | 0x80000000) |
| #define | FLIP_FLOAT_INVERSE(f) (f) ^ ((((f) >> 31) - 1) | 0x80000000) |
| #define | FLIP_DOUBLE(d) (d) ^ (-((d) >> 63) | 0x800000000000000ULL) |
| #define | FLIP_DOUBLE_INVERSE(d) (d) ^ ((((d) >> 63) - 1) | 0x800000000000000ULL) |
| #define | SWAP(x, y) |
Functions |
| | BOOST_STATIC_ASSERT (sizeof(unsigned int)==sizeof(int)) |
| | BOOST_STATIC_ASSERT (sizeof(unsigned long long)==sizeof(double)) |
| | BOOST_STATIC_ASSERT (std::numeric_limits< unsigned int >::digits==32) |
| | BOOST_STATIC_ASSERT (std::numeric_limits< unsigned long long >::digits==64) |
| template<typename T> |
| void | quickSort (T *a, const int p, const int q) |
| template<> |
| void | radixSort (unsigned int *a, unsigned int *b, const unsigned int n) |
| template<> |
| void | radixSort (int *a, int *b, const unsigned int n) |
| template<> |
| void | radixSort (float *a, float *b, const unsigned int n) |
| template<> |
| void | radixSort (double *a, double *b, const unsigned int n) |
| template<> |
| void | radixSortIndices (unsigned int *a, unsigned int *indices, unsigned int *b, const unsigned int n) |
| template<> |
| void | radixSortIndices (double *a, unsigned int *indices, unsigned int *b, const unsigned int n) |
Define Documentation
| #define FLIP_DOUBLE |
( |
d |
|
) |
(d) ^ (-((d) >> 63) | 0x800000000000000ULL) |
| #define FLIP_DOUBLE_INVERSE |
( |
d |
|
) |
(d) ^ ((((d) >> 63) - 1) | 0x800000000000000ULL) |
| #define FLIP_FLOAT |
( |
f |
|
) |
(f) ^ (-((f) >> 31) | 0x80000000) |
| #define FLIP_FLOAT_INVERSE |
( |
f |
|
) |
(f) ^ ((((f) >> 31) - 1) | 0x80000000) |
Value:
do { \
(x) ^= (y); \
(y) ^= (x); \
(x) ^= (y); \
} while(0)
Definition at line 70 of file sort.cpp.
Function Documentation
| BOOST_STATIC_ASSERT |
( |
std::numeric_limits< unsigned long long >::digits |
= =64 |
) |
|
| BOOST_STATIC_ASSERT |
( |
std::numeric_limits< unsigned int >::digits |
= =32 |
) |
|
| BOOST_STATIC_ASSERT |
( |
sizeof(unsigned long long) |
= =sizeof(double) |
) |
|
| BOOST_STATIC_ASSERT |
( |
sizeof(unsigned int) |
= =sizeof(int) |
) |
|
template<typename T>
| void quickSort |
( |
T * |
a, |
|
|
const int |
p, |
|
|
const int |
q | |
|
) |
| | [inline] |
template<>
| void radixSort |
( |
double * |
a, |
|
|
double * |
b, |
|
|
const unsigned int |
n | |
|
) |
| | [inline] |
template<>
| void radixSort |
( |
float * |
a, |
|
|
float * |
b, |
|
|
const unsigned int |
n | |
|
) |
| | [inline] |
template<>
| void radixSort |
( |
int * |
a, |
|
|
int * |
b, |
|
|
const unsigned int |
n | |
|
) |
| | [inline] |
template<>
| void radixSort |
( |
unsigned int * |
a, |
|
|
unsigned int * |
b, |
|
|
const unsigned int |
n | |
|
) |
| | [inline] |
template<>
| void radixSortIndices |
( |
double * |
a, |
|
|
unsigned int * |
indices, |
|
|
unsigned int * |
b, |
|
|
const unsigned int |
n | |
|
) |
| | [inline] |
template<>
| void radixSortIndices |
( |
unsigned int * |
a, |
|
|
unsigned int * |
indices, |
|
|
unsigned int * |
b, |
|
|
const unsigned int |
n | |
|
) |
| | [inline] |