IceRevisitedRadix.h
Go to the documentation of this file.
1 
8 
11 // Include Guard
12 #ifndef __ICERADIXSORT_H__
13 #define __ICERADIXSORT_H__
14 
16  #define RADIX_LOCAL_RAM
17 
18  enum RadixHint
19  {
22 
23  RADIX_FORCE_DWORD = 0x7fffffff
24  };
25 
27  {
28  public:
29  // Constructor/Destructor
30  RadixSort();
31  ~RadixSort();
32  // Sorting methods
33  RadixSort& Sort(const udword* input, udword nb, RadixHint hint=RADIX_SIGNED);
34  RadixSort& Sort(const float* input, udword nb);
35 
37  inline_ const udword* GetRanks() const { return mRanks; }
38 
40  inline_ udword* GetRecyclable() const { return mRanks2; }
41 
42  // Stats
43  udword GetUsedRam() const;
45  inline_ udword GetNbTotalCalls() const { return mTotalCalls; }
47  inline_ udword GetNbHits() const { return mNbHits; }
48 
49  private:
50 #ifndef RADIX_LOCAL_RAM
51  udword* mHistogram;
52  udword* mOffset;
53 #endif
57  // Stats
60  // Internal methods
61  void CheckResize(udword nb);
62  bool Resize(udword nb);
63  };
64 
65 #endif // __ICERADIXSORT_H__
udword mTotalCalls
Total number of calls to the sort routine.
udword mCurrentSize
Current size of the indices list.
udword * mRanks2
Input values are signed.
#define inline_
#define ICECORE_API
unsigned int udword
sizeof(udword) must be 4
Definition: IceTypes.h:65
inline_ udword * GetRecyclable() const
mIndices2 gets trashed on calling the sort routine, but otherwise you can recycle it the way you want...
inline_ udword GetNbHits() const
Returns the number of eraly exits due to temporal coherence.
inline_ const udword * GetRanks() const
Access to results. mRanks is a list of indices in sorted order, i.e. in the order you may further pro...
RadixHint
inline_ udword GetNbTotalCalls() const
Returns the total number of calls to the radix sorter.
inline_ void Sort(udword &id0, udword &id1)
Input values are unsigned.
udword * mRanks
Two lists, swapped each pass.
udword mNbHits
Number of early exits due to coherence.


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:03