GestureRecognitionToolkit  Version: 0.1.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
ClassificationSample.h
Go to the documentation of this file.
1 
29 #ifndef GRT_CLASSIFICATION_SAMPLE_HEADER
30 #define GRT_CLASSIFICATION_SAMPLE_HEADER
31 
32 #include "../Util/GRTCommon.h"
33 
34 GRT_BEGIN_NAMESPACE
35 
37 public:
39  ClassificationSample(const UINT numDimensions);
40  ClassificationSample(const UINT classLabel,const VectorFloat &sample);
43 
44  ClassificationSample& operator= (const ClassificationSample &rhs){
45  if( this != &rhs){
46  this->classLabel = rhs.classLabel;
47  this->sample = rhs.sample;
48  this->numDimensions = rhs.numDimensions;
49  }
50  return *this;
51  }
52 
53  inline double& operator[] (const UINT &n){
54  return sample[n];
55  }
56 
57  inline const double& operator[] (const UINT &n) const{
58  return sample[n];
59  }
60 
61  bool clear();
62 
63  //Getters
64  UINT getNumDimensions() const{ return numDimensions; }
65  UINT getClassLabel() const{ return classLabel; }
66  VectorFloat getSample() const{ return sample; }
67 
68  //Setters
69  bool set(UINT classLabel,const VectorFloat &sample);
70  bool setClassLabel(const UINT classLabel);
71  bool setSample(const VectorFloat &sample);
72 
73 protected:
74  UINT numDimensions;
75  UINT classLabel;
76  VectorFloat sample;
77 
78 };
79 
80 GRT_END_NAMESPACE
81 
82 #endif // GRT_CLASSIFICATION_SAMPLE_HEADER