Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IceRevisitedRadix.cpp File Reference
#include "Stdafx.h"

Go to the source code of this file.

Macros

#define INVALIDATE_RANKS   mCurrentSize|=0x80000000
 
#define VALIDATE_RANKS   mCurrentSize&=0x7fffffff
 
#define CURRENT_SIZE   (mCurrentSize&0x7fffffff)
 
#define INVALID_RANKS   (mCurrentSize&0x80000000)
 
#define CHECK_RESIZE(n)
 
#define CREATE_HISTOGRAMS(type, buffer)
 
#define CHECK_PASS_VALIDITY(pass)
 

Detailed Description

Contains source code from the article "Radix Sort Revisited".

Author
Pierre Terdiman
Date
April, 4, 2000

Definition in file IceRevisitedRadix.cpp.

Macro Definition Documentation

#define CHECK_PASS_VALIDITY (   pass)
Value:
/* Shortcut to current counters */ \
udword* CurCount = &mHistogram[pass<<8]; \
\
/* Reset flag. The sorting pass is supposed to be performed. (default) */ \
bool PerformPass = true; \
\
/* Check pass validity */ \
\
/* If all values have the same byte, sorting is useless. */ \
/* It may happen when sorting bytes or words instead of dwords. */ \
/* This routine actually sorts words faster than dwords, and bytes */ \
/* faster than words. Standard running time (O(4*n))is reduced to O(2*n) */ \
/* for words and O(n) for bytes. Running time for floats depends on actual values... */ \
\
/* Get first byte */ \
ubyte UniqueVal = *(((ubyte*)input)+pass); \
\
/* Check that byte's counter */ \
if(CurCount[UniqueVal]==nb) PerformPass=false;

Definition at line 145 of file IceRevisitedRadix.cpp.

#define CHECK_RESIZE (   n)
Value:
if(n!=mPreviousSize) \
{ \
if(n>mCurrentSize) Resize(n); \
else ResetRanks(); \
mPreviousSize = n; \
}

Definition at line 62 of file IceRevisitedRadix.cpp.

#define CREATE_HISTOGRAMS (   type,
  buffer 
)

Definition at line 70 of file IceRevisitedRadix.cpp.

#define CURRENT_SIZE   (mCurrentSize&0x7fffffff)

Definition at line 59 of file IceRevisitedRadix.cpp.

#define INVALID_RANKS   (mCurrentSize&0x80000000)

Definition at line 60 of file IceRevisitedRadix.cpp.

#define INVALIDATE_RANKS   mCurrentSize|=0x80000000

Definition at line 57 of file IceRevisitedRadix.cpp.

#define VALIDATE_RANKS   mCurrentSize&=0x7fffffff

Definition at line 58 of file IceRevisitedRadix.cpp.