| author | |
| committer | |
| log | 0ccdc511cebfa3db1dfcbd05fe849843da117657 |
| tree | 7e578ef352916654c58c66336c4ab0a03126a87f |
| parent | 4809e0ea7f53d1b56cbc4c6e62e4b8ea40936d44 |
I specifically needed jump for an application and it doesn't appear to
be exposed in any way.2 files changed, 4 insertions(+), 4 deletions(-)
lib/std/rand/Xoroshiro128.zig+2-2| ... | @@ -20,7 +20,7 @@ pub fn random(self: *Xoroshiro128) Random { | ... | @@ -20,7 +20,7 @@ pub fn random(self: *Xoroshiro128) Random { |
| 20 | return Random.init(self, fill); | 20 | return Random.init(self, fill); |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | fn next(self: *Xoroshiro128) u64 { | 23 | pub fn next(self: *Xoroshiro128) u64 { |
| 24 | const s0 = self.s[0]; | 24 | const s0 = self.s[0]; |
| 25 | var s1 = self.s[1]; | 25 | var s1 = self.s[1]; |
| 26 | const r = s0 +% s1; | 26 | const r = s0 +% s1; |
| ... | @@ -33,7 +33,7 @@ fn next(self: *Xoroshiro128) u64 { | ... | @@ -33,7 +33,7 @@ fn next(self: *Xoroshiro128) u64 { |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | // Skip 2^64 places ahead in the sequence | 35 | // Skip 2^64 places ahead in the sequence |
| 36 | fn jump(self: *Xoroshiro128) void { | 36 | pub fn jump(self: *Xoroshiro128) void { |
| 37 | var s0: u64 = 0; | 37 | var s0: u64 = 0; |
| 38 | var s1: u64 = 0; | 38 | var s1: u64 = 0; |
| 39 | 39 |
lib/std/rand/Xoshiro256.zig+2-2| ... | @@ -22,7 +22,7 @@ pub fn random(self: *Xoshiro256) Random { | ... | @@ -22,7 +22,7 @@ pub fn random(self: *Xoshiro256) Random { |
| 22 | return Random.init(self, fill); | 22 | return Random.init(self, fill); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | fn next(self: *Xoshiro256) u64 { | 25 | pub fn next(self: *Xoshiro256) u64 { |
| 26 | const r = math.rotl(u64, self.s[0] +% self.s[3], 23) +% self.s[0]; | 26 | const r = math.rotl(u64, self.s[0] +% self.s[3], 23) +% self.s[0]; |
| 27 | 27 | ||
| 28 | const t = self.s[1] << 17; | 28 | const t = self.s[1] << 17; |
| ... | @@ -40,7 +40,7 @@ fn next(self: *Xoshiro256) u64 { | ... | @@ -40,7 +40,7 @@ fn next(self: *Xoshiro256) u64 { |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | // Skip 2^128 places ahead in the sequence | 42 | // Skip 2^128 places ahead in the sequence |
| 43 | fn jump(self: *Xoshiro256) void { | 43 | pub fn jump(self: *Xoshiro256) void { |
| 44 | var s: u256 = 0; | 44 | var s: u256 = 0; |
| 45 | 45 | ||
| 46 | var table: u256 = 0x39abdc4529b1661ca9582618e03fc9aad5a61266f0c9392c180ec6d33cfd0aba; | 46 | var table: u256 = 0x39abdc4529b1661ca9582618e03fc9aad5a61266f0c9392c180ec6d33cfd0aba; |