regress: provide function to find median

This commit is contained in:
Miroslav Lichvar
2017-06-21 19:11:10 +02:00
parent 5e1e31ad5f
commit 6207655ab2
2 changed files with 16 additions and 0 deletions

View File

@@ -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