Skip to content

Commit 483b8a5

Browse files
committed
Rename WyRand to Wyrand
1 parent 85791f8 commit 483b8a5

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

Sources/Numerix/Documentation.docc/Random.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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:)``

Sources/Numerix/RandomModule/Random.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public protocol Random {
1414
extension 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 {
3535
extension 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
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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

44
Original code for wyrand and wyhash functions
55
https://github.com/wangyi-fudan/wyhash
@@ -10,7 +10,7 @@ https://lemire.me/blog/2019/03/19/the-fastest-conventional-random-number-generat
1010

1111
import Foundation
1212

13-
public struct WyRand: RandomNumberGenerator {
13+
public struct Wyrand: RandomNumberGenerator {
1414
private var state: UInt64
1515

1616
public init(seed: UInt64? = nil) {

Tests/RandomTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Testing
88
struct 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()

0 commit comments

Comments
 (0)