IceRevisitedRadix.h
Go to the documentation of this file.
00001 
00002 
00008 
00009 
00011 // Include Guard
00012 #ifndef __ICERADIXSORT_H__
00013 #define __ICERADIXSORT_H__
00014 
00016         #define RADIX_LOCAL_RAM
00017 
00018         enum RadixHint
00019         {
00020                 RADIX_SIGNED,           
00021                 RADIX_UNSIGNED,         
00022 
00023                 RADIX_FORCE_DWORD = 0x7fffffff
00024         };
00025 
00026         class ICECORE_API RadixSort
00027         {
00028                 public:
00029                 // Constructor/Destructor
00030                                                                 RadixSort();
00031                                                                 ~RadixSort();
00032                 // Sorting methods
00033                                 RadixSort&              Sort(const udword* input, udword nb, RadixHint hint=RADIX_SIGNED);
00034                                 RadixSort&              Sort(const float* input, udword nb);
00035 
00037                 inline_ const udword*   GetRanks()                      const   { return mRanks;                }
00038 
00040                 inline_ udword*                 GetRecyclable()         const   { return mRanks2;               }
00041 
00042                 // Stats
00043                                 udword                  GetUsedRam()            const;
00045                 inline_ udword                  GetNbTotalCalls()       const   { return mTotalCalls;   }
00047                 inline_ udword                  GetNbHits()                     const   { return mNbHits;               }
00048 
00049                 private:
00050 #ifndef RADIX_LOCAL_RAM
00051                                 udword*                 mHistogram;                     
00052                                 udword*                 mOffset;                        
00053 #endif
00054                                 udword                  mCurrentSize;           
00055                                 udword*                 mRanks;                         
00056                                 udword*                 mRanks2;
00057                 // Stats
00058                                 udword                  mTotalCalls;            
00059                                 udword                  mNbHits;                        
00060                 // Internal methods
00061                                 void                    CheckResize(udword nb);
00062                                 bool                    Resize(udword nb);
00063         };
00064 
00065 #endif // __ICERADIXSORT_H__


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sun Apr 2 2017 03:43:54