/** 
* @file KernelExp.h
* @brief Interface for the popular exponential mercer kernels
* @author Erik Rodner
* @date 10/24/2007

*/
#ifndef KERNELEXPINCLUDE
#define KERNELEXPINCLUDE

#include "Kernel.h"
#include "ParameterizedKernel.h"
#include "CachedQuadraticDistances.h"


namespace OBJREC {

/** Interface for the popular exponential mercer kernel / rbf kernel */
class KernelExp : public CachedQuadraticDistances
{

    protected:

		double gammasq;
		double sv;
		double noise;

    public:
  
		/** simple constructor */
		KernelExp( double loggamma, double logsv, double noise = 0.0 );

		KernelExp ( const KernelExp & src );
		  
		/** simple destructor */
		virtual ~KernelExp();
		 
		double K (const NICE::Vector & x, const NICE::Vector & y) const;

		void updateKernelData ( KernelData *kernelData ) const;
		void calcKernelData ( const NICE::VVector & X, KernelData *kernelData ) const;

		size_t getParameterSize () const { return 2; }; 

		void getKernelJacobi ( size_t parameter, const NICE::Vector & parameters, const KernelData *kernelData, NICE::Matrix & jacobiMatrix ) const;

		void setParameters( const NICE::Vector & newParameters );
		
		void getParameters( NICE::Vector & newParameters ) const;

		KernelExp *clone(void) const;

};


} // namespace

#endif
