KernelExp.cpp 678 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @file KernelExp.cpp
  3. * @brief Interface for the popular exponential mercer kernels
  4. * @author Erik Rodner
  5. * @date 10/24/2007
  6. */
  7. #include <iostream>
  8. #include <math.h>
  9. #include "vislearning/math/distances/KernelExp.h"
  10. using namespace OBJREC;
  11. using namespace std;
  12. // refactor-nice.pl: check this substitution
  13. // old: using namespace ice;
  14. using namespace NICE;
  15. KernelExp::KernelExp( NICE::VectorDistance<double> *_kInside, double _a ) : Kernel( true )
  16. {
  17. kInside = _kInside;
  18. a = _a;
  19. }
  20. KernelExp::~KernelExp()
  21. {
  22. delete kInside;
  23. }
  24. double KernelExp::K (const NICE::Vector & x, const NICE::Vector & y) const
  25. {
  26. return exp( - kInside->calculate (x,y) / a );
  27. }