ClusterOnline.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * @file ClusterOnline.h
  3. * @brief interface for online clustering
  4. * @author Erik Rodner
  5. * @date 02/13/2008
  6. */
  7. #ifndef CLUSTERONLINEINCLUDE
  8. #define CLUSTERONLINEINCLUDE
  9. #ifdef NOVISUAL
  10. #include <vislearning/nice_nonvis.h>
  11. #else
  12. #include <vislearning/nice.h>
  13. #endif
  14. #include <vector>
  15. #include <string>
  16. #include "core/vector/VVector.h"
  17. #include "ClusterAlgorithm.h"
  18. namespace OBJREC {
  19. /** interface for online clustering */
  20. class ClusterOnline : public ClusterAlgorithm
  21. {
  22. protected:
  23. public:
  24. NICE::VVector clusters;
  25. std::vector<double> weights;
  26. /** simple constructor */
  27. ClusterOnline();
  28. /** simple destructor */
  29. virtual ~ClusterOnline();
  30. /** interface to offline cluster algorithms */
  31. void cluster (
  32. const NICE::VVector & features,
  33. NICE::VVector & prototypes,
  34. std::vector<double> & weights,
  35. std::vector<int> & assignment );
  36. /** important virtual function: update clusters in current step
  37. @param x current vector
  38. @return returns index of nearest cluster
  39. */
  40. virtual int updateClusters ( const NICE::Vector & x ) = 0;
  41. /** init stuff */
  42. virtual void init ();
  43. };
  44. } // namespace
  45. #endif