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 {
7777
7878 /// Construct an instance compatible with PCG seed and stream.
7979 ///
80+ /// Note that the highest bit of the `stream` parameter is discarded
81+ /// to simplify upholding internal invariants.
82+ ///
8083 /// Note that two generators with different stream parameters may be closely
8184 /// correlated.
8285 ///
@@ -116,11 +119,11 @@ impl fmt::Debug for Lcg128Xsl64 {
116119 }
117120}
118121
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.
121122impl SeedableRng for Lcg128Xsl64 {
122123 type Seed = [ u8 ; 32 ] ;
123124
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.
124127 fn from_seed ( seed : Self :: Seed ) -> Self {
125128 let mut seed_u64 = [ 0u64 ; 4 ] ;
126129 le:: read_u64_into ( & seed, & mut seed_u64) ;
Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ impl Lcg64Xsh32 {
7777
7878 /// Construct an instance compatible with PCG seed and stream.
7979 ///
80+ /// Note that the highest bit of the `stream` parameter is discarded
81+ /// to simplify upholding internal invariants.
82+ ///
8083 /// Note that two generators with different stream parameters may be closely
8184 /// correlated.
8285 ///
@@ -117,11 +120,11 @@ impl fmt::Debug for Lcg64Xsh32 {
117120 }
118121}
119122
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.
122123impl SeedableRng for Lcg64Xsh32 {
123124 type Seed = [ u8 ; 16 ] ;
124125
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.
125128 fn from_seed ( seed : Self :: Seed ) -> Self {
126129 let mut seed_u64 = [ 0u64 ; 2 ] ;
127130 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() {
3535}
3636
3737#[ test]
38- fn test_lcg128xsl64_true_values ( ) {
38+ fn test_lcg128xsl64_reference ( ) {
3939 // Numbers copied from official test suite (C version).
4040 let mut rng = Lcg128Xsl64 :: new ( 42 , 54 ) ;
4141
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ fn test_lcg64xsh32_construction() {
3333}
3434
3535#[ test]
36- fn test_lcg64xsh32_true_values ( ) {
36+ fn test_lcg64xsh32_reference ( ) {
3737 // Numbers copied from official test suite.
3838 let mut rng = Lcg64Xsh32 :: new ( 42 , 54 ) ;
3939
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ fn test_mcg128xsl64_construction() {
3333}
3434
3535#[ test]
36- fn test_mcg128xsl64_true_values ( ) {
36+ fn test_mcg128xsl64_reference ( ) {
3737 // Numbers copied from official test suite (C version).
3838 let mut rng = Mcg128Xsl64 :: new ( 42 ) ;
3939
You can’t perform that action at this time.
0 commit comments