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
|
Rev | Line | |
---|
[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 | |
---|
| 9 | namespace theplu { |
---|
| 10 | namespace svm { |
---|
| 11 | |
---|
| 12 | Kernel::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 | |
---|
| 19 | Kernel::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 | |
---|
| 30 | Kernel::~Kernel(void) |
---|
| 31 | { |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | }} // of namespace svm and namespace theplu |
---|
Note: See
TracBrowser
for help on using the repository browser.