Public Member Functions | Private Member Functions | Private Attributes | List of all members
RadixSort Class Reference

#include <IceRevisitedRadix.h>

Public Member Functions

inline_ udword GetNbHits () const
 Returns the number of eraly exits due to temporal coherence. More...
 
inline_ udword GetNbTotalCalls () const
 Returns the total number of calls to the radix sorter. More...
 
const inline_ udwordGetRanks () const
 Access to results. mRanks is a list of indices in sorted order, i.e. in the order you may further process your data. More...
 
inline_ udwordGetRecyclable () const
 mIndices2 gets trashed on calling the sort routine, but otherwise you can recycle it the way you want. More...
 
udword GetUsedRam () const
 
 RadixSort ()
 
RadixSortSort (const float *input, udword nb)
 
RadixSortSort (const udword *input, udword nb, RadixHint hint=RADIX_SIGNED)
 
 ~RadixSort ()
 

Private Member Functions

void CheckResize (udword nb)
 
bool Resize (udword nb)
 

Private Attributes

udword mCurrentSize
 Current size of the indices list. More...
 
udword mNbHits
 Number of early exits due to coherence. More...
 
udwordmRanks
 Two lists, swapped each pass. More...
 
udwordmRanks2
 
udword mTotalCalls
 Total number of calls to the sort routine. More...
 

Detailed Description

Revisited Radix Sort.
This is my new radix routine:

Definition at line 26 of file IceRevisitedRadix.h.

Constructor & Destructor Documentation

◆ RadixSort()

RadixSort::RadixSort ( )

Constructor.

Definition at line 170 of file IceRevisitedRadix.cpp.

◆ ~RadixSort()

RadixSort::~RadixSort ( )

Destructor.

Definition at line 186 of file IceRevisitedRadix.cpp.

Member Function Documentation

◆ CheckResize()

inline_ void RadixSort::CheckResize ( udword  nb)
private

Definition at line 217 of file IceRevisitedRadix.cpp.

◆ GetNbHits()

inline_ udword RadixSort::GetNbHits ( ) const
inline

Returns the number of eraly exits due to temporal coherence.

Definition at line 47 of file IceRevisitedRadix.h.

◆ GetNbTotalCalls()

inline_ udword RadixSort::GetNbTotalCalls ( ) const
inline

Returns the total number of calls to the radix sorter.

Definition at line 45 of file IceRevisitedRadix.h.

◆ GetRanks()

const inline_ udword* RadixSort::GetRanks ( ) const
inline

Access to results. mRanks is a list of indices in sorted order, i.e. in the order you may further process your data.

Definition at line 37 of file IceRevisitedRadix.h.

◆ GetRecyclable()

inline_ udword* RadixSort::GetRecyclable ( ) const
inline

mIndices2 gets trashed on calling the sort routine, but otherwise you can recycle it the way you want.

Definition at line 40 of file IceRevisitedRadix.h.

◆ GetUsedRam()

udword RadixSort::GetUsedRam ( ) const

Gets the ram used.

Returns
memory used in bytes

Definition at line 511 of file IceRevisitedRadix.cpp.

◆ Resize()

bool RadixSort::Resize ( udword  nb)
private

Resizes the inner lists.

Parameters
nb[in] new size (number of dwords)
Returns
true if success

Definition at line 204 of file IceRevisitedRadix.cpp.

◆ Sort() [1/2]

RadixSort & RadixSort::Sort ( const float *  input2,
udword  nb 
)

Main sort routine. This one is for floating-point values. After the call, mRanks contains a list of indices in sorted order, i.e. in the order you may process your data.

Parameters
input[in] a list of floating-point values to sort
nb[in] number of values to sort, must be < 2^31
Returns
Self-Reference
Warning
only sorts IEEE floating-point values

Definition at line 350 of file IceRevisitedRadix.cpp.

◆ Sort() [2/2]

RadixSort & RadixSort::Sort ( const udword input,
udword  nb,
RadixHint  hint = RADIX_SIGNED 
)

Main sort routine. This one is for integer values. After the call, mRanks contains a list of indices in sorted order, i.e. in the order you may process your data.

Parameters
input[in] a list of integer values to sort
nb[in] number of values to sort, must be < 2^31
hint[in] RADIX_SIGNED to handle negative values, RADIX_UNSIGNED if you know your input buffer only contains positive values
Returns
Self-Reference

Definition at line 238 of file IceRevisitedRadix.cpp.

Member Data Documentation

◆ mCurrentSize

udword RadixSort::mCurrentSize
private

Current size of the indices list.

Definition at line 54 of file IceRevisitedRadix.h.

◆ mNbHits

udword RadixSort::mNbHits
private

Number of early exits due to coherence.

Definition at line 59 of file IceRevisitedRadix.h.

◆ mRanks

udword* RadixSort::mRanks
private

Two lists, swapped each pass.

Definition at line 55 of file IceRevisitedRadix.h.

◆ mRanks2

udword* RadixSort::mRanks2
private

Definition at line 56 of file IceRevisitedRadix.h.

◆ mTotalCalls

udword RadixSort::mTotalCalls
private

Total number of calls to the sort routine.

Definition at line 58 of file IceRevisitedRadix.h.


The documentation for this class was generated from the following files:


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:05