mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-06 08:11:12 +00:00
26 lines
521 B
C
26 lines
521 B
C
#ifndef Randoms2DOTh
|
|
#define Randoms2DOTh
|
|
|
|
#define NTAB 32
|
|
|
|
typedef struct{
|
|
long idum, idum2;
|
|
long iy, iv[NTAB];
|
|
int did_init;
|
|
int next_norml_ok;
|
|
float next_norml;
|
|
} ran_state;
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"{
|
|
#endif /* __cplusplus */
|
|
void ran_init(int seed, ran_state *st);
|
|
float uniform_rand(ran_state *s);
|
|
float normal_rand(ran_state *s);
|
|
float sphere_rand(ran_state *st, int ndim, float *x);
|
|
float cube_rand(ran_state *st, int ndim, float *x);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif
|