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;
158 /* Run simple linear interpolation over the table to fill in missing entries */
160 interpolatetable(short *table, int limit)
166 if (table[i] == MINSHORT) {
168 if (table[j] != MINSHORT)
171 table[i] = last + (i-lasti)*(table[j]-last)/(j-lasti);
173 table[i] = last + (i-lasti)*(MAXSHORT-last)/(limit-lasti);
176 last = table[i];
183 printtable(const short *table, int limit)
187 printf("# This is the distribution table for the experimental distribution.\n");
190 printf("%d%c", table[i],
202 int *table;
225 table = makedist(x, limit, mu, sigma);
227 cumulativedist(table, DISTTABLESIZE, &total);
228 inverse = inverttable(table, TABLESIZE, DISTTABLESIZE, total);