4200 |
19 Aug 22 |
peter |
1 |
#ifndef _theplu_yat_classifier_ir_rank_ |
4200 |
19 Aug 22 |
peter |
2 |
#define _theplu_yat_classifier_ir_rank_ |
666 |
06 Oct 06 |
peter |
3 |
|
675 |
10 Oct 06 |
jari |
// $Id$ |
666 |
06 Oct 06 |
peter |
5 |
|
675 |
10 Oct 06 |
jari |
6 |
/* |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2006 Jari Häkkinen, Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2007 Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
675 |
10 Oct 06 |
jari |
10 |
|
1437 |
25 Aug 08 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
675 |
10 Oct 06 |
jari |
12 |
|
675 |
10 Oct 06 |
jari |
The yat library is free software; you can redistribute it and/or |
675 |
10 Oct 06 |
jari |
modify it under the terms of the GNU General Public License as |
1486 |
09 Sep 08 |
jari |
published by the Free Software Foundation; either version 3 of the |
675 |
10 Oct 06 |
jari |
License, or (at your option) any later version. |
675 |
10 Oct 06 |
jari |
17 |
|
675 |
10 Oct 06 |
jari |
The yat library is distributed in the hope that it will be useful, |
675 |
10 Oct 06 |
jari |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
675 |
10 Oct 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
675 |
10 Oct 06 |
jari |
General Public License for more details. |
675 |
10 Oct 06 |
jari |
22 |
|
675 |
10 Oct 06 |
jari |
You should have received a copy of the GNU General Public License |
1487 |
10 Sep 08 |
jari |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
675 |
10 Oct 06 |
jari |
25 |
*/ |
675 |
10 Oct 06 |
jari |
26 |
|
680 |
11 Oct 06 |
jari |
27 |
#include "InputRanker.h" |
680 |
11 Oct 06 |
jari |
28 |
#include "IRRetrieve.h" |
675 |
10 Oct 06 |
jari |
29 |
|
666 |
06 Oct 06 |
peter |
30 |
namespace theplu { |
680 |
11 Oct 06 |
jari |
31 |
namespace yat { |
4200 |
19 Aug 22 |
peter |
32 |
namespace classifier { |
666 |
06 Oct 06 |
peter |
33 |
|
666 |
06 Oct 06 |
peter |
34 |
/// |
767 |
22 Feb 07 |
peter |
/// @brief Functor retrieving minus rank from a InputRanker to build |
767 |
22 Feb 07 |
peter |
/// a ConsensusInputRanker. |
4200 |
19 Aug 22 |
peter |
37 |
/// |
666 |
06 Oct 06 |
peter |
38 |
class IRRank : public IRRetrieve |
666 |
06 Oct 06 |
peter |
39 |
{ |
666 |
06 Oct 06 |
peter |
40 |
|
666 |
06 Oct 06 |
peter |
41 |
public: |
666 |
06 Oct 06 |
peter |
42 |
/// |
666 |
06 Oct 06 |
peter |
/// @brief operator to retrieve information from @a ranker of |
666 |
06 Oct 06 |
peter |
/// input @a i. |
666 |
06 Oct 06 |
peter |
45 |
/// |
666 |
06 Oct 06 |
peter |
46 |
inline double operator()(const InputRanker& ranker, size_t i) const |
666 |
06 Oct 06 |
peter |
47 |
{ |
667 |
06 Oct 06 |
peter |
48 |
return -static_cast<double>(ranker.rank()[i]); |
666 |
06 Oct 06 |
peter |
49 |
} |
666 |
06 Oct 06 |
peter |
50 |
}; |
666 |
06 Oct 06 |
peter |
51 |
|
666 |
06 Oct 06 |
peter |
52 |
|
680 |
11 Oct 06 |
jari |
53 |
}}} // of namespace classifier, yat, and theplu |
666 |
06 Oct 06 |
peter |
54 |
|
666 |
06 Oct 06 |
peter |
55 |
#endif |