Minimal Standard RANdom number generator.
More...
|
#define | BN_CK_UNIF(_p) BU_CKMAG(_p, BN_UNIF_MAGIC, "bn_unif") |
|
#define | BN_CK_GAUSS(_p) BU_CKMAG(_p, BN_GAUSS_MAGIC, "bn_gauss") |
|
#define | BN_UNIF_LONG(_p) |
|
#define | BN_UNIF_DOUBLE(_p) |
|
#define | BN_UNIF_CIRCLE(_p, _x, _y, _r) |
|
#define | BN_UNIF_SPHERE(_p, _x, _y, _z, _r) |
|
#define | BN_GAUSS_DOUBLE(_p) |
|
Minimal Standard RANdom number generator.
- From:
- Stephen K. Park and Keith W. Miller
"Random number generators: good ones are hard to find"
CACM vol 31 no 10, Oct 88
◆ BN_CK_UNIF
Definition at line 62 of file msr.h.
◆ BN_CK_GAUSS
Definition at line 63 of file msr.h.
◆ BN_UNIF_LONG
#define BN_UNIF_LONG |
( |
|
_p | ) |
|
Value: (((_p)->msr_long_ptr) ? \
(_p)->msr_longs[--(_p)->msr_long_ptr] : \
bn_unif_long_fill(_p))
Definition at line 241 of file msr.h.
◆ BN_UNIF_DOUBLE
#define BN_UNIF_DOUBLE |
( |
|
_p | ) |
|
Value: (((_p)->msr_double_ptr) ? \
(_p)->msr_doubles[--(_p)->msr_double_ptr] : \
bn_unif_double_fill(_p))
Definition at line 245 of file msr.h.
◆ BN_UNIF_CIRCLE
#define BN_UNIF_CIRCLE |
( |
|
_p, |
|
|
|
_x, |
|
|
|
_y, |
|
|
|
_r |
|
) |
| |
Value: { \
do { \
(_r) = (_x)*(_x)+(_y)*(_y); \
} while ((_r) >= 1.0); }
#define BN_UNIF_DOUBLE(_p)
Definition at line 250 of file msr.h.
◆ BN_UNIF_SPHERE
#define BN_UNIF_SPHERE |
( |
|
_p, |
|
|
|
_x, |
|
|
|
_y, |
|
|
|
_z, |
|
|
|
_r |
|
) |
| |
Value: { \
do { \
(_r) = (_x)*(_x)+(_y)*(_y)+(_z)*(_z);\
} while ((_r) >= 1.0) }
Definition at line 257 of file msr.h.
◆ BN_GAUSS_DOUBLE
#define BN_GAUSS_DOUBLE |
( |
|
_p | ) |
|
Value: (((_p)->msr_gauss_ptr) ? \
(_p)->msr_gausses[--(_p)->msr_gauss_ptr] : \
bn_gauss_fill(_p))
Definition at line 265 of file msr.h.
◆ bn_unif_init()
struct bn_unif * bn_unif_init |
( |
long |
setseed, |
|
|
int |
method |
|
) |
| |
◆ bn_unif_free()
void bn_unif_free |
( |
struct bn_unif * |
p | ) |
|
◆ bn_unif_long_fill()
long bn_unif_long_fill |
( |
struct bn_unif * |
p | ) |
|
◆ bn_unif_double_fill()
double bn_unif_double_fill |
( |
struct bn_unif * |
p | ) |
|
◆ bn_gauss_init()
struct bn_gauss * bn_gauss_init |
( |
long |
setseed, |
|
|
int |
method |
|
) |
| |
◆ bn_gauss_free()
void bn_gauss_free |
( |
struct bn_gauss * |
p | ) |
|
◆ bn_gauss_fill()
double bn_gauss_fill |
( |
struct bn_gauss * |
p | ) |
|