source: trunk/c++_tools/classifier/Kernel_MEV.cc @ 628

Last change on this file since 628 was 628, checked in by Peter, 16 years ago

fixes #116 and #90 removed classes KernelWeighted_SEV and KernelWeighted_MEV and they're now absorbed into Kernel_SEV and Kernel_MEV, respectively.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date ID
File size: 1.0 KB
Line 
1// $Id$
2
3#include <c++_tools/classifier/Kernel_MEV.h>
4
5#include <c++_tools/classifier/DataLookup1D.h>
6#include <c++_tools/classifier/DataLookupWeighted1D.h>
7
8namespace theplu {
9namespace classifier { 
10
11  Kernel_MEV::Kernel_MEV(const MatrixLookup& data, const KernelFunction& kf)
12    : Kernel(data,kf) 
13  {
14  }
15
16
17  Kernel_MEV::Kernel_MEV(const MatrixLookupWeighted& data, 
18                         const KernelFunction& kf)
19    : Kernel(data,kf) 
20  {
21  }
22
23
24  Kernel_MEV::Kernel_MEV(const Kernel_MEV& kernel, 
25                         const std::vector<size_t>& index)
26    : Kernel(kernel,index)
27  {
28  }
29
30
31  double Kernel_MEV::operator()(const size_t row, const size_t column) const
32  { 
33    if (data_w_)
34      return (*kf_)(DataLookupWeighted1D(*data_w_,row,false),
35                    DataLookupWeighted1D(*data_w_,column,false)); 
36    else
37      return (*kf_)(DataLookup1D(*data_,row,false),
38                    DataLookup1D(*data_,column,false)); 
39  }
40
41
42  const Kernel_MEV* Kernel_MEV::selected(const std::vector<size_t>& index) const
43  {
44    return new Kernel_MEV(*this, index);
45  }
46
47
48
49}} // of namespace classifier and namespace theplu
Note: See TracBrowser for help on using the repository browser.