Provides Math. functions for various operations.
More...
#include <mathUtility.h>
|
| static double | calculateMean (const double fiArray[], int fiArrayLen) |
| | Calculates the mean (average) of an array of data.
|
| |
| static double | calculateMedian (const double fiArray[], int fiArrayLen) |
| | Calculates the median of an array of data.
|
| |
| static int | compareDouble (const void *fiPtrLhs, const void *fiPtrRhs) |
| | Compares two double values for sorting purposes.
|
| |
| static void | calculateMinMax (const double fiArray[], int fiArrayLen, double *foMin, double *foMax) |
| | Calculates the minimum and maximum values in an array of data.
|
| |
Provides Math. functions for various operations.
◆ calculateMean()
| double MathUtility::calculateMean |
( |
const double | fiArray[], |
|
|
int | fiArrayLen ) |
|
static |
Calculates the mean (average) of an array of data.
This function calculates the mean (average) of the given array of data. The data array should contain datalen elements.
- Parameters
-
| fiArray | The array of data. |
| fiArrayLen | The length of the data array. |
- Returns
- The calculated mean.
◆ calculateMedian()
| double MathUtility::calculateMedian |
( |
const double | fiArray[], |
|
|
int | fiArrayLen ) |
|
static |
Calculates the median of an array of data.
This function calculates the median of the given array of data. The data array should contain datalen elements.
- Parameters
-
| fiArray | The array of data. |
| fiArrayLen | The length of the data array. |
- Returns
- The calculated median.
◆ calculateMinMax()
| void MathUtility::calculateMinMax |
( |
const double | fiArray[], |
|
|
int | fiArrayLen, |
|
|
double * | foMin, |
|
|
double * | foMax ) |
|
static |
Calculates the minimum and maximum values in an array of data.
This function calculates the minimum and maximum values in the given array of data. The data array should contain datalen elements.
- Parameters
-
| fiArray | The array of data. |
| fiArrayLen | The length of the data array. |
| foMin | Pointer to store the minimum value. |
| foMax | Pointer to store the maximum value. |
◆ compareDouble()
| int MathUtility::compareDouble |
( |
const void * | fiPtrLhs, |
|
|
const void * | fiPtrRhs ) |
|
static |
Compares two double values for sorting purposes.
This function is used as a comparison function for sorting an array of doubles in ascending order.
- Parameters
-
| fiPtrLhs | Pointer to the first double value. |
| fiPtrRhs | Pointer to the second double value. |
- Returns
- An integer value indicating the comparison result.
- -1 if the first value is less than the second value.
- 0 if the values are equal.
- 1 if the first value is greater than the second value.
The documentation for this class was generated from the following files: