File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Numerix provides random number generators
88
99## Topics
1010
11- - `` WyRand ``
11+ - `` Wyrand ``
1212- `` Vector/random(size:seed:) ``
1313- `` Vector/randomDistribution(size:dist:) ``
1414- `` Vector/randomBNNS(size:bounds:seed:) ``
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public protocol Random {
1414extension Float : Random {
1515 public static func random( size: Int , seed: UInt64 ? ) -> Vector < Float > {
1616 var vec = Vector < Float > ( size: size)
17- var rng = WyRand ( seed: seed)
17+ var rng = Wyrand ( seed: seed)
1818 for i in 0 ..< size {
1919 vec [ i] = rng. nextUniform ( )
2020 }
@@ -35,7 +35,7 @@ extension Float: Random {
3535extension Double : Random {
3636 public static func random( size: Int , seed: UInt64 ? ) -> Vector < Double > {
3737 var vec = Vector < Double > ( size: size)
38- var rng = WyRand ( seed: seed)
38+ var rng = Wyrand ( seed: seed)
3939 for i in 0 ..< size {
4040 vec [ i] = rng. nextUniform ( )
4141 }
Original file line number Diff line number Diff line change 11/*
2- WyRand pseudorandom number generator (PRNG) based on wyrand and wyhash functions by Wang Yi.
2+ Wyrand pseudorandom number generator (PRNG) based on wyrand and wyhash functions by Wang Yi.
33
44Original code for wyrand and wyhash functions
55https://github.com/wangyi-fudan/wyhash
@@ -10,7 +10,7 @@ https://lemire.me/blog/2019/03/19/the-fastest-conventional-random-number-generat
1010
1111import Foundation
1212
13- public struct WyRand : RandomNumberGenerator {
13+ public struct Wyrand : RandomNumberGenerator {
1414 private var state : UInt64
1515
1616 public init ( seed: UInt64 ? = nil ) {
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import Testing
88struct RandomTests {
99
1010 @Test func randomWyRand( ) {
11- var rand = WyRand ( seed: 12345 )
11+ var rand = Wyrand ( seed: 12345 )
1212 #expect( rand. next ( ) == 13157676964440363053 )
1313
1414 let a : Float = rand. nextUniform ( )
You can’t perform that action at this time.
0 commit comments