123456789101112131415161718192021222324252627282930 |
- /**
- * @file KernelStd.cpp
- * @brief Standard kernel
- * @author Erik Rodner
- * @date 10/24/2007
- */
- #include "KernelStd.h"
- using namespace OBJREC;
- KernelStd::KernelStd() : Kernel(true)
- {
- }
- KernelStd::~KernelStd()
- {
- }
- double KernelStd::K (const NICE::Vector & x, const NICE::Vector & y) const
- {
- if ( x.size() != y.size() )
- fthrow (NICE::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;
- }
|