ClusterOnline.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #include "core/vector/VectorT.h"
  10. #include "core/vector/MatrixT.h"
  11. #include <vector>
  12. #include <string>
  13. #include "core/vector/VVector.h"
  14. #include "ClusterAlgorithm.h"
  15. namespace OBJREC {
  16. /** interface for online clustering */
  17. class ClusterOnline : public ClusterAlgorithm
  18. {
  19. protected:
  20. public:
  21. NICE::VVector clusters;
  22. std::vector<double> weights;
  23. /** simple constructor */
  24. ClusterOnline();
  25. /** simple destructor */
  26. virtual ~ClusterOnline();
  27. /** interface to offline cluster algorithms */
  28. void cluster (
  29. const NICE::VVector & features,
  30. NICE::VVector & prototypes,
  31. std::vector<double> & weights,
  32. std::vector<int> & assignment );
  33. /** important virtual function: update clusters in current step
  34. @param x current vector
  35. @return returns index of nearest cluster
  36. */
  37. virtual int updateClusters ( const NICE::Vector & x ) = 0;
  38. /** init stuff */
  39. virtual void init ();
  40. };
  41. } // namespace
  42. #endif