Go to the source code of this file.
Defines | |
| #define | INC_UTIL_STAT_H |
| util/stat.h included. | |
| #define | VALTYPE double |
| Scalar type. | |
| #define | VALTYPE_IS_FLOAT 1 |
| Define to be 1 if the scalar type is a floating point type. | |
| #define | VTMANGLE(x) stat_##x |
| Define to generate an alternative set of names. | |
| #define | VALTYPE_STD_COMPARE 1 |
| Define to 1 to enable automatic comparison function generation. | |
Functions | |
| void VTMANGLE() | CalcBasicStats (const VALTYPE *x, size_t n, VALTYPE *p_min, VALTYPE *p_max, VALTYPE *p_mean, VALTYPE *p_median) |
| Returns the min, mean, median, and max values of the given array. | |
| void VTMANGLE() | CalcMinMaxMean (const VALTYPE *x, size_t n, VALTYPE *p_min, VALTYPE *p_max, VALTYPE *p_mean) |
| Returns the min, mean, and max values of the given array. | |
| void VTMANGLE() | CalcMinMaxMedian (const VALTYPE *x, size_t n, VALTYPE *p_min, VALTYPE *p_max, VALTYPE *p_median) |
| Returns the min, mean, and median values of the given array. | |
| VALTYPE VTMANGLE() | CalcMedian (const VALTYPE *x, size_t n) |
| Returns just the median value of the given array. | |
| VALTYPE VTMANGLE() | CalcMin (const VALTYPE *x, size_t n) |
| Returns the minimum value of the given array. | |
| VALTYPE VTMANGLE() | CalcMax (const VALTYPE *x, size_t n) |
| Returns the minimum value of the given array. | |
| VALTYPE VTMANGLE() | CalcMean (const VALTYPE *x, size_t n) |
| Returns the maximum value of the given array. | |
These routines are defined using a template-like macro mechanism to ease generation of other types.
| #define INC_UTIL_STAT_H |
util/stat.h included.
| #define VALTYPE_STD_COMPARE 1 |
Define to 1 to enable automatic comparison function generation.
| VALTYPE VTMANGLE() CalcMax | ( | const VALTYPE * | x, | |
| size_t | n | |||
| ) |
Returns the minimum value of the given array.
| [in] | x | Array over which to compute the statistics. Must not equal NULL if the length, 'n', is greater than 0. |
| [in] | n | Length of the array 'x'. |
References ABORT, CalcMax(), ERR_BAD_ARG, and VALTYPE.
Referenced by CalcMax().
| VALTYPE VTMANGLE() CalcMean | ( | const VALTYPE * | x, | |
| size_t | n | |||
| ) |
Returns the maximum value of the given array.
| [in] | x | Array over which to compute the statistics. Must not equal NULL if the length, 'n', is greater than 0. |
| [in] | n | Length of the array 'x'. |
References ABORT, CalcMean(), ERR_BAD_ARG, and VALTYPE.
Referenced by CalcBasicStats(), and CalcMean().
| VALTYPE VTMANGLE() CalcMin | ( | const VALTYPE * | x, | |
| size_t | n | |||
| ) |
Returns the minimum value of the given array.
| [in] | x | Array over which to compute the statistics. Must not equal NULL if the length, 'n', is greater than 0. |
| [in] | n | Length of the array 'x'. |
References ABORT, CalcMin(), ERR_BAD_ARG, and VALTYPE.
Referenced by CalcMin().
| void VTMANGLE() CalcMinMaxMean | ( | const VALTYPE * | x, | |
| size_t | n, | |||
| VALTYPE * | p_min, | |||
| VALTYPE * | p_max, | |||
| VALTYPE * | p_mean | |||
| ) |
Returns the min, mean, and max values of the given array.
| [in] | x | Array over which to compute the statistics. Must not equal NULL if the length, 'n', is greater than 0. |
| [in] | n | Length of the array 'x'. |
| [in,out] | p_min | Pointer to location in which to store the minimum value. If NULL, the minimum is not returned. |
| [in,out] | p_max | Pointer to location in which to store the maximum value. If NULL, the maximum is not returned. |
| [in,out] | p_mean | Pointer to location in which to store the mean value. If NULL, the mean is not returned. |
References ABORT, CalcMinMaxMean(), ERR_BAD_ARG, and VALTYPE.
Referenced by CalcMinMaxMean().
| void VTMANGLE() CalcMinMaxMedian | ( | const VALTYPE * | x, | |
| size_t | n, | |||
| VALTYPE * | p_min, | |||
| VALTYPE * | p_max, | |||
| VALTYPE * | p_median | |||
| ) |
Returns the min, mean, and median values of the given array.
| [in] | x | Array on which to compute statistics. Must not equal NULL if the length, 'n', is greater than 0. |
| [in] | n | Length of x. |
| [in,out] | p_min | Pointer to location in which to store the minimum value of the array x. If NULL, then the minimum is not returned. |
| [in,out] | p_max | Pointer to location in which to store the maximum value of the array x. If NULL, then the maximum is not returned. |
| [in,out] | p_medain | Pointer to location in which to store the median value of the array x. Must not equal NULL. |
References ABORT, CalcMinMaxMedian(), compare(), ERR_BAD_ARG, ERR_OUT_OF_MEMORY, oski_CopyMem, oski_Free, oski_Malloc, VALTYPE, and VTMANGLE.
Referenced by CalcBasicStats(), and CalcMinMaxMedian().
1.5.9