12345678910111213141516171819202122232425262728293031323334353637 |
- /**
- * @file KernelStd.cpp
- * @brief Standard kernel
- * @author Erik Rodner
- * @date 10/24/2007
- */
- #include <iostream>
- #include "KernelStd.h"
- using namespace OBJREC;
- using namespace std;
- using namespace NICE;
- KernelStd::KernelStd() : Kernel(true)
- {
- }
- KernelStd::~KernelStd()
- {
- }
- double KernelStd::K (const NICE::Vector & x, const NICE::Vector & y) const
- {
- if ( x.size() != y.size() )
- fthrow (Exception, "KernelStd::K: vectors must have the same dimension\n");
- double sum = 0.0;
- for ( int i = 0 ; i < (int)x.size() ; i++ )
- sum += x[i] * y[i];
- return sum;
- }
|