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.
VectorFloat.h
1 /*
2 GRT MIT License
3 Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 and associated documentation files (the "Software"), to deal in the Software without restriction,
7 including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in all copies or substantial
12 portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15 LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 */
20 
21 #ifndef GRT_VECTOR_FLOAT_HEADER
22 #define GRT_VECTOR_FLOAT_HEADER
23 
24 #include "..//Util/GRTTypedefs.h"
25 #include "Vector.h"
26 #include "../Util/MinMax.h"
27 #include "../Util/DebugLog.h"
28 #include "../Util/ErrorLog.h"
29 #include "../Util/WarningLog.h"
30 
31 GRT_BEGIN_NAMESPACE
32 
33 class VectorFloat : public Vector< Float >{
34 public:
38  VectorFloat();
39 
45  VectorFloat( const unsigned int size );
46 
53  VectorFloat( const unsigned int size, const Float &value );
54 
60  VectorFloat(const VectorFloat &rhs);
61 
65  virtual ~VectorFloat();
66 
73  VectorFloat& operator=(const VectorFloat &rhs);
74 
82 
89  VectorFloat& operator=(const vector< VectorFloat > &rhs);
90 
97  bool save(const std::string &filename) const;
98 
108  bool load(const std::string &filename,const char seperator = ',');
109 
116  bool print(const std::string title="") const;
117 
124  bool scale(const Float minTarget,const Float maxTarget,const bool constrain = true);
125 
131  bool scale(const Float minSource,const Float maxSource,const Float minTarget,const Float maxTarget,const bool constrain = true);
132 
136  Float getMinValue() const;
137 
141  Float getMaxValue() const;
142 
146  Float getMean() const;
147 
151  Float getStdDev() const;
152 
156  MinMax getMinMax() const;
157 
158 protected:
159 
160  WarningLog warningLog;
161  ErrorLog errorLog;
162 
163 };
164 
165 GRT_END_NAMESPACE
166 
167 #endif //Header guard
Float getMaxValue() const
The Vector class is a basic class for storing any type of data. The default Vector is an interface fo...
bool save(const std::string &filename) const
bool load(const std::string &filename, const char seperator= ',')
Float getMinValue() const
bool print(const std::string title="") const
Definition: VectorFloat.cpp:74
VectorFloat & operator=(const VectorFloat &rhs)
Definition: VectorFloat.cpp:52
bool scale(const Float minTarget, const Float maxTarget, const bool constrain=true)
Definition: VectorFloat.cpp:89
virtual ~VectorFloat()
Definition: VectorFloat.cpp:48
Definition: MinMax.h:29
Definition: Vector.h:41
Float getMean() const
Float getStdDev() const
MinMax getMinMax() const