Ignore:
Timestamp:
Dec 15, 2005, 10:49:23 PM (17 years ago)
Author:
Peter
Message:

changed namespace svm to classifier in test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/kernel_test.cc

    r446 r453  
    66#include <c++_tools/gslapi/matrix.h>
    77#include <c++_tools/gslapi/vector.h>
    8 #include <c++_tools/svm/KernelFunction.h>
    9 #include <c++_tools/svm/PolynomialKernelFunction.h>
    10 #include <c++_tools/svm/GaussianKernelFunction.h>
    11 #include <c++_tools/svm/KernelView.h>
    12 #include <c++_tools/svm/Kernel_MEV.h>
    13 #include <c++_tools/svm/Kernel_SEV.h>
     8#include <c++_tools/classifier/KernelFunction.h>
     9#include <c++_tools/classifier/PolynomialKernelFunction.h>
     10#include <c++_tools/classifier/GaussianKernelFunction.h>
     11#include <c++_tools/classifier/KernelView.h>
     12#include <c++_tools/classifier/Kernel_MEV.h>
     13#include <c++_tools/classifier/Kernel_SEV.h>
    1414
    1515#include <cmath>
     
    2121using namespace theplu;
    2222
    23 bool test_MEV(const gslapi::matrix& data, const svm::KernelFunction* kf,
     23bool test_MEV(const gslapi::matrix& data, const classifier::KernelFunction* kf,
    2424              const gslapi::matrix& control, const double error_bound)
    2525{
    26   svm::Kernel_MEV kernel(data,*kf);
     26  classifier::Kernel_MEV kernel(data,*kf);
    2727  for(u_int i=0;i<control.rows();i++)
    2828    for(u_int j=0;j<control.columns();j++)
     
    3535  index[1]=2;
    3636  index[2]=3;
    37   svm::KernelView(kernel,index);
     37  classifier::KernelView(kernel,index);
    3838
    3939  return true;
    4040}
    4141
    42 bool test_SEV(const gslapi::matrix& data, const svm::KernelFunction* kf,
     42bool test_SEV(const gslapi::matrix& data, const classifier::KernelFunction* kf,
    4343              const gslapi::matrix& control, const double error_bound)
    4444{
    45   svm::Kernel_SEV kernel(data,*kf);
     45  classifier::Kernel_SEV kernel(data,*kf);
    4646  for(u_int i=0;i<control.rows();i++)
    4747    for(u_int j=0;j<control.columns();j++)
     
    5454  index[1]=2;
    5555  index[2]=3;
    56   svm::KernelView(kernel,index);
     56  classifier::KernelView(kernel,index);
    5757  return true;
    5858}
     
    8484  gslapi::matrix kernel_matlab(is);
    8585  is.close();
    86   svm::KernelFunction* kf = new svm::PolynomialKernelFunction();
     86  classifier::KernelFunction* kf = new classifier::PolynomialKernelFunction();
    8787  ok = (ok && test_MEV(data,kf,kernel_matlab,error_bound)
    8888        & test_SEV(data,kf,kernel_matlab,error_bound));
     
    9292  gslapi::matrix kernel_matlab2(is);
    9393  is.close();
    94   kf = new svm::PolynomialKernelFunction(2);
     94  kf = new classifier::PolynomialKernelFunction(2);
    9595  ok = (ok && test_MEV(data,kf,kernel_matlab2,error_bound)
    9696        & test_SEV(data,kf,kernel_matlab2,error_bound));
     
    9999  // Checking that a GaussianKernelFunction object can be built at
    100100  // compile time.
    101   kf = new svm::GaussianKernelFunction();
     101  kf = new classifier::GaussianKernelFunction();
    102102  delete kf;
    103103
Note: See TracChangeset for help on using the changeset viewer.