Ignore:
Timestamp:
Jun 8, 2005, 11:02:12 AM (17 years ago)
Author:
Jari Häkkinen
Message:

Made some efficiency changes in KernelFunctions?. Added a small test in kernel_test.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/svm/PolynomialKernelFunction.cc

    r295 r345  
    77#include <c++_tools/gslapi/vector.h>
    88
    9 #include <math.h>
     9#include <cmath>
    1010
    1111
     
    1616  : KernelFunction(), order_(order)
    1717{
    18 }
    19 
    20 double PolynomialKernelFunction::operator()(const gslapi::vector& a1,
    21                                             const gslapi::vector& a2) const   
    22 {
    23   if(order_>1)
    24     return pow(1+a1*a2,order_);
    25   return a1*a2;
    2618}
    2719
Note: See TracChangeset for help on using the changeset viewer.