diff options
Diffstat (limited to 'packages/base')
-rw-r--r-- | packages/base/src/C/vector-aux.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/base/src/C/vector-aux.c b/packages/base/src/C/vector-aux.c index 946d069..0f1b3c7 100644 --- a/packages/base/src/C/vector-aux.c +++ b/packages/base/src/C/vector-aux.c | |||
@@ -771,8 +771,8 @@ double gaussrand(struct random_data *buffer, | |||
771 | 771 | ||
772 | if(*phase == 0) { | 772 | if(*phase == 0) { |
773 | do { | 773 | do { |
774 | double U1 = urandom(buffer); | 774 | double U1 = (double)random() / (double)RAND_MAX; |
775 | double U2 = urandom(buffer); | 775 | double U2 = (double)random() / (double)RAND_MAX; |
776 | 776 | ||
777 | V1 = 2 * U1 - 1; | 777 | V1 = 2 * U1 - 1; |
778 | V2 = 2 * U2 - 1; | 778 | V2 = 2 * U2 - 1; |
@@ -787,6 +787,7 @@ double gaussrand(struct random_data *buffer, | |||
787 | *pV1=V1; *pV2=V2; *pS=S; | 787 | *pV1=V1; *pV2=V2; *pS=S; |
788 | 788 | ||
789 | return X; | 789 | return X; |
790 | |||
790 | } | 791 | } |
791 | 792 | ||
792 | int random_vector(unsigned int seed, int code, DVEC(r)) { | 793 | int random_vector(unsigned int seed, int code, DVEC(r)) { |
@@ -801,7 +802,7 @@ int random_vector(unsigned int seed, int code, DVEC(r)) { | |||
801 | 802 | ||
802 | int phase = 0; | 803 | int phase = 0; |
803 | double V1,V2,S; | 804 | double V1,V2,S; |
804 | 805 | ||
805 | int k; | 806 | int k; |
806 | switch (code) { | 807 | switch (code) { |
807 | case 0: { // uniform | 808 | case 0: { // uniform |