Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TemplateValueAnalysation< type, zero, lower, higher, doubleDiv, doubleMul, add, sub, mul, div > Class Template Reference

This template class give you some methods to calculate some statistical values like average, min, max, upper quartil, lower quartil and many more. More...

#include <templatevalueanalysation.h>

Classes

struct  TYPE_SAVE
 help structur for sorting the set. More...
 

Public Member Functions

 TemplateValueAnalysation (std::vector< type > &values)
 constructor Needs a set of values for which the statistical values will calculate. More...
 
 ~TemplateValueAnalysation ()
 default destructor More...
 
type getAvg ()
 this function calculate the average of the giving set More...
 
type getMin ()
 this function search the min. More...
 
type getMax ()
 this function search the max. More...
 
type getRange ()
 this function calculate the range of all values. More...
 
type getMedian ()
 this function search the median of the giving set of values. More...
 
type getQuartil1 ()
 this function calculate the under quartil More...
 
type getQuartil3 ()
 this function calculate the upper quartil. More...
 
type getIQR ()
 this function calculate the range between the upper and under quartil. More...
 
type getWhisker (double factor)
 this function calculate the whisker distance More...
 
type getWhisker1 (double factor)
 this function search the lowest value in the set which is from under quartil inside the whisker distance More...
 
type getWhisker3 (double factor)
 this function search the highest value in the set which is from the upper quartil inside the whisker distance More...
 
unsigned int getNumExtrems (double factor)
 this function give you the number of elements in the giving set, which aren't in the whisker distance More...
 
type getExtrem (double factor, unsigned int i)
 this function gives one extreme value back More...
 
type getBest (void)
 this function search the value which is next to zero. More...
 

Protected Member Functions

void sort (void)
 this function create the sorted list More...
 

Protected Attributes

std::vector< type > & m_vector
 this vector save the giving set. More...
 
std::list< TYPE_SAVEm_list
 this list saves the sorted set More...
 
bool m_listCreated
 this variable remember if the sorted list is created More...
 

Detailed Description

template<class type, type zero, bool lower = defaultLower<type>, bool higher = defaultHigher<type>, type doubleDiv = defaultDoubleDiv<type>, type doubleMul = defaultDoubleMul<type>, type add = defaultAdd<type>, type sub = defaultSub<type>, type mul = defaultMul<type>, type div = defaultDiv<type>>
class TemplateValueAnalysation< type, zero, lower, higher, doubleDiv, doubleMul, add, sub, mul, div >

This template class give you some methods to calculate some statistical values like average, min, max, upper quartil, lower quartil and many more.

All functions are implemented in the header because by generating the library it isn't known which type are later used. And a later compiling needs the implementation two!

Constructor & Destructor Documentation

TemplateValueAnalysation ( std::vector< type > &  values)
inline

constructor Needs a set of values for which the statistical values will calculate.

Parameters
values(vector<type>& the set)

default destructor

Member Function Documentation

type getAvg ( )
inline

this function calculate the average of the giving set

It used zero, add and doubleDiv to calculate the average.

Returns
the average
type getBest ( void  )
inline

this function search the value which is next to zero.

use zero, sub and lower

Returns
the best value
type getExtrem ( double  factor,
unsigned int  i 
)
inline

this function gives one extreme value back

use lower, higher and zero

Parameters
factor(double) the factor for the whisker distance
i(unsigned int) the index of the searched extreme value
Returns
the founded extreme value
type getIQR ( )
inline

this function calculate the range between the upper and under quartil.

This range is called inter-quartil-range.

use sub

Returns
the IQR
type getMax ( )
inline

this function search the max.

value in the set

For this it use lower

Returns
the minimum
type getMedian ( )
inline

this function search the median of the giving set of values.

use add and doubleMul

Returns
the median
type getMin ( )
inline

this function search the min.

value in the set

For this it use lower

Returns
the minimum
unsigned int getNumExtrems ( double  factor)
inline

this function give you the number of elements in the giving set, which aren't in the whisker distance

use lower and higher

Parameters
factor(double) this factor is for calculating the whisker distance
Returns
(int) the number of extreme values in the set
type getQuartil1 ( )
inline

this function calculate the under quartil

use add and doubleMul

Returns
the under quartil
type getQuartil3 ( )
inline

this function calculate the upper quartil.

use add and doubleMul

Returns
the upper quartil
type getRange ( )
inline

this function calculate the range of all values.

For this he search the mibn and max and calculate from this values.

use sub

Returns
the range of the values in the set
type getWhisker ( double  factor)
inline

this function calculate the whisker distance

use doubleMul

Parameters
factor(double) the factor for this distance
Returns
the result
type getWhisker1 ( double  factor)
inline

this function search the lowest value in the set which is from under quartil inside the whisker distance

use sub, lower and zero

Parameters
factor(double) this factor is for calculating the whisker distance.
Returns
the lowest value inside
type getWhisker3 ( double  factor)
inline

this function search the highest value in the set which is from the upper quartil inside the whisker distance

use add and lower

Parameters
factor(double) this factor is for calculating the whisker distance.
Returns
the highest value inside
void sort ( void  )
inlineprotected

this function create the sorted list

Member Data Documentation

std::list<TYPE_SAVE> m_list
protected

this list saves the sorted set

bool m_listCreated
protected

this variable remember if the sorted list is created

std::vector<type>& m_vector
protected

this vector save the giving set.


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