yat  0.16pre
KernelLookup.h
1 #ifndef _theplu_yat_classifier_kernel_lookup_
2 #define _theplu_yat_classifier_kernel_lookup_
3 
4 // $Id: KernelLookup.h 3330 2014-10-14 08:03:25Z 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, 2012 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/StrideIterator.h"
33 
34 #include <boost/shared_ptr.hpp>
35 
36 namespace theplu {
37 namespace yat {
38 namespace classifier {
39 
40  class KernelFunction;
41  class MatrixLookup;
42  class MatrixLookupWeighted;
43 
68  {
69 
70  public:
76  typedef double value_type;
77 
83  typedef const double const_reference;
84 
87  utility::Container2DIterator<const KernelLookup, const double,
88  const_reference> >
90 
95 
100 
116  KernelLookup(const Kernel& kernel, const bool owner=false);
117 
134  KernelLookup(const Kernel& kernel, const utility::Index& row,
135  const utility::Index& column, const bool owner=false);
136 
146  KernelLookup(const KernelLookup& kl);
147 
148 
166  KernelLookup(const KernelLookup& kl, const utility::Index& row,
167  const utility::Index& column);
168 
181  KernelLookup(const KernelLookup& kl, const utility::Index&,
182  const bool row=false);
183 
190  virtual ~KernelLookup(void);
191 
198  const_iterator begin(void) const;
199 
205  const_column_iterator begin_column(size_t) const;
206 
212  const_row_iterator begin_row(size_t) const;
213 
217  size_t columns(void) const;
218 
227  MatrixLookup data(void) const;
228 
238 
245  double element(const DataLookup1D& vec, size_t i) const;
246 
256  double element(const DataLookupWeighted1D& vec, size_t i) const;
257 
261  const_iterator end(void) const;
262 
266  const_column_iterator end_column(size_t) const;
267 
271  const_row_iterator end_row(size_t) const;
272 
276  size_t rows(void) const;
277 
284  KernelLookup selected(const utility::Index& index) const;
285 
296  KernelLookup test_kernel(const MatrixLookup& data) const;
297 
308  KernelLookup test_kernel(const MatrixLookupWeighted& data) const;
309 
313  bool weighted(void) const;
314 
319  const_reference operator()(size_t row, size_t column) const;
320 
321  private:
322  const KernelLookup& operator=(const KernelLookup&);
323  bool validate(const utility::Index&) const;
324 
325  utility::Index column_index_;
326  boost::shared_ptr<const Kernel> kernel_;
327  utility::Index row_index_;
328  }; // class KernelLookup
329 
330 }}} // of namespace classifier, yat, and theplu
331 
332 #endif
General view into utility::Matrix.
Definition: MatrixLookup.h:70
const_iterator end(void) const
Interface Class for Kernels.
Definition: Kernel.h:57
The Department of Theoretical Physics namespace as we define it.
Class for general vector view.
Definition: DataLookup1D.h:43
const_reference operator()(size_t row, size_t column) const
KernelLookup test_kernel(const MatrixLookup &data) const
utility::StrideIterator< utility::Container2DIterator< const KernelLookup, const double, const_reference > > const_iterator
&#39;Read Only&#39; iterator
Definition: KernelLookup.h:89
double element(const DataLookup1D &vec, size_t i) const
MatrixLookup data(void) const
Class for storing indices of, e.g., a MatrixLookup.
Definition: Index.h:41
Iterator for a Container2D.
Definition: Container2DIterator.h:61
const_column_iterator end_column(size_t) const
MatrixLookupWeighted data_weighted(void) const
General view into utility::MatrixWeighted.
Definition: MatrixLookupWeighted.h:63
const_iterator const_column_iterator
Definition: KernelLookup.h:94
Lookup into Kernel.
Definition: KernelLookup.h:67
const_iterator const_row_iterator
Definition: KernelLookup.h:99
const_column_iterator begin_column(size_t) const
KernelLookup(const Kernel &kernel, const bool owner=false)
Constructor a Lookup into a Kernel.
double value_type
Definition: KernelLookup.h:76
virtual ~KernelLookup(void)
Destructor.
KernelLookup selected(const utility::Index &index) const
const_iterator begin(void) const
Class for general weighted vector view.
Definition: DataLookupWeighted1D.h:43
const double const_reference
Definition: KernelLookup.h:83
const_row_iterator begin_row(size_t) const
Adaptor using a stride on underlying iterator.
Definition: StrideIterator.h:50
const_row_iterator end_row(size_t) const

Generated on Thu Jan 10 2019 02:54:19 for yat by  doxygen 1.8.11