1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- /**
- * @file GMHIKernel.h
- * @author Erik Rodner, Alexander Freytag
- * @brief Fast multiplication with histogram intersection kernel matrices (Interface)
- * @date 01/02/2012
- */
- #ifndef _NICE_GMHIKERNELINCLUDE
- #define _NICE_GMHIKERNELINCLUDE
- #include <vector>
- #include <core/algebra/GenericMatrix.h>
- #include "ImplicitKernelMatrix.h"
- #include "FeatureMatrixT.h"
- #include "FastMinKernel.h"
- namespace NICE {
- /**
- * @class GMHIKernel
- * @brief Fast multiplication with histogram intersection kernel matrices
- * @author Erik Rodner, Alexander Freytag
- */
- class GMHIKernel : public ImplicitKernelMatrix
- {
- protected:
- FastMinKernel *fmk;
- const Quantization *q;
- ParameterizedFunction *pf;
- bool verbose;
- bool use_sparse_implementation;
- bool useOldPreparation;
- public:
- /** simple constructor */
- GMHIKernel( FastMinKernel *_fmk, ParameterizedFunction *_pf = NULL, const Quantization *_q = NULL );
-
- /** multiply with a vector: A*x = y */
- virtual void multiply (NICE::Vector & y, const NICE::Vector & x) const;
- /** get the number of rows in A */
- virtual uint rows () const;
- /** get the number of columns in A */
- virtual uint cols () const;
- /** simple destructor */
- virtual ~GMHIKernel();
-
- /** get the diagonal elements of the current matrix */
- virtual void getDiagonalElements ( Vector & diagonalElements ) const;
- virtual void getFirstDiagonalElement ( double & diagonalElement ) const;
- uint getNumParameters() const;
- void getParameters(Vector & parameters) const;
- void setParameters(const Vector & parameters);
- bool outOfBounds(const Vector & parameters) const;
- Vector getParameterLowerBounds() const;
- Vector getParameterUpperBounds() const;
- void setVerbose( const bool & _verbose);
- void setUseOldPreparation( const bool & _useOldPreparation);
-
- virtual double approxFrobNorm() const;
- virtual void setApproximationScheme(const int & _approxScheme);
-
- /** Persistent interface */
- virtual void restore ( std::istream & is, int format = 0 ) {};//fmk->restore( is, format );};
- virtual void store ( std::ostream & os, int format = 0 ) const {};//fmk->store( os, format );};
- virtual void clear () {};
-
- void setFastMinKernel(NICE::FastMinKernel * _fmk){fmk = _fmk;};
-
- };
- }
- #endif
|