Ignore:
Timestamp:
Sep 5, 2006, 10:31:04 AM (15 years ago)
Author:
Peter
Message:

fixes #125 removing obsolete function and cleaning in Kernel classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/c++_tools/classifier/GaussianKernelFunction.cc

    r627 r629  
    6969
    7070
    71   double GaussianKernelFunction::operator()(const DataLookup1D& a1,
    72                                             const DataLookup1D& a2,
    73                                             const DataLookup1D& w1,
    74                                             const DataLookup1D& w2) const   
    75   {
    76     assert(a1.size()==a2.size());
    77     assert(w1.size()==w2.size());
    78     assert(a1.size()==w1.size());
    79     double d2 = 0;
    80     double normalization_factor = 0;
    81     for (size_t i=0; i<a1.size(); i++) {
    82       // ignoring Nan with accompanied weight zero
    83       if (w1(i) && w2(i)){
    84         d2 += w1(i) * w2(i) * (a1(i)-a2(i)) * (a1(i)-a2(i));
    85         normalization_factor += w1(i) * w2(i);
    86       }
    87     }
    88     // to make it coherent with no weight case
    89     normalization_factor /= a1.size();
    90     return exp(d2/normalization_factor/sigma2_);
    91   }
    92  
    93 
    94 
    9571}} // of namespace svn and namespace theplu
Note: See TracChangeset for help on using the changeset viewer.