4 |
|
*/ |
5 |
|
#ifndef _RAD_RANDOM_H_ |
6 |
|
#define _RAD_RANDOM_H_ |
7 |
+ |
|
8 |
+ |
#include <stdlib.h> |
9 |
+ |
|
10 |
|
#ifdef __cplusplus |
11 |
|
extern "C" { |
12 |
|
#endif |
13 |
|
|
14 |
< |
#ifdef _WIN32 |
12 |
< |
|
13 |
< |
#include <stdlib.h> |
14 |
< |
|
14 |
> |
#if defined(_WIN32) || defined(_WIN64) |
15 |
|
#if (RAND_MAX <= 65536) |
16 |
|
#define random() ((long)rand()<<16^(long)rand()<<6^(long)rand()>>4) |
17 |
|
#else |
35 |
|
#define urand(i) (urmask ? (urperm[(i)&urmask]+frandom())/(urmask+1.) \ |
36 |
|
: frandom()) |
37 |
|
|
38 |
+ |
/* defined in urand.c */ |
39 |
+ |
extern long irandom(long modulus); |
40 |
+ |
|
41 |
|
extern int initurand(int size); |
42 |
|
|
40 |
– |
/* defined in urand.c */ |
43 |
|
extern int ilhash(int *d, int n); |
44 |
< |
/* defined in urind.c */ |
44 |
> |
|
45 |
|
extern int urind(int s, int i); |
46 |
|
/* defined in multisamp.c */ |
47 |
|
extern void multisamp(double t[], int n, double r); |