SDDSlib
|
Computes statistical measures such as median, percentiles, average, and middle values for arrays. More...
#include "mdb.h"
Go to the source code of this file.
Functions | |
long | find_median (double *value, double *x, long n) |
Finds the median value of an array of doubles and returns the index of the median. | |
long | find_percentile (double *value, double *x, long n, double percentile) |
Finds a specific percentile of an array of doubles and returns the index of the percentile. | |
long | find_median_of_row (double *value, double **x, long index, long n) |
Finds the median value of a specific row in a 2D array of doubles and returns the index of the median. | |
long | find_average (double *value, double *data, long n) |
Finds the average of an array of doubles and returns the index of the element closest to the average. | |
long | find_middle (double *value, double *data, long n) |
Finds the middle value between the minimum and maximum of an array of doubles and returns the index of the closest element. | |
Computes statistical measures such as median, percentiles, average, and middle values for arrays.
This file contains functions to compute the median, specific percentiles, the average, and the middle value of datasets. It also includes functions to compute these statistics for specific rows in a 2D array. These functions return the index of the closest point to the computed statistic. Requires libsort.a routines.
See also: median.c (doesn't require libsort.a, but doesn't return index).
Definition in file rowmedian.c.
long find_average | ( | double * | value, |
double * | data, | ||
long | n ) |
Finds the average of an array of doubles and returns the index of the element closest to the average.
value | Pointer to store the computed average value. |
data | Pointer to the array of doubles. |
n | Number of elements in the array. |
Definition at line 142 of file rowmedian.c.
long find_median | ( | double * | value, |
double * | x, | ||
long | n ) |
Finds the median value of an array of doubles and returns the index of the median.
value | Pointer to store the computed median value. |
x | Pointer to the array of doubles. |
n | Number of elements in the array. |
Definition at line 32 of file rowmedian.c.
long find_median_of_row | ( | double * | value, |
double ** | x, | ||
long | index, | ||
long | n ) |
Finds the median value of a specific row in a 2D array of doubles and returns the index of the median.
value | Pointer to store the computed median value. |
x | Pointer to the 2D array of doubles. |
index | The row index for which the median is to be computed. |
n | Number of elements in the row. |
Definition at line 106 of file rowmedian.c.
long find_middle | ( | double * | value, |
double * | data, | ||
long | n ) |
Finds the middle value between the minimum and maximum of an array of doubles and returns the index of the closest element.
value | Pointer to store the computed middle value. |
data | Pointer to the array of doubles. |
n | Number of elements in the array. |
Definition at line 172 of file rowmedian.c.
long find_percentile | ( | double * | value, |
double * | x, | ||
long | n, | ||
double | percentile ) |
Finds a specific percentile of an array of doubles and returns the index of the percentile.
value | Pointer to store the computed percentile value. |
x | Pointer to the array of doubles. |
n | Number of elements in the array. |
percentile | The desired percentile to compute (0-100). |
Definition at line 68 of file rowmedian.c.