IKMNoise.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * @file IKMNoise.h
  3. * @author Erik Rodner, Alexander Freytag
  4. * @brief Noise matrix (for model regularization) as an implicit kernel matrix (Interface)
  5. * @date 02/14/2012
  6. */
  7. #ifndef _NICE_IKMNOISEINCLUDE
  8. #define _NICE_IKMNOISEINCLUDE
  9. #include <vector>
  10. #include "ImplicitKernelMatrix.h"
  11. namespace NICE {
  12. /**
  13. * @class IKMNoise
  14. * @brief Noise matrix (for model regularization) as an implicit kernel matrix
  15. * @author Erik Rodner, Alexander Freytag
  16. */
  17. class IKMNoise : public ImplicitKernelMatrix
  18. {
  19. protected:
  20. Vector labels;
  21. uint size;
  22. double noise;
  23. bool optimizeNoise;
  24. uint np;
  25. uint nn;
  26. /** give some debug outputs. There is not set function so far... */
  27. bool verbose;
  28. public:
  29. IKMNoise();
  30. IKMNoise( uint size, double noise, bool optimizeNoise );
  31. IKMNoise( const Vector & labels, double noise, bool optimizeNoise );
  32. virtual ~IKMNoise();
  33. virtual void getDiagonalElements ( Vector & diagonalElements ) const;
  34. virtual void getFirstDiagonalElement ( double & diagonalElement ) const;
  35. virtual uint getNumParameters() const;
  36. virtual void getParameters(Vector & parameters) const;
  37. virtual void setParameters(const Vector & parameters);
  38. virtual bool outOfBounds(const Vector & parameters) const;
  39. virtual Vector getParameterLowerBounds() const;
  40. virtual Vector getParameterUpperBounds() const;
  41. /** multiply with a vector: A*x = y */
  42. virtual void multiply (NICE::Vector & y, const NICE::Vector & x) const;
  43. /** get the number of rows in A */
  44. virtual uint rows () const;
  45. /** get the number of columns in A */
  46. virtual uint cols () const;
  47. virtual double approxFrobNorm() const;
  48. virtual void setApproximationScheme(const int & _approxScheme) {};
  49. /** Persistent interface */
  50. virtual void restore ( std::istream & is, int format = 0 );
  51. virtual void store ( std::ostream & os, int format = 0 ) const;
  52. virtual void clear () {};
  53. };
  54. }
  55. #endif