* fix the bug for IP connectivity when more than 1 UE is connected (test with iperf: ok) * set target ul/dl mcs in the eNB scheduler to hardwire the desired MCS (option t for UL and m for DL) * add the code related to abstraction from http://svn.eurecom.fr/openairsvn/openair4G/tags/asilomar2013 * cleanup the code * pre-ci passed for all except for eMBMS git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5093 818b1a75-f10b-46b9-bf7c-635c3b92a50f
26 lines
510 B
C
26 lines
510 B
C
double interp(double x, double *xs, double *ys, int count)
|
|
{
|
|
int i;
|
|
double dx, dy;
|
|
|
|
if (x < xs[0]) {
|
|
return 1.0; /* return minimum element */
|
|
}
|
|
|
|
if (x > xs[count-1]) {
|
|
return 0.0; /* return maximum */
|
|
}
|
|
|
|
/* find i, such that xs[i] <= x < xs[i+1] */
|
|
for (i = 0; i < count-1; i++) {
|
|
if (xs[i+1] > x) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
/* interpolate */
|
|
dx = xs[i+1] - xs[i];
|
|
dy = ys[i+1] - ys[i];
|
|
return ys[i] + (x - xs[i]) * dy / dx;
|
|
}
|