File tree Expand file tree Collapse file tree 5 files changed +13
-7
lines changed Expand file tree Collapse file tree 5 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ impl Lcg128Xsl64 {
77
77
78
78
/// Construct an instance compatible with PCG seed and stream.
79
79
///
80
+ /// Note that the highest bit of the `stream` parameter is discarded
81
+ /// to simplify upholding internal invariants.
82
+ ///
80
83
/// Note that two generators with different stream parameters may be closely
81
84
/// correlated.
82
85
///
@@ -116,11 +119,11 @@ impl fmt::Debug for Lcg128Xsl64 {
116
119
}
117
120
}
118
121
119
- /// We use a single 255-bit seed to initialise the state and select a stream.
120
- /// One `seed` bit (lowest bit of `seed[8]`) is ignored.
121
122
impl SeedableRng for Lcg128Xsl64 {
122
123
type Seed = [ u8 ; 32 ] ;
123
124
125
+ /// We use a single 255-bit seed to initialise the state and select a stream.
126
+ /// One `seed` bit (lowest bit of `seed[8]`) is ignored.
124
127
fn from_seed ( seed : Self :: Seed ) -> Self {
125
128
let mut seed_u64 = [ 0u64 ; 4 ] ;
126
129
le:: read_u64_into ( & seed, & mut seed_u64) ;
Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ impl Lcg64Xsh32 {
77
77
78
78
/// Construct an instance compatible with PCG seed and stream.
79
79
///
80
+ /// Note that the highest bit of the `stream` parameter is discarded
81
+ /// to simplify upholding internal invariants.
82
+ ///
80
83
/// Note that two generators with different stream parameters may be closely
81
84
/// correlated.
82
85
///
@@ -117,11 +120,11 @@ impl fmt::Debug for Lcg64Xsh32 {
117
120
}
118
121
}
119
122
120
- /// We use a single 127-bit seed to initialise the state and select a stream.
121
- /// One `seed` bit (lowest bit of `seed[8]`) is ignored.
122
123
impl SeedableRng for Lcg64Xsh32 {
123
124
type Seed = [ u8 ; 16 ] ;
124
125
126
+ /// We use a single 127-bit seed to initialise the state and select a stream.
127
+ /// One `seed` bit (lowest bit of `seed[8]`) is ignored.
125
128
fn from_seed ( seed : Self :: Seed ) -> Self {
126
129
let mut seed_u64 = [ 0u64 ; 2 ] ;
127
130
le:: read_u64_into ( & seed, & mut seed_u64) ;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fn test_lcg128xsl64_construction() {
35
35
}
36
36
37
37
#[ test]
38
- fn test_lcg128xsl64_true_values ( ) {
38
+ fn test_lcg128xsl64_reference ( ) {
39
39
// Numbers copied from official test suite (C version).
40
40
let mut rng = Lcg128Xsl64 :: new ( 42 , 54 ) ;
41
41
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ fn test_lcg64xsh32_construction() {
33
33
}
34
34
35
35
#[ test]
36
- fn test_lcg64xsh32_true_values ( ) {
36
+ fn test_lcg64xsh32_reference ( ) {
37
37
// Numbers copied from official test suite.
38
38
let mut rng = Lcg64Xsh32 :: new ( 42 , 54 ) ;
39
39
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ fn test_mcg128xsl64_construction() {
33
33
}
34
34
35
35
#[ test]
36
- fn test_mcg128xsl64_true_values ( ) {
36
+ fn test_mcg128xsl64_reference ( ) {
37
37
// Numbers copied from official test suite (C version).
38
38
let mut rng = Mcg128Xsl64 :: new ( 42 ) ;
39
39
You can’t perform that action at this time.
0 commit comments