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>
|
| 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...
|
|
|
void | sort (void) |
| this function create the sorted list More...
|
|
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 Needs a set of values for which the statistical values will calculate.
- Parameters
-
values | (vector<type>& the set) |
this function calculate the average of the giving set
It used zero, add and doubleDiv to calculate the average.
- Returns
- the average
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
this function calculate the range between the upper and under quartil.
This range is called inter-quartil-range.
use sub
- Returns
- the IQR
this function search the max.
value in the set
For this it use lower
- Returns
- the minimum
this function search the median of the giving set of values.
use add and doubleMul
- Returns
- the median
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
this function calculate the under quartil
use add and doubleMul
- Returns
- the under quartil
this function calculate the upper quartil.
use add and doubleMul
- Returns
- the upper quartil
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
this function create the sorted list
this list saves the sorted set
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: