Home | History | Annotate | Download | only in netem

Lines Matching refs:table

2  * Experimental data  distribution table generator
7 * From this, create the inverse distribution table used to approximate
73 /* Create a (normalized) distribution table from a set of observed
74 * values. The table is fixed to run from (as it happens) -4 to +4,
95 int *table;
99 table = calloc(DISTTABLESIZE, sizeof(int));
100 if (!table) {
101 perror("table alloc");
112 ++table[index];
118 return table;
123 cumulativedist(int *table, int limit, int *total)
128 accum += *table;
129 *table++ = accum;
135 inverttable(int *table, int inversesize, int tablesize, int cumulative)
147 fvalue = (double)table[i]/(double)cumulative;
160 /* Run simple linear interpolation over the table to fill in missing entries */
162 interpolatetable(short *table, int limit)
168 if (table[i] == MINSHORT) {
170 if (table[j] != MINSHORT)
173 table[i] = last + (i-lasti)*(table[j]-last)/(j-lasti);
175 table[i] = last + (i-lasti)*(MAXSHORT-last)/(limit-lasti);
178 last = table[i];
185 printtable(const short *table, int limit)
189 printf("# This is the distribution table for the experimental distribution.\n");
192 printf("%d%c", table[i],
204 int *table;
227 table = makedist(x, limit, mu, sigma);
229 cumulativedist(table, DISTTABLESIZE, &total);
230 inverse = inverttable(table, TABLESIZE, DISTTABLESIZE, total);