21 January 2020 11:09:15 AM
UNIFORM_TEST
C version:
Test the UNIFORM library.
BVEC_UNIFORM_NEW_TEST
BVEC_UNIFORM_NEW computes a binary vector.
The initial seed is 123456789
1000111110
1110010111
0011101101
0001001011
0101101100
1010010001
0010111011
1111110001
0010000111
0011000101
C4_UNIFORM_01_TEST
C4_UNIFORM_01 computes pseudorandom complex values
uniformly distributed in the unit circle.
The initial seed is 123456789
1 0.449860 -0.126667
2 -0.843197 -0.344280
3 0.589627 0.260090
4 0.391140 0.323400
5 -0.139466 -0.156136
6 -0.236066 0.077459
7 0.018599 -0.633214
8 0.892850 0.010314
9 -0.560465 0.763795
10 0.306357 0.026275
C4MAT_UNIFORM_01_NEW_TEST
C4MAT_UNIFORM_01_NEW computes pseudorandom complex values
uniformly distributed in the unit circle.
The initial seed is 123456789
Uniform C4MAT:
Col: 1 2
Row
---
0.44986 -0.126667 -0.236066 0.0774594
-0.843197 -0.34428 0.0185991 -0.633214
0.589627 0.26009 0.89285 0.0103136
0.39114 0.3234 -0.560465 0.763795
-0.139466 -0.156136 0.306357 0.0262752
C4VEC_UNIFORM_01_NEW_TEST
C4VEC_UNIFORM_01_NEW computes pseudorandom complex values
uniformly distributed in the unit circle.
The initial seed is 123456789
Uniform C4VEC:
0: 0.449860 -0.126667
1: -0.843197 -0.344280
2: 0.589627 0.260090
3: 0.391140 0.323400
4: -0.139466 -0.156136
5: -0.236066 0.077459
6: 0.018599 -0.633214
7: 0.892850 0.010314
8: -0.560465 0.763795
9: 0.306357 0.026275
C8_UNIFORM_01_TEST
C8_UNIFORM_01 computes pseudorandom complex values
uniformly distributed in the unit circle.
The initial seed is 123456789
1 0.449860 -0.126667
2 -0.843197 -0.344280
3 0.589627 0.260090
4 0.391140 0.323400
5 -0.139466 -0.156136
6 -0.236066 0.077459
7 0.018599 -0.633214
8 0.892850 0.010314
9 -0.560465 0.763795
10 0.306357 0.026275
C8MAT_UNIFORM_01_NEW_TEST
C8MAT_UNIFORM_01_NEW computes pseudorandom complex values
uniformly distributed in the unit circle.
The initial seed is 123456789
Uniform C4MAT:
Col: 1 2
Row
---
0.44986 -0.126667 -0.236066 0.0774593
-0.843197 -0.34428 0.0185993 -0.633214
0.589627 0.26009 0.89285 0.0103136
0.39114 0.3234 -0.560465 0.763795
-0.139466 -0.156136 0.306357 0.0262752
C8VEC_UNIFORM_01_NEW_TEST
C8VEC_UNIFORM_01_NEW computes pseudorandom complex values
uniformly distributed in the unit circle.
The initial seed is 123456789
Uniform C4VEC:
0: 0.449860 -0.126667
1: -0.843197 -0.344280
2: 0.589627 0.260090
3: 0.391140 0.323400
4: -0.139466 -0.156136
5: -0.236066 0.077459
6: 0.018599 -0.633214
7: 0.892850 0.010314
8: -0.560465 0.763795
9: 0.306357 0.026275
CH_UNIFORM_AB_TEST
CH_UNIFORM_AB computes pseudorandom characters
in an interval [CLO,CHI].
The lower endpoint CLO = 'A'.
The upper endpoint CHI = 'J'.
The initial seed is 123456789
1 'C'
2 'J'
3 'I'
4 'F'
5 'E'
6 'A'
7 'C'
8 'B'
9 'A'
10 'G'
GET_SEED_TEST
GET_SEED picks an initial seed value for R8_UNIFORM_01.
The value chosen should vary over time, because
the seed is based on reading the clock.
This is just the "calendar" clock, which does
not change very fast, so calling GET_SEED several
times in a row may result in the same value.
Initial seed is 12345678
Next 3 values of R8_UNIFORM_01:
0.621835
0.177248
0.002906
Oops
Same seed returned for 10000 calls to GET_SEED
Could be a bad algorithm, slow clock, or fast machine
To avoid infinite loops, we take what we have now.
New seed from GET_SEED is 1817208615
Next 3 values of R8_UNIFORM_01:
0.145642
0.811807
0.032665
Oops
Same seed returned for 100000 calls to GET_SEED
Could be a bad algorithm, slow clock, or fast machine
To avoid infinite loops, we take what we have now.
New seed from GET_SEED is 1817208615
Next 3 values of R8_UNIFORM_01:
0.145642
0.811807
0.032665
Oops
Same seed returned for 1000000 calls to GET_SEED
Could be a bad algorithm, slow clock, or fast machine
To avoid infinite loops, we take what we have now.
New seed from GET_SEED is 1817258326
Next 3 values of R8_UNIFORM_01:
0.534699
0.686793
0.928837
Oops
Same seed returned for 10000000 calls to GET_SEED
Could be a bad algorithm, slow clock, or fast machine
To avoid infinite loops, we take what we have now.
New seed from GET_SEED is 1817954269
Next 3 values of R8_UNIFORM_01:
0.981406
0.489687
0.163581
I4_SEED_ADVANCE_TEST
I4_SEED_ADVANCE advances the seed.
Step SEED input SEED output
1 12345 207482415
2 207482415 1790989824
3 1790989824 2035175616
4 2035175616 77048696
5 77048696 24794531
6 24794531 109854999
7 109854999 1644515420
8 1644515420 1256127050
9 1256127050 1963079340
10 1963079340 1683198519
I4_UNIFORM_0I_TEST
I4_UNIFORM_0I samples a uniform random
integer distribution in [0,2^31-1].
Starting with seed = 123456789
First few values:
0 469049721
1 2053676357
2 1781357515
3 1206231778
4 891865166
Number of values computed was N = 1000
Average value was 1080269952.000000
Minimum value was 3947872
Maximum value was 2142991809
Variance was 379689162099392512.000000
I4_UNIFORM_AB_TEST
I4_UNIFORM_AB computes pseudorandom values
in an interval [A,B].
The lower endpoint A = -100
The upper endpoint B = 200
The initial seed is 123456789
1 -35
2 187
3 149
4 69
5 25
6 -81
7 -23
8 -67
9 -87
10 90
11 -82
12 35
13 20
14 127
15 139
16 -100
17 170
18 5
19 -72
20 -96
I4MAT_UNIFORM_AB_NEW_TEST
I4MAT_UNIFORM_AB_NEW computes pseudorandom values
in an interval [A,B].
The lower endpoint A = -100
The upper endpoint B = 200
The initial seed is 123456789
Uniform I4MAT:
Col: 0 1 2 3
Row
0: -35 -81 -82 -100
1: 187 -23 35 170
2: 149 -67 20 5
3: 69 -87 127 -72
4: 25 90 139 -96
I4VEC_UNIFORM_AB_NEW_TEST
I4VEC_UNIFORM_AB_NEW computes pseudorandom values
in an interval [A,B].
The lower endpoint A = -100
The upper endpoint B = 200
The initial seed is 123456789
Uniform I4VEC:
0: -35
1: 187
2: 149
3: 69
4: 25
5: -81
6: -23
7: -67
8: -87
9: 90
10: -82
11: 35
12: 20
13: 127
14: 139
15: -100
16: 170
17: 5
18: -72
19: -96
L4_UNIFORM_TEST
L4_UNIFORM computes pseudorandom logical values.
The initial seed is 123456789