The R Project SVN R

Rev

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

Rev 9363 Rev 24562
Line 1... Line 1...
1
/*
1
/*
2
 *  Mathlib : A C Library of Special Functions
2
 *  Mathlib : A C Library of Special Functions
3
 *  Copyright (C) 2000  The R Development Core Team
3
 *  Copyright (C) 2000, 2003  The R Development Core Team
4
 *
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
8
 *  (at your option) any later version.
Line 25... Line 25...
25
void set_seed(unsigned int i1, unsigned int i2)
25
void set_seed(unsigned int i1, unsigned int i2)
26
{
26
{
27
    I1 = i1; I2 = i2;
27
    I1 = i1; I2 = i2;
28
}
28
}
29
 
29
 
-
 
30
void get_seed(unsigned int *i1, unsigned int *i2)
-
 
31
{
-
 
32
    *i1 = I1; *i2 = I2;
-
 
33
}
-
 
34
 
30
 
35
 
31
double unif_rand(void)
36
double unif_rand(void)
32
{
37
{
33
    I1= 36969*(I1 & 0177777) + (I1>>16);
38
    I1= 36969*(I1 & 0177777) + (I1>>16);
34
    I2= 18000*(I2 & 0177777) + (I2>>16);
39
    I2= 18000*(I2 & 0177777) + (I2>>16);