Changeset 616 for trunk/test/svm_test.cc


Ignore:
Timestamp:
Aug 31, 2006, 10:52:02 AM (15 years ago)
Author:
Jari Häkkinen
Message:

Removed gslapi namespace and put the code into utility namespace.
Move #ifndef _header_ idiom to top of touched header files.
Removed unneccesary #includes, and added needed #includes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/svm_test.cc

    r527 r616  
    11// $Id$
    22
    3 #include <c++_tools/gslapi/matrix.h>
    4 #include <c++_tools/gslapi/vector.h>
    53#include <c++_tools/classifier/SVM.h>
    64#include <c++_tools/classifier/Kernel.h>
     
    97#include <c++_tools/classifier/Kernel_MEV.h>
    108#include <c++_tools/classifier/PolynomialKernelFunction.h>
     9#include <c++_tools/utility/matrix.h>
     10#include <c++_tools/utility/vector.h>
    1111
    1212#include <cassert>
     
    3232  bool ok = true;
    3333
    34   gslapi::matrix data2_core(2,3);
     34  utility::matrix data2_core(2,3);
    3535  data2_core(0,0)=0;
    3636  data2_core(1,0)=0;
     
    8888
    8989  std::ifstream is("data/nm_data_centralized.txt");
    90   gslapi::matrix data_core(is);
     90  utility::matrix data_core(is);
    9191  is.close();
    9292
     
    102102
    103103  is.open("data/nm_alpha_linear_matlab.txt");
    104   theplu::gslapi::vector alpha_matlab(is);
     104  theplu::utility::vector alpha_matlab(is);
    105105  is.close();
    106106
     
    112112  }
    113113
    114   theplu::gslapi::vector alpha = svm.alpha();
     114  theplu::utility::vector alpha = svm.alpha();
    115115     
    116116  // Comparing alpha to alpha_matlab
    117   theplu::gslapi::vector diff_alpha(alpha);
     117  theplu::utility::vector diff_alpha(alpha);
    118118  diff_alpha-=alpha_matlab;
    119119  if (diff_alpha*diff_alpha> 1e-10 ){
     
    123123
    124124  // Comparing output to target
    125   theplu::gslapi::vector output(svm.output());
     125  theplu::utility::vector output(svm.output());
    126126  double slack = 0;
    127127  for (unsigned int i=0; i<target.size(); i++){
Note: See TracChangeset for help on using the changeset viewer.