mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 15:55:07 -05:00
regress: provide function to find median
This commit is contained in:
13
regress.c
13
regress.c
@@ -429,6 +429,19 @@ find_median(double *x, int n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ================================================== */
|
||||||
|
|
||||||
|
double
|
||||||
|
RGR_FindMedian(double *x, int n)
|
||||||
|
{
|
||||||
|
double tmp[MAX_POINTS];
|
||||||
|
|
||||||
|
assert(n > 0 && n <= MAX_POINTS);
|
||||||
|
memcpy(tmp, x, n * sizeof (tmp[0]));
|
||||||
|
|
||||||
|
return find_median(tmp, n);
|
||||||
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
/* This function evaluates the equation
|
/* This function evaluates the equation
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user