GestureRecognitionToolkit  Version: 0.2.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
TimeSeriesClassificationSample.h
Go to the documentation of this file.
1 
29 #ifndef GRT_TIME_SERIES_CLASSIFICATION_SAMPLE_HEADER
30 #define GRT_TIME_SERIES_CLASSIFICATION_SAMPLE_HEADER
31 
32 #include "VectorFloat.h"
33 #include "MatrixFloat.h"
34 
35 GRT_BEGIN_NAMESPACE
36 
38 public:
40  TimeSeriesClassificationSample(const UINT classLabel,const MatrixFloat &data);
43 
45  if( this != &rhs){
46  this->classLabel = rhs.classLabel;
47  this->data = rhs.data;
48  }
49  return *this;
50  }
51 
52  inline Float* operator[] (const UINT &n){
53  return data[n];
54  }
55 
56  inline const Float* operator[] (const UINT &n) const {
57  return data[n];
58  }
59 
60  bool clear();
61  bool addSample( const UINT classLabel, const VectorFloat &sample );
62  bool setTrainingSample( const UINT classLabel, const MatrixFloat &data );
63  inline UINT getLength() const { return data.getNumRows(); }
64  inline UINT getNumDimensions() const { return data.getNumCols(); }
65  inline UINT getClassLabel() const { return classLabel; }
66  MatrixFloat &getData(){ return data; }
67  const MatrixFloat &getData() const { return data; }
68 
69 protected:
70  UINT classLabel;
71  MatrixFloat data;
72 };
73 
74 GRT_END_NAMESPACE
75 
76 #endif //GRT_LABELLED_TIME_SERIES_CLASSIFICATION_SAMPLE_HEADER
unsigned int getNumRows() const
Definition: Matrix.h:542
unsigned int getNumCols() const
Definition: Matrix.h:549