source: trunk/lib/svm/Kernel_mev.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 Author Date Id Revision
File size: 754 bytes
RevLine 
[25]1// $Id: Kernel_mev.cc 306 2005-05-03 06:59:02Z peter $
2
[295]3#include <c++_tools/svm/Kernel.h>
[25]4
[295]5#include <c++_tools/svm/KernelFunction.h>
6#include <c++_tools/gslapi/matrix.h>
7#include <c++_tools/gslapi/vector.h>
8
[42]9namespace theplu {
[295]10namespace svm { 
[25]11
[42]12Kernel::Kernel(const gslapi::matrix& data, const KernelFunction& kf)
[166]13  : k_(data.columns(),data.columns()), kf_(&kf), weighted_(false)
[25]14{
[163]15  k_ = kf(k_,data);
[166]16  kf_=0;
[25]17}
18
[67]19Kernel::Kernel(const gslapi::matrix& data, const KernelFunction& kf, 
20               const gslapi::matrix& weight)
[166]21  : k_(data.columns(),data.columns()), kf_(&kf), weighted_(true)
[67]22{
[163]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]);
[67]26 
27}
28
29
[33]30Kernel::~Kernel(void)
31{
32} 
[25]33
[295]34}} // of namespace svm and namespace theplu
Note: See TracBrowser for help on using the repository browser.