Ignore:
Timestamp:
Mar 1, 2006, 12:23:53 PM (16 years ago)
Author:
Peter
Message:

Modified Kernel to be built from MatrixLookup? rather than
gslapi::matrix. Also changed interface to create DataLookup1D from
DataLookup2D - is now coherent with gslapi.

File:
1 edited

Legend:

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

    r524 r527  
    33
    44#include <c++_tools/classifier/PolynomialKernelFunction.h>
     5#include <c++_tools/classifier/DataLookup1D.h>
    56
    67#include <c++_tools/gslapi/matrix.h>
     
    1920}
    2021
    21 double PolynomialKernelFunction::operator()(const gslapi::vector& a1,
    22                                             const gslapi::vector& a2,
    23                                             const gslapi::vector& w1,
    24                                             const gslapi::vector& w2) const   
     22double PolynomialKernelFunction::operator()(const DataLookup1D& a1,
     23                                            const DataLookup1D& a2,
     24                                            const DataLookup1D& w1,
     25                                            const DataLookup1D& w2) const   
    2526{
    2627  statistics::AveragerPairWeighted averager;
    27   averager.add(a1,a2,w1,w2);
     28  for (size_t i=0; i<a1.size(); i++)
     29    averager.add(a1(i),a2(i),w1(i),w2(i));
    2830
    2931  // a1.size() term to make it coherent with no weight case
Note: See TracChangeset for help on using the changeset viewer.