all: replace internal rand shim with math/rand/v2

This commit is contained in:
Dan Kortschak
2025-01-02 12:07:22 +10:30
parent cf3307fa63
commit bc349ecfab
345 changed files with 1165 additions and 1214 deletions

View File

@@ -7,6 +7,7 @@ package rdf_test
import (
"io"
"math"
"math/rand/v2"
"slices"
"strings"
"testing"
@@ -19,7 +20,6 @@ import (
"gonum.org/v1/gonum/graph/iterator"
"gonum.org/v1/gonum/graph/multi"
"gonum.org/v1/gonum/graph/testgraph"
"gonum.org/v1/gonum/internal/rand"
)
func graphBuilder(nodes []graph.Node, edges []testgraph.WeightedLine, _, _ float64) (g graph.Graph, n []graph.Node, e []testgraph.Edge, s, a float64, ok bool) {
@@ -88,10 +88,10 @@ func TestGraph(t *testing.T) {
g.AddNode(it.Node())
}
it.Reset()
rnd := rand.New(rand.NewSource(1))
rnd := rand.New(rand.NewPCG(1, 1))
for it.Next() {
u := it.Node()
d := rnd.Intn(5)
d := rnd.IntN(5)
vit := g.Nodes()
for d >= 0 && vit.Next() {
v := vit.Node()
@@ -116,10 +116,10 @@ func TestGraph(t *testing.T) {
}
it.Reset()
var lines []graph.Line
rnd := rand.New(rand.NewSource(1))
rnd := rand.New(rand.NewPCG(1, 1))
for it.Next() {
u := it.Node()
d := rnd.Intn(5)
d := rnd.IntN(5)
vit := g.Nodes()
for d >= 0 && vit.Next() {
v := vit.Node()