QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
Functions
radix.cc File Reference
#include "utils/radix.h"

Functions

unsigned int flip (unsigned int x)
 flip a float for sorting: if it's negative, it flips all bits otherwise flips the sign only More...
 
unsigned int iflip (unsigned int x)
 flip a float back (invert flip) More...
 
std::unique_ptr< size_t[]> idx_radixsort (float const *fvalues, const size_t nvalues)
 
unsigned int * idxfloat_radixsort (float const *fvalues, const unsigned int nvalues)
 
template<sortorder const order>
void float_radixsort (float *fvalues, const unsigned int nvalues)
 
template<sortorder const order>
float * copyextfloat_radixsort (float const *extvalues, float const *fvalues, const unsigned int nvalues)
 

Function Documentation

template<sortorder const order>
float* copyextfloat_radixsort ( float const *  extvalues,
float const *  fvalues,
const unsigned int  nvalues 
)

sort an array of float values with respect to another one without modifing the input array and returning permuted indexes of the sorted items

Parameters
extvaluesinput float array
fvaluesinput float array
nvalueslength of fvalues
Returns
a sorted copy of extvalues wrt fvalues
unsigned int flip ( unsigned int  x)
inline

flip a float for sorting: if it's negative, it flips all bits otherwise flips the sign only

template<sortorder const order>
void float_radixsort ( float *  fvalues,
const unsigned int  nvalues 
)

sort an array of float values

Parameters
fvaluesinput float array
nvalueslength of fvalues
std::unique_ptr<size_t[]> idx_radixsort ( float const *  fvalues,
const size_t  nvalues 
)
unsigned int* idxfloat_radixsort ( float const *  fvalues,
const unsigned int  nvalues 
)

sort an array of float values without modifing the input array and returning permuted indexes of the sorted items

Parameters
fvaluesinput float array
nvalueslength of fvalues
Returns
indexes of ascending sorted fvalues
unsigned int iflip ( unsigned int  x)
inline

flip a float back (invert flip)