93#define MSB 0x40000000L
94#define ALL_BITS 0x7fffffffL
95#define HALF_RANGE 0x20000000L
100#define MSB 0x80000000L
101#define ALL_BITS 0xffffffffL
102#define HALF_RANGE 0x40000000L
108#define ALL_BITS 0xffff
109#define HALF_RANGE 0x4000
124 unsigned int mask, msb;
128#if BITS == 32 || BITS == 31
140 for (j = 0; j < 250; j++)
152 for (j = 0; j < 250; j++)
165 for (j = 0; j <
BITS; j++)
179 register unsigned int new_rand;
202 register unsigned int new_rand;
235void main(
int argc,
char **argv)
238 int j,k,nmr_bins,seed;
240 double randm, bin_inc;
241 double bin_limit[MAX_BINS];
245 printf(
"Usage -- %s nmr_bins seed\n", argv[0]);
249 nmr_bins = atoi( argv[1] );
250 if ( nmr_bins > MAX_BINS )
252 printf(
"ERROR -- maximum number of bins is %d\n", MAX_BINS);
256 seed = atoi( argv[2] );
262 for (j = 0; j < NMR_RAND; j++)
267 bin_inc = 1.0 / nmr_bins;
268 for (j = 0; j < nmr_bins; j++)
271 bin_limit[j] = (j + 1) * bin_inc;
274 bin_limit[nmr_bins-1] = 1.0e7;
276 for (j = 0; j < NMR_RAND; j++)
279 for (k = 0; k < nmr_bins; k++)
280 if ( randm < bin_limit[k] )
288 for (j = 0; j < nmr_bins; j++)
289 printf(
"%d\n", bins[j]);
int main()
Unit test of xsh_bspline_interpol.
static unsigned int r250_buffer[250]
void xsh_r250_init(int sd)
long xsh_set_seed(long int sd)
unsigned long int xsh_randlcg(void)