The R Project SVN R

Rev

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

Rev 62311 Rev 62665
Line 439... Line 439...
439
static void RNGkind(RNGtype newkind)
439
static void RNGkind(RNGtype newkind)
440
{
440
{
441
/* Choose a new kind of RNG.
441
/* Choose a new kind of RNG.
442
 * Initialize its seed by calling the old RNG's unif_rand()
442
 * Initialize its seed by calling the old RNG's unif_rand()
443
 */
443
 */
444
    if (newkind == -1) newkind = RNG_DEFAULT;
444
    if (newkind == (RNGtype)-1) newkind = RNG_DEFAULT;
445
    switch(newkind) {
445
    switch(newkind) {
446
    case WICHMANN_HILL:
446
    case WICHMANN_HILL:
447
    case MARSAGLIA_MULTICARRY:
447
    case MARSAGLIA_MULTICARRY:
448
    case SUPER_DUPER:
448
    case SUPER_DUPER:
449
    case MERSENNE_TWISTER:
449
    case MERSENNE_TWISTER:
Line 463... Line 463...
463
 
463
 
464
static void Norm_kind(N01type kind)
464
static void Norm_kind(N01type kind)
465
{
465
{
466
    /* N01type is an enumeration type, so this will probably get
466
    /* N01type is an enumeration type, so this will probably get
467
       mapped to an unsigned integer type. */
467
       mapped to an unsigned integer type. */
468
    if (kind == -1) kind = N01_DEFAULT;
468
    if (kind == (N01type)-1) kind = N01_DEFAULT;
469
    if (kind > KINDERMAN_RAMAGE)
469
    if (kind > KINDERMAN_RAMAGE)
470
	error(_("invalid Normal type in 'RNGkind'"));
470
	error(_("invalid Normal type in 'RNGkind'"));
471
    if (kind == USER_NORM) {
471
    if (kind == USER_NORM) {
472
	User_norm_fun = R_FindSymbol("user_norm_rand", "", NULL);
472
	User_norm_fun = R_FindSymbol("user_norm_rand", "", NULL);
473
	if (!User_norm_fun) error(_("'user_norm_rand' not in load table"));
473
	if (!User_norm_fun) error(_("'user_norm_rand' not in load table"));