This class implements a median determination value.
More...
|
template<typename T > |
static T | median2 (const T &v0, const T &v1) |
| Returns the median of two given values (the lower of both). More...
|
|
template<typename T > |
static T | median3 (const T &v0, const T &v1, const T &v2) |
| Returns the median of three given values. More...
|
|
template<typename T > |
static T | median4 (const T &v0, const T &v1, const T &v2, const T &v3) |
| Returns the median of four given values (the second smallest value). More...
|
|
template<typename T > |
static T | median5 (const T &v0, const T &v1, const T &v2, const T &v3, const T &v4) |
| Returns the median of five given values. More...
|
|
template<typename T > |
static T | median (T *values, const size_t number) |
| Returns the median value in a given data array. More...
|
|
template<typename T > |
static T | constMedian (const T *values, const size_t number) |
| Returns the median value in a given data array. More...
|
|
This class implements a median determination value.
◆ constMedian()
template<typename T >
T Ocean::Median::constMedian |
( |
const T * |
values, |
|
|
const size_t |
number |
|
) |
| |
|
static |
Returns the median value in a given data array.
If the given number is even, the median value is selected left from the exact center.
Beware: In the case one of the given values is not a number (nan) the result may be arbitrary as the comparison operator is not defined for such values.
- Parameters
-
values | Array with values from which the median will be determined, must be valid |
number | Number of values, with range [1, infinity) |
- Returns
- The median value out of 'values'
- Template Parameters
-
T | Type of the data for that the median has to be determined |
◆ median()
template<typename T >
T Ocean::Median::median |
( |
T * |
values, |
|
|
const size_t |
number |
|
) |
| |
|
static |
Returns the median value in a given data array.
If the given number is even, the median value is selected left from the exact center.
Beware: In the case one of the given values is not a number (nan) the result may be arbitrary as the comparison operator is not defined for such values.
- Parameters
-
values | Array with values that will be reordered during the execution, must be valid |
number | Number of values, with range [1, infinity) |
- Returns
- The median value out of 'values'
- Template Parameters
-
T | Type of the data for that the median has to be determined |
◆ median2()
template<typename T >
T Ocean::Median::median2 |
( |
const T & |
v0, |
|
|
const T & |
v1 |
|
) |
| |
|
inlinestatic |
Returns the median of two given values (the lower of both).
Beware: In the case one of the given values is not a number (nan) the result may be arbitrary as the comparison operator is not defined for such values.
- Parameters
-
v0 | First value |
v1 | Second value |
- Returns
- Resulting median
- Template Parameters
-
T | Data type of the data elements |
◆ median3()
template<typename T >
T Ocean::Median::median3 |
( |
const T & |
v0, |
|
|
const T & |
v1, |
|
|
const T & |
v2 |
|
) |
| |
|
inlinestatic |
Returns the median of three given values.
Beware: In the case one of the given values is not a number (nan) the result may be arbitrary as the comparison operator is not defined for such values.
- Parameters
-
v0 | First value |
v1 | Second value |
v2 | Third value |
- Returns
- Resulting median
- Template Parameters
-
T | Data type of the data elements |
◆ median4()
template<typename T >
T Ocean::Median::median4 |
( |
const T & |
v0, |
|
|
const T & |
v1, |
|
|
const T & |
v2, |
|
|
const T & |
v3 |
|
) |
| |
|
inlinestatic |
Returns the median of four given values (the second smallest value).
Beware: In the case one of the given values is not a number (nan) the result may be arbitrary as the comparison operator is not defined for such values.
- Parameters
-
v0 | First value |
v1 | Second value |
v2 | Third value |
v3 | Fourth value |
- Returns
- Resulting median
- Template Parameters
-
T | Data type of the data elements |
◆ median5()
template<typename T >
T Ocean::Median::median5 |
( |
const T & |
v0, |
|
|
const T & |
v1, |
|
|
const T & |
v2, |
|
|
const T & |
v3, |
|
|
const T & |
v4 |
|
) |
| |
|
inlinestatic |
Returns the median of five given values.
Beware: In the case one of the given values is not a number (nan) the result may be arbitrary as the comparison operator is not defined for such values.
- Parameters
-
v0 | First value |
v1 | Second value |
v2 | Third value |
v3 | Fourth value |
v4 | Fifth value |
- Returns
- Resulting median
- Template Parameters
-
T | Data type of the data elements |
The documentation for this class was generated from the following file: