@@ -8,13 +8,15 @@ pub mod xoroshiro128;
88pub enum RandomGenerator {
99 Xoroshiro ( Xoroshiro ) ,
1010 Legacy ( LegacyRand ) ,
11+ LegacyXoroshiro ( Xoroshiro ) ,
1112}
1213
1314impl RandomGenerator {
1415 #[ inline]
1516 pub fn split ( & mut self ) -> Self {
1617 match self {
1718 Self :: Xoroshiro ( rand) => Self :: Xoroshiro ( rand. split ( ) ) ,
19+ Self :: LegacyXoroshiro ( rand) => Self :: LegacyXoroshiro ( rand. split ( ) ) ,
1820 Self :: Legacy ( rand) => Self :: Legacy ( rand. split ( ) ) ,
1921 }
2022 }
@@ -23,6 +25,7 @@ impl RandomGenerator {
2325 pub fn next_splitter ( & mut self ) -> RandomDeriver {
2426 match self {
2527 Self :: Xoroshiro ( rand) => RandomDeriver :: Xoroshiro ( rand. next_splitter ( ) ) ,
28+ Self :: LegacyXoroshiro ( rand) => RandomDeriver :: Xoroshiro ( rand. next_splitter ( ) ) ,
2629 Self :: Legacy ( rand) => RandomDeriver :: Legacy ( rand. next_splitter ( ) ) ,
2730 }
2831 }
@@ -31,6 +34,7 @@ impl RandomGenerator {
3134 pub fn next ( & mut self , bits : u64 ) -> u64 {
3235 match self {
3336 Self :: Xoroshiro ( rand) => rand. next ( bits) ,
37+ Self :: LegacyXoroshiro ( rand) => rand. next ( bits) ,
3438 Self :: Legacy ( rand) => rand. next ( bits) ,
3539 }
3640 }
@@ -39,6 +43,7 @@ impl RandomGenerator {
3943 pub fn next_i32 ( & mut self ) -> i32 {
4044 match self {
4145 Self :: Xoroshiro ( rand) => rand. next_i32 ( ) ,
46+ Self :: LegacyXoroshiro ( rand) => rand. next_i32 ( ) ,
4247 Self :: Legacy ( rand) => rand. next_i32 ( ) ,
4348 }
4449 }
@@ -47,6 +52,7 @@ impl RandomGenerator {
4752 pub fn next_bounded_i32 ( & mut self , bound : i32 ) -> i32 {
4853 match self {
4954 Self :: Xoroshiro ( rand) => rand. next_bounded_i32 ( bound) ,
55+ Self :: LegacyXoroshiro ( rand) => rand. next_bounded_i32 ( bound) ,
5056 Self :: Legacy ( rand) => rand. next_bounded_i32 ( bound) ,
5157 }
5258 }
@@ -60,6 +66,7 @@ impl RandomGenerator {
6066 pub fn next_i64 ( & mut self ) -> i64 {
6167 match self {
6268 Self :: Xoroshiro ( rand) => rand. next_i64 ( ) ,
69+ Self :: LegacyXoroshiro ( rand) => rand. next_i64 ( ) ,
6370 Self :: Legacy ( rand) => rand. next_i64 ( ) ,
6471 }
6572 }
@@ -68,6 +75,7 @@ impl RandomGenerator {
6875 pub fn next_bool ( & mut self ) -> bool {
6976 match self {
7077 Self :: Xoroshiro ( rand) => rand. next_bool ( ) ,
78+ Self :: LegacyXoroshiro ( rand) => rand. next_bool ( ) ,
7179 Self :: Legacy ( rand) => rand. next_bool ( ) ,
7280 }
7381 }
@@ -76,6 +84,7 @@ impl RandomGenerator {
7684 pub fn next_f32 ( & mut self ) -> f32 {
7785 match self {
7886 Self :: Xoroshiro ( rand) => rand. next_f32 ( ) ,
87+ Self :: LegacyXoroshiro ( rand) => rand. next_f32 ( ) ,
7988 Self :: Legacy ( rand) => rand. next_f32 ( ) ,
8089 }
8190 }
@@ -84,6 +93,7 @@ impl RandomGenerator {
8493 pub fn next_f64 ( & mut self ) -> f64 {
8594 match self {
8695 Self :: Xoroshiro ( rand) => rand. next_f64 ( ) ,
96+ Self :: LegacyXoroshiro ( rand) => rand. next_f64 ( ) ,
8797 Self :: Legacy ( rand) => rand. next_f64 ( ) ,
8898 }
8999 }
@@ -92,6 +102,7 @@ impl RandomGenerator {
92102 pub fn next_gaussian ( & mut self ) -> f64 {
93103 match self {
94104 Self :: Xoroshiro ( rand) => rand. next_gaussian ( ) ,
105+ Self :: LegacyXoroshiro ( rand) => rand. next_gaussian ( ) ,
95106 Self :: Legacy ( rand) => rand. next_gaussian ( ) ,
96107 }
97108 }
0 commit comments