The R Project SVN R

Rev

Rev 59170 | Rev 64668 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59170 Rev 59171
Line 276... Line 276...
276
    else {
276
    else {
277
	x = 1 - x + 10 * DBL_EPSILON;
277
	x = 1 - x + 10 * DBL_EPSILON;
278
	for (;;) {
278
	for (;;) {
279
	    p += cwilcox(q, mm, nn) / c;
279
	    p += cwilcox(q, mm, nn) / c;
280
	    if (p > x) {
280
	    if (p > x) {
281
		q = m * n - q;
281
		q = (int) (m * n - q);
282
		break;
282
		break;
283
	    }
283
	    }
284
	    q++;
284
	    q++;
285
	}
285
	}
286
    }
286
    }
Line 313... Line 313...
313
    if (!x) MATHLIB_ERROR(_("wilcox allocation error %d"), 4);
313
    if (!x) MATHLIB_ERROR(_("wilcox allocation error %d"), 4);
314
#endif
314
#endif
315
    for (i = 0; i < k; i++)
315
    for (i = 0; i < k; i++)
316
	x[i] = i;
316
	x[i] = i;
317
    for (i = 0; i < n; i++) {
317
    for (i = 0; i < n; i++) {
318
	j = floor(k * unif_rand());
318
	j = (int) floor(k * unif_rand());
319
	r += x[j];
319
	r += x[j];
320
	x[j] = x[--k];
320
	x[j] = x[--k];
321
    }
321
    }
322
    free(x);
322
    free(x);
323
    return(r - n * (n - 1) / 2);
323
    return(r - n * (n - 1) / 2);