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

*/
#ifndef KERNELRBFINCLUDE
#define KERNELRBFINCLUDE

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


namespace OBJREC {

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

    protected:

	double gammasq;
	double noise;

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

	/** copy constructor */
	KernelRBF ( const KernelRBF & src );
      
	/** simple destructor */
	virtual ~KernelRBF();

	/** clone this object */
	KernelRBF *clone(void) const;
     
	/** compute the kernel value */
	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 1; }; 

	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;

};


} // namespace

#endif
