yat/classifier/FeatureSelector.cc

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