28#ifndef __RadixSort_H__
29#define __RadixSort_H__
87 template <
class TContainer,
class TContainerValueType,
typename TCompValueType>
113 typedef std::vector<SortEntry, STLAllocator<SortEntry, GeneralAllocPolicy> >
SortVector;
126 for (
int i = 1;
i < 256; ++
i)
139 template <
typename T>
151 for (
int i = 128;
i < 256; ++
i)
158 for (
int i = 1;
i < 128; ++
i)
165 for (
int i = 129;
i < 256; ++
i)
187 for (
int i = 128;
i < 256; ++
i)
194 for (
int i = 1;
i < 128; ++
i)
204 for (
int i = 254;
i > 127; --
i)
228#if OGRE_ENDIAN == OGRE_ENDIAN_LITTLE
229 return ((
unsigned char*)(&val))[
byteIndex];
245 template <
class TFunction>
319 *
i = *((*mDest)[
c].iter);
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard...
int mNumPasses
Number of passes for this type.
int mOffsets[256]
Beta-pass offsets.
void sortPass(int byteIndex)
void sort(TContainer &container, TFunction func)
Main sort function.
std::vector< SortEntry, STLAllocator< SortEntry, GeneralAllocPolicy > > SortVector
Temp sort storage.
void finalPass(int byteIndex, float val)
int mSortSize
Sort area size.
void finalPass(int byteIndex, int val)
unsigned char getByte(int byteIndex, TCompValueType val)
int mCounters[4][256]
Alpha-pass counters of values (histogram) 4 of them so we can radix sort a maximum of a 32bit value.
void finalPass(int byteIndex, T val)
TContainer::iterator ContainerIter
Reference-counted shared pointer, used for objects where implicit destruction is required.
SortEntry(TCompValueType k, ContainerIter it)