Ignore:
Timestamp:
Feb 26, 2004, 4:06:20 PM (18 years ago)
Author:
Jari Häkkinen
Message:

Made a major revision of matrix and vector classes. Everything compiles
but the binaries have not been tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PolynomialKernelFunction.cc

    r30 r42  
    44#include <math.h>
    55
    6 
    76// Thep C++ Tools
    87#include "PolynomialKernelFunction.h"
    98#include "vector.h"
    109
    11 using namespace thep_cpp_tools;
    12 using namespace std;
     10
     11namespace theplu {
     12namespace cpptools { 
    1313
    1414PolynomialKernelFunction::PolynomialKernelFunction(int order)
     
    1717}
    1818
    19 double PolynomialKernelFunction::operator()(const thep_gsl_api::vector a,
    20               const thep_gsl_api::vector b) const   
     19double PolynomialKernelFunction::operator()(const gslapi::vector& a,
     20                                            const gslapi::vector& b) const   
    2121{
     22  using namespace std;
     23
    2224  u_int nof_valid_datapairs = 0;
    2325  double tmp = 0;
     
    2729  for(u_int k=0; k<a.size(); k++)
    2830    // Check that both a and b are Numbers (NaN is NOT equal to NaN)
    29     if (a.get(k) == a.get(k) & b.get(k) == b.get(k)) {
    30      tmp += a.get(k)*b.get(k);
     31    if (a(k) == a(k) & b(k) == b(k)) {
     32     tmp += a(k)*b(k);
    3133     nof_valid_datapairs++;
    3234    }
     
    4345}
    4446
     47}} // of namespace cpptools and namespace theplu
Note: See TracChangeset for help on using the changeset viewer.