/* @(#) sim.c 1.2 1/27/86 17:48:09 */ /*ident "@(#)cfront:lib/task/sim.c 1.2"*/ /* @(#) sim.c 1.1 1/17/85 14:49:52 */ #include "task.h" histogram.histogram(int nb, int ll, int rr) { DB(("x%x->histogram( %d, %d, %d )\n", this,nb,ll,rr)); register int i; if (rr<=ll || nb<1) task_error(E_HISTO,0); if (nb%2) nb++; while ((rr-ll)%nb) rr++; binsize = (rr-ll)/nb; h = new int[nb]; while (h == 0) task_error(E_STORE,0); for (i=0; ihistogram::add( %d )\n", this,a)); register int i, j; /* make l <= a < r, */ /* possibly expanding histogram by doubling binsize and range */ while (a= 0) h[i--] = 0; binsize += binsize; } while (r<=a) { r += r - l; for (i=0, j=0; i