1 | // $Id$ |
---|
2 | |
---|
3 | /* |
---|
4 | Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson |
---|
5 | |
---|
6 | This file is part of the yat library, http://dev.thep.lu.se/yat |
---|
7 | |
---|
8 | The yat library is free software; you can redistribute it and/or |
---|
9 | modify it under the terms of the GNU General Public License as |
---|
10 | published by the Free Software Foundation; either version 3 of the |
---|
11 | License, or (at your option) any later version. |
---|
12 | |
---|
13 | The yat library is distributed in the hope that it will be useful, |
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with yat. If not, see <http://www.gnu.org/licenses/>. |
---|
20 | */ |
---|
21 | |
---|
22 | #include "FeatureSelector.h" |
---|
23 | #include "MatrixLookup.h" |
---|
24 | #include "MatrixLookupWeighted.h" |
---|
25 | |
---|
26 | #include <list> |
---|
27 | |
---|
28 | namespace theplu { |
---|
29 | namespace yat { |
---|
30 | namespace classifier { |
---|
31 | |
---|
32 | |
---|
33 | FeatureSelector::FeatureSelector(size_t N, size_t first) |
---|
34 | : first_(first), N_(N) |
---|
35 | { |
---|
36 | } |
---|
37 | |
---|
38 | |
---|
39 | FeatureSelector::~FeatureSelector() |
---|
40 | { |
---|
41 | } |
---|
42 | |
---|
43 | |
---|
44 | const utility::Index FeatureSelector::features(void) const |
---|
45 | { |
---|
46 | return features_; |
---|
47 | } |
---|
48 | |
---|
49 | |
---|
50 | const MatrixLookup FeatureSelector::get(const MatrixLookup& matrix) |
---|
51 | { |
---|
52 | return MatrixLookup(matrix, features_,true); |
---|
53 | } |
---|
54 | |
---|
55 | |
---|
56 | const MatrixLookupWeighted |
---|
57 | FeatureSelector::get(const MatrixLookupWeighted& matrix) |
---|
58 | { |
---|
59 | return MatrixLookupWeighted(matrix, features_, true); |
---|
60 | } |
---|
61 | |
---|
62 | }}} // of namespace classifier, yat, and theplu |
---|