source: trunk/lib/classifier/Kernel_SEV.cc @ 451

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

directory svm -> classifier

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 729 bytes
Line 
1// $Id: Kernel_SEV.cc 451 2005-12-15 21:09:12Z peter $
2
3#include <c++_tools/classifier/Kernel_SEV.h>
4
5#include <c++_tools/classifier/Kernel.h>
6#include <c++_tools/classifier/KernelFunction.h>
7#include <c++_tools/gslapi/matrix.h>
8#include <c++_tools/gslapi/vector.h>
9
10namespace theplu {
11namespace classifier { 
12
13
14Kernel_SEV::Kernel_SEV(const gslapi::matrix& data, const KernelFunction& kf)
15  : Kernel(data,kf), data_(data), kf_(&kf)
16{
17  kernel_matrix_ = gslapi::matrix(data.columns(),data.columns());
18  for (size_t i=0; i<kernel_matrix_.rows(); i++) 
19    for (size_t j=i; j<kernel_matrix_.columns(); j++) 
20      kernel_matrix_(i,j) = kernel_matrix_(j,i) =
21        (*kf_)(gslapi::vector(data_,i,false),gslapi::vector(data_,j,false));
22}
23
24
25}} // of namespace classifier and namespace theplu
Note: See TracBrowser for help on using the repository browser.