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

Public Member Functions

 VectorFloat ()
 
 VectorFloat (const unsigned int size)
 
 VectorFloat (const unsigned int size, const Float &value)
 
 VectorFloat (const VectorFloat &rhs)
 
virtual ~VectorFloat ()
 
VectorFloatoperator= (const VectorFloat &rhs)
 
VectorFloatoperator= (const Vector< Float > &rhs)
 
VectorFloatoperator= (const vector< VectorFloat > &rhs)
 
bool save (const std::string &filename) const
 
bool load (const std::string &filename, const char seperator= ',')
 
bool print (const std::string title="") const
 
bool scale (const Float minTarget, const Float maxTarget, const bool constrain=true)
 
bool scale (const Float minSource, const Float maxSource, const Float minTarget, const Float maxTarget, const bool constrain=true)
 
Float getMinValue () const
 
Float getMaxValue () const
 
Float getMean () const
 
Float getStdDev () const
 
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)
 
unsigned int 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 26 of file VectorFloat.cpp.

VectorFloat::VectorFloat ( const unsigned int  size)

Constructor, sets the size of the vector

Parameters
sizesets the size of the vector

Definition at line 31 of file VectorFloat.cpp.

VectorFloat::VectorFloat ( const unsigned int  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 37 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 43 of file VectorFloat.cpp.

VectorFloat::~VectorFloat ( )
virtual

Destructor, cleans up any memory

Definition at line 48 of file VectorFloat.cpp.

Member Function Documentation

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

Definition at line 123 of file VectorFloat.cpp.

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

Definition at line 133 of file VectorFloat.cpp.

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

Definition at line 161 of file VectorFloat.cpp.

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

Definition at line 113 of file VectorFloat.cpp.

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

Definition at line 146 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 203 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 52 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 63 of file VectorFloat.cpp.

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 74 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 177 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 89 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 96 of file VectorFloat.cpp.


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