source: trunk/lib/svm/Kernel_sev.cc @ 306

Last change on this file since 306 was 306, checked in by Peter, 18 years ago

splitted kernel in two versions SEV and MEV

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 754 bytes
RevLine 
[306]1// $Id: Kernel_sev.cc 306 2005-05-03 06:59:02Z peter $
2
3#include <c++_tools/svm/Kernel.h>
4
5#include <c++_tools/svm/KernelFunction.h>
6#include <c++_tools/gslapi/matrix.h>
7#include <c++_tools/gslapi/vector.h>
8
9namespace theplu {
10namespace svm { 
11
12Kernel::Kernel(const gslapi::matrix& data, const KernelFunction& kf)
13  : k_(data.columns(),data.columns()), kf_(&kf), weighted_(false)
14{
15  k_ = kf(k_,data);
16  kf_=0;
17}
18
19Kernel::Kernel(const gslapi::matrix& data, const KernelFunction& kf, 
20               const gslapi::matrix& weight)
21  : k_(data.columns(),data.columns()), kf_(&kf), weighted_(true)
22{
23  for(u_int i=0;i<data.columns();i++)
24    for(u_int j=i;j<data.columns();j++)
25      k_(i,j)=k_(j,i)=kf(data[i],data[j],weight[i],weight[j]);
26 
27}
28
29
30Kernel::~Kernel(void)
31{
32} 
33
34}} // of namespace svm and namespace theplu
Note: See TracBrowser for help on using the repository browser.