00001 #ifndef _theplu_yat_classifier_kernel_lookup_
00002 #define _theplu_yat_classifier_kernel_lookup_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "Kernel.h"
00028 #include "yat/utility/Container2DIterator.h"
00029 #include "yat/utility/Index.h"
00030 #include "yat/utility/iterator_traits.h"
00031 #include "yat/utility/SmartPtr.h"
00032 #include "yat/utility/StrideIterator.h"
00033
00034 namespace theplu {
00035 namespace yat {
00036 namespace classifier {
00037
00038 class KernelFunction;
00039 class MatrixLookup;
00040 class MatrixLookupWeighted;
00041
00065 class KernelLookup
00066 {
00067
00068 public:
00074 typedef double value_type;
00075
00081 typedef const double const_reference;
00082
00084 typedef utility::StrideIterator<
00085 utility::Container2DIterator<const KernelLookup, value_type,
00086 const_reference> >
00087 const_iterator;
00088
00092 typedef const_iterator const_column_iterator;
00093
00097 typedef const_iterator const_row_iterator;
00098
00114 KernelLookup(const Kernel& kernel, const bool owner=false);
00115
00132 KernelLookup(const Kernel& kernel, const utility::Index& row,
00133 const utility::Index& column, const bool owner=false);
00134
00144 KernelLookup(const KernelLookup& kl);
00145
00146
00164 KernelLookup(const KernelLookup& kl, const utility::Index& row,
00165 const utility::Index& column);
00166
00179 KernelLookup(const KernelLookup& kl, const utility::Index&,
00180 const bool row=false);
00181
00188 virtual ~KernelLookup(void);
00189
00196 const_iterator begin(void) const;
00197
00203 const_column_iterator begin_column(size_t) const;
00204
00210 const_row_iterator begin_row(size_t) const;
00211
00215 size_t columns(void) const;
00216
00225 MatrixLookup data(void) const;
00226
00235 MatrixLookupWeighted data_weighted(void) const;
00236
00243 double element(const DataLookup1D& vec, size_t i) const;
00244
00254 double element(const DataLookupWeighted1D& vec, size_t i) const;
00255
00259 const_iterator end(void) const;
00260
00264 const_column_iterator end_column(size_t) const;
00265
00269 const_row_iterator end_row(size_t) const;
00270
00274 size_t rows(void) const;
00275
00282 KernelLookup selected(const utility::Index& index) const;
00283
00294 KernelLookup test_kernel(const MatrixLookup& data) const;
00295
00306 KernelLookup test_kernel(const MatrixLookupWeighted& data) const;
00307
00311 bool weighted(void) const;
00312
00317 const_reference operator()(size_t row, size_t column) const;
00318
00319 private:
00320 const KernelLookup& operator=(const KernelLookup&);
00321 bool validate(const utility::Index&) const;
00322
00323 utility::Index column_index_;
00324 utility::SmartPtr<const Kernel> kernel_;
00325 utility::Index row_index_;
00326
00327 };
00328
00329 }}}
00330
00331 #endif