QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
radix.h
Go to the documentation of this file.
1 /*
2  * QuickRank - A C++ suite of Learning to Rank algorithms
3  * Webpage: http://quickrank.isti.cnr.it/
4  * Contact: quickrank@isti.cnr.it
5  *
6  * Unless explicitly acquired and licensed from Licensor under another
7  * license, the contents of this file are subject to the Reciprocal Public
8  * License ("RPL") Version 1.5, or subsequent versions as allowed by the RPL,
9  * and You may not copy or use this file in either source code or executable
10  * form, except in compliance with the terms and conditions of the RPL.
11  *
12  * All software distributed under the RPL is provided strictly on an "AS
13  * IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND
14  * LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
15  * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16  * PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the RPL for specific
17  * language governing rights and limitations under the RPL.
18  *
19  * Contributor:
20  * HPC. Laboratory - ISTI - CNR - http://hpc.isti.cnr.it/
21  */
22 #pragma once
23 
24 #include <memory>
25 
26 std::unique_ptr<size_t[]> idx_radixsort(float const *fvalues,
27  const size_t nvalues);
28 
29 //
30 // Functions belows are not used
31 //
32 
33 /*! sort an array of float values without modifing the input array and returning permuted indexes of the sorted items
34  * @param fvalues input float array
35  * @param nvalues length of \a fvalues
36  * @return indexes of ascending sorted \a fvalues
37  */
38 unsigned int *idxfloat_radixsort(float const *fvalues,
39  const unsigned int nvalues);
40 
41 enum sortorder {
44 };
45 
46 /*! sort an array of float values
47  * @param fvalues input float array
48  * @param nvalues length of \a fvalues
49  */
50 template<sortorder const order>
51 void float_radixsort(
52  float *fvalues, const unsigned int nvalues);
53 
54 /*! sort an array of float values with respect to another one without modifing the input array and returning permuted indexes of the sorted items
55  * @param extvalues input float array
56  * @param fvalues input float array
57  * @param nvalues length of \a fvalues
58  * @return a sorted copy of \a extvalues wrt \a fvalues
59  */
60 template<sortorder const order>
62  float const *extvalues, float const *fvalues, const unsigned int nvalues);
std::unique_ptr< size_t[]> idx_radixsort(float const *fvalues, const size_t nvalues)
Definition: radix.cc:35
float * copyextfloat_radixsort(float const *extvalues, float const *fvalues, const unsigned int nvalues)
Definition: radix.cc:162
Definition: radix.h:43
void float_radixsort(float *fvalues, const unsigned int nvalues)
Definition: radix.cc:120
Definition: radix.h:42
sortorder
Definition: radix.h:41
unsigned int * idxfloat_radixsort(float const *fvalues, const unsigned int nvalues)
Definition: radix.cc:80