/** 
* @file KernelLinearCombination.h
* @brief Interface for linear kernel combination 
* @author Erik Rodner
* @date 10/24/2007

*/
#ifndef KERNELLINEARCOMBINATIONINCLUDE
#define KERNELLINEARCOMBINATIONINCLUDE

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

namespace OBJREC {

/** Interface for linear kernel combination */
class KernelLinearCombination : public ParameterizedKernel
{

    protected:

		NICE::Vector alpha;
		bool exponential;

    public:
  
		/** simple constructor */
		KernelLinearCombination( uint num, bool exponential = false );

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

		/** clone this object */
		KernelLinearCombination *clone(void) const;
		 
		/** compute the kernel value */
		double K (const NICE::Vector & x, const NICE::Vector & y) const;

		void updateKernelData ( KernelData *kernelData ) const;

		size_t getParameterSize () const { return alpha.size(); }; 

		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