KernelLinearCombination.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * @file KernelLinearCombination.h
  3. * @brief Interface for linear kernel combination
  4. * @author Erik Rodner
  5. * @date 10/24/2007
  6. */
  7. #ifndef KERNELLINEARCOMBINATIONINCLUDE
  8. #define KERNELLINEARCOMBINATIONINCLUDE
  9. #include "Kernel.h"
  10. #include "ParameterizedKernel.h"
  11. namespace OBJREC {
  12. /** Interface for linear kernel combination */
  13. class KernelLinearCombination : public ParameterizedKernel
  14. {
  15. protected:
  16. NICE::Vector alpha;
  17. bool exponential;
  18. public:
  19. /** simple constructor */
  20. KernelLinearCombination( uint num, bool exponential = false );
  21. /** copy constructor */
  22. KernelLinearCombination ( const KernelLinearCombination & src );
  23. /** simple destructor */
  24. virtual ~KernelLinearCombination();
  25. /** clone this object */
  26. KernelLinearCombination *clone(void) const;
  27. /** compute the kernel value */
  28. double K (const NICE::Vector & x, const NICE::Vector & y) const;
  29. void updateKernelData ( KernelData *kernelData ) const;
  30. size_t getParameterSize () const { return alpha.size(); };
  31. void getKernelJacobi ( size_t parameter, const NICE::Vector & parameters, const KernelData *kernelData, NICE::Matrix & jacobiMatrix ) const;
  32. void setParameters( const NICE::Vector & newParameters );
  33. void getParameters( NICE::Vector & newParameters ) const;
  34. };
  35. } // namespace
  36. #endif