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.
VectorFloat Class Reference
Inheritance diagram for VectorFloat:
Vector< Float >

Public Member Functions

GRT_API VectorFloat ()
 
GRT_API VectorFloat (const size_type size)
 
GRT_API VectorFloat (const size_type size, const Float &value)
 
GRT_API VectorFloat (const VectorFloat &rhs)
 
virtual GRT_API ~VectorFloat ()
 
GRT_API VectorFloatoperator= (const VectorFloat &rhs)
 
GRT_API VectorFloatoperator= (const Vector< Float > &rhs)
 
GRT_API VectorFloatoperator= (const vector< VectorFloat > &rhs)
 
GRT_API bool save (const std::string &filename) const
 
GRT_API bool load (const std::string &filename, const char seperator= ',')
 
GRT_API bool print (const std::string title="") const
 
GRT_API bool scale (const Float minTarget, const Float maxTarget, const bool constrain=true)
 
GRT_API bool scale (const Float minSource, const Float maxSource, const Float minTarget, const Float maxTarget, const bool constrain=true)
 
GRT_API Float getMinValue () const
 
GRT_API Float getMaxValue () const
 
GRT_API Float getMean () const
 
GRT_API Float getStdDev () const
 
GRT_API MinMax getMinMax () const
 
- Public Member Functions inherited from Vector< Float >
 Vector (const unsigned int size=0)
 
 Vector (const unsigned int size, const Float &value)
 
 Vector (const Vector &rhs)
 
 Vector (const std::vector< Float > &rhs)
 
virtual ~Vector ()
 
Vectoroperator= (const Vector &rhs)
 
Vectoroperator= (const std::vector< Float > &rhs)
 
virtual bool resize (const unsigned int size)
 
virtual bool resize (const unsigned int size, const Float &value)
 
virtual bool copy (const Vector< Float > &rhs)
 
bool setAll (const Float &value)
 
UINT getSize () const
 
Float * getData ()
 
const Float * getData () const
 

Protected Attributes

WarningLog warningLog
 
ErrorLog errorLog
 

Detailed Description

Definition at line 33 of file VectorFloat.h.

Constructor & Destructor Documentation

GRT_BEGIN_NAMESPACE VectorFloat::VectorFloat ( )

Default Constructor

Definition at line 27 of file VectorFloat.cpp.

VectorFloat::VectorFloat ( const size_type  size)

Constructor, sets the size of the vector

Parameters
sizesets the size of the vector

Definition at line 32 of file VectorFloat.cpp.

VectorFloat::VectorFloat ( const size_type  size,
const Float &  value 
)

Constructor, sets the size of the vector and sets all elements to value

Parameters
sizesets the size of the vector
valuethe value that will be written to all elements in the vector

Definition at line 38 of file VectorFloat.cpp.

VectorFloat::VectorFloat ( const VectorFloat rhs)

Copy Constructor, copies the values from the rhs VectorFloat to this VectorFloat instance

Parameters
rhsthe VectorFloat from which the values will be copied

Definition at line 44 of file VectorFloat.cpp.

VectorFloat::~VectorFloat ( )
virtual

Destructor, cleans up any memory

Definition at line 49 of file VectorFloat.cpp.

Member Function Documentation

Float VectorFloat::getMaxValue ( ) const
Returns
returns the maximum value in the vector

Definition at line 124 of file VectorFloat.cpp.

Float VectorFloat::getMean ( ) const
Returns
returns the mean of the vector

Definition at line 134 of file VectorFloat.cpp.

MinMax VectorFloat::getMinMax ( ) const
Returns
returns the minimum and maximum values in the vector

Definition at line 162 of file VectorFloat.cpp.

Float VectorFloat::getMinValue ( ) const
Returns
returns the minimum value in the vector

Definition at line 114 of file VectorFloat.cpp.

Float VectorFloat::getStdDev ( ) const
Returns
returns the standard deviation of the vector

Definition at line 147 of file VectorFloat.cpp.

bool VectorFloat::load ( const std::string &  filename,
const char  seperator = ',' 
)

Loads a vector from a CSV file. This assumes that the data has been saved as rows and columns in the CSV file and that there are an equal number of columns per row.

This replaces the deprecated loadFromCSVFile function.

Parameters
filenamethe name of the CSV file
Returns
returns true or false, indicating if the data was loaded successful

Definition at line 204 of file VectorFloat.cpp.

VectorFloat & VectorFloat::operator= ( const VectorFloat rhs)

Defines how the data from the rhs VectorFloat should be copied to this VectorFloat

Parameters
rhsanother instance of a VectorFloat
Returns
returns a reference to this instance of the VectorFloat

Definition at line 53 of file VectorFloat.cpp.

VectorFloat & VectorFloat::operator= ( const Vector< Float > &  rhs)

Defines how the data from the rhs Vector< Float > should be copied to this VectorFloat

Parameters
rhsan instance of a Vector< Float >
Returns
returns a reference to this instance of the VectorFloat

Definition at line 64 of file VectorFloat.cpp.

GRT_API VectorFloat& VectorFloat::operator= ( const vector< VectorFloat > &  rhs)

Defines how the data from the rhs vector of VectorFloats should be copied to this VectorFloat

Parameters
rhsa vector of VectorFloats
Returns
returns a reference to this instance of the VectorFloat
bool VectorFloat::print ( const std::string  title = "") const

Prints the VectorFloat contents to std::cout

Parameters
titlesets the title of the data that will be printed to std::cout
Returns
returns true or false, indicating if the print was successful

Definition at line 75 of file VectorFloat.cpp.

bool VectorFloat::save ( const std::string &  filename) const

Saves the vector to a CSV file. This replaces the deprecated saveToCSVFile function.

Parameters
filenamethe name of the CSV file
Returns
returns true or false, indicating if the data was saved successful

Definition at line 178 of file VectorFloat.cpp.

bool VectorFloat::scale ( const Float  minTarget,
const Float  maxTarget,
const bool  constrain = true 
)

Scales the vector to a new range given by the min and max targets, this uses the minimum and maximum values in the existing vector as the minSource and maxSource for min-max scaling.

Returns
returns true if the vector was scaled, false otherwise

Definition at line 90 of file VectorFloat.cpp.

bool VectorFloat::scale ( const Float  minSource,
const Float  maxSource,
const Float  minTarget,
const Float  maxTarget,
const bool  constrain = true 
)

Scales the vector to a new range given by the min and max targets using the ranges as the source ranges.

Returns
returns true if the vector was scaled, false otherwise

Definition at line 97 of file VectorFloat.cpp.


The documentation for this class was generated from the following files: