20 for (v = 0; v<values; v++) sum += value[v];
22 for (v = 0; v<values; v++) {
24 s->
border[v] = (val/sum)*RAND_MAX;
27 s->
border[values-1] = RAND_MAX;
44 if (val<=s->border[m]) {
45 if (m==0 || val>s->
border[m-1])
break;
50 if (val<=s->border[h]) {
60 assert(m>=0 && m<s->values);
void freeSpreading(Spreading s)
Spreading newSpreading(double *value, int values)
int spreadRand(Spreading s)
GB_write_int const char s