OGRE
1.9.0
|
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard STL containers. More...
#include <OgreRadixSort.h>
Classes | |
struct | SortEntry |
Public Types | |
typedef TContainer::iterator | ContainerIter |
Public Member Functions | |
RadixSort () | |
~RadixSort () | |
template<class TFunction > | |
void | sort (TContainer &container, TFunction func) |
Main sort function. | |
Protected Types | |
typedef std::vector< SortEntry, STLAllocator< SortEntry, GeneralAllocPolicy > > | SortVector |
Temp sort storage. | |
Protected Member Functions | |
void | finalPass (int byteIndex, float val) |
void | finalPass (int byteIndex, int val) |
template<typename T > | |
void | finalPass (int byteIndex, T val) |
unsigned char | getByte (int byteIndex, TCompValueType val) |
void | sortPass (int byteIndex) |
Protected Attributes | |
int | mCounters [4][256] |
Alpha-pass counters of values (histogram) 4 of them so we can radix sort a maximum of a 32bit value. | |
SortVector * | mDest |
int | mNumPasses |
Number of passes for this type. | |
int | mOffsets [256] |
Beta-pass offsets. | |
SortVector | mSortArea1 |
SortVector | mSortArea2 |
int | mSortSize |
Sort area size. | |
SortVector * | mSrc |
TContainer | mTmpContainer |
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard STL containers.
Definition at line 88 of file OgreRadixSort.h.
typedef TContainer::iterator Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::ContainerIter |
Definition at line 91 of file OgreRadixSort.h.
|
protected |
Temp sort storage.
Definition at line 113 of file OgreRadixSort.h.
Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::RadixSort | ( | ) |
Definition at line 237 of file OgreRadixSort.h.
Definition at line 238 of file OgreRadixSort.h.
|
protected |
Definition at line 180 of file OgreRadixSort.h.
References Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::getByte(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mCounters, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mOffsets, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSortSize, and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSrc.
|
protected |
Definition at line 147 of file OgreRadixSort.h.
References Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::getByte(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mCounters, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mOffsets, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSortSize, and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSrc.
|
protected |
Definition at line 140 of file OgreRadixSort.h.
References Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sortPass().
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort().
|
protected |
Definition at line 226 of file OgreRadixSort.h.
References Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mNumPasses.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort(), and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sortPass().
void Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort | ( | TContainer & | container, |
TFunction | func | ||
) |
Main sort function.
container | A container of the type you declared when declaring |
func | A functor which returns the value for comparison when given a container value |
Definition at line 246 of file OgreRadixSort.h.
References Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::getByte(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mCounters, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mDest, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mNumPasses, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSortArea1, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSortArea2, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSortSize, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSrc, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mTmpContainer, and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sortPass().
|
protected |
Definition at line 121 of file OgreRadixSort.h.
References Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::getByte(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mCounters, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mOffsets, Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSortSize, and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSrc.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort().
|
protected |
Alpha-pass counters of values (histogram) 4 of them so we can radix sort a maximum of a 32bit value.
Definition at line 95 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort(), and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sortPass().
|
protected |
Definition at line 117 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort().
|
protected |
Number of passes for this type.
Definition at line 101 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::getByte(), and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort().
|
protected |
Beta-pass offsets.
Definition at line 97 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sortPass().
|
protected |
Definition at line 114 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort().
|
protected |
Definition at line 115 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort().
|
protected |
Sort area size.
Definition at line 99 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort(), and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sortPass().
|
protected |
Definition at line 116 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass(), Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort(), and Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sortPass().
|
protected |
Definition at line 118 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort().