Skip to content

Commit

Permalink
removing some unused stuff from external/random
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Feb 20, 2012
1 parent a98aa62 commit f002a96
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 55 deletions.
35 changes: 0 additions & 35 deletions external/random/jl_random.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,5 @@
random numbers
*/

#include "jl_random.h"
#include "dsfmt-2.1/dSFMT.c"
#include "randmtzig.c"

#define RANDN_RESET -99999999

static double randn_bm_next = RANDN_RESET;

void randn_bm_reset(void);
double randn_bm(void);

void randn_bm_reset(void)
{
randn_bm_next = RANDN_RESET;
}

// Box Muller
double randn_bm(void)
{
double s, vre, vim, ure, uim;

if (randn_bm_next != RANDN_RESET) {
s = randn_bm_next;
randn_bm_next = RANDN_RESET;
return s;
}
do {
ure = dsfmt_gv_genrand_close1_open2();
uim = dsfmt_gv_genrand_close1_open2();
vre = 2*ure - 3;
vim = 2*uim - 3;
s = vre*vre + vim*vim;
} while (s >= 1);
s = sqrt(-2*log(s)/s);
randn_bm_next = s * vre;
return s * vim;
}
18 changes: 0 additions & 18 deletions external/random/jl_random.h

This file was deleted.

2 changes: 0 additions & 2 deletions external/random/randmtzig.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
#include <time.h>
#include <sys/time.h>

#include "jl_random.h"

typedef int randmtzig_idx_type;
typedef signed char randmtzig_int8_t;
typedef unsigned char randmtzig_uint8_t;
Expand Down

0 comments on commit f002a96

Please sign in to comment.