yat  0.9.3pre
KernelLookup.h
1 #ifndef _theplu_yat_classifier_kernel_lookup_
2 #define _theplu_yat_classifier_kernel_lookup_
3 
4 // $Id: KernelLookup.h 2384 2010-12-22 14:03:36Z peter $
5 
6 /*
7  Copyright (C) 2005 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
9  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
10  Copyright (C) 2010 Peter Johansson
11 
12  This file is part of the yat library, http://dev.thep.lu.se/yat
13 
14  The yat library is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License as
16  published by the Free Software Foundation; either version 3 of the
17  License, or (at your option) any later version.
18 
19  The yat library is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with yat. If not, see <http://www.gnu.org/licenses/>.
26 */
27 
28 #include "Kernel.h"
29 #include "yat/utility/Container2DIterator.h"
30 #include "yat/utility/Index.h"
31 #include "yat/utility/iterator_traits.h"
32 #include "yat/utility/SmartPtr.h"
33 #include "yat/utility/StrideIterator.h"
34 
35 namespace theplu {
36 namespace yat {
37 namespace classifier {
38 
39  class KernelFunction;
40  class MatrixLookup;
41  class MatrixLookupWeighted;
42 
67  {
68 
69  public:
75  typedef double value_type;
76 
82  typedef const double const_reference;
83 
86  utility::Container2DIterator<const KernelLookup, const double,
89 
94 
99 
115  KernelLookup(const Kernel& kernel, const bool owner=false);
116 
133  KernelLookup(const Kernel& kernel, const utility::Index& row,
134  const utility::Index& column, const bool owner=false);
135 
145  KernelLookup(const KernelLookup& kl);
146 
147 
165  KernelLookup(const KernelLookup& kl, const utility::Index& row,
166  const utility::Index& column);
167 
180  KernelLookup(const KernelLookup& kl, const utility::Index&,
181  const bool row=false);
182 
189  virtual ~KernelLookup(void);
190 
197  const_iterator begin(void) const;
198 
204  const_column_iterator begin_column(size_t) const;
205 
211  const_row_iterator begin_row(size_t) const;
212 
216  size_t columns(void) const;
217 
226  MatrixLookup data(void) const;
227 
237 
244  double element(const DataLookup1D& vec, size_t i) const;
245 
255  double element(const DataLookupWeighted1D& vec, size_t i) const;
256 
260  const_iterator end(void) const;
261 
265  const_column_iterator end_column(size_t) const;
266 
270  const_row_iterator end_row(size_t) const;
271 
275  size_t rows(void) const;
276 
283  KernelLookup selected(const utility::Index& index) const;
284 
296 
308 
312  bool weighted(void) const;
313 
318  const_reference operator()(size_t row, size_t column) const;
319 
320  private:
321  const KernelLookup& operator=(const KernelLookup&);
322  bool validate(const utility::Index&) const;
323 
324  utility::Index column_index_;
326  utility::Index row_index_;
327 
328  }; // class KernelLookup
329 
330 }}} // of namespace classifier, yat, and theplu
331 
332 #endif

Generated on Tue Jan 29 2013 02:33:38 for yat by  doxygen 1.8.1