Skip to content

Commit

Permalink
all: partially migrate to math/rand/v2
Browse files Browse the repository at this point in the history
This is not intended to be a completed transition since it leaves the
libraries unusable to external client code, but rather as a step towards
use of math/rand/v2. This initial step allows repair of sequence change
failures without having to worry about API difference.

Some tests are still failing, so this is very much WIP.
  • Loading branch information
kortschak committed Aug 16, 2024
1 parent a9b228e commit 426635e
Show file tree
Hide file tree
Showing 350 changed files with 1,238 additions and 430 deletions.
2 changes: 1 addition & 1 deletion blas/gonum/level1cmplx128_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package gonum
import (
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"
)

func benchmarkZdscal(b *testing.B, n, inc int) {
Expand Down
2 changes: 1 addition & 1 deletion blas/gonum/level1float64_bench_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blas/gonum/level2cmplx128_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/gonum/pardgemm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package gonum
import (
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/floats"
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/benchautogen/autogen_bench_level1double.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var autogen = []byte("// Code generated by \"go run $GOPATH/src/gonum.org/v1/gon
var imports = []byte(`import(
"testing"
"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"
"gonum.org/v1/gonum/blas"
)`)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"math/cmplx"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/floats/scalar"
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"math/cmplx"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/floats"
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/dgemmbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package testblas
import (
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/dtrmvbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package testblas
import (
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/dtrsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package testblas
import (
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/floats"
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/dzasum.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package testblas
import (
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/floats/scalar"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/dznrm2.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"math"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/floats/scalar"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/izamax.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package testblas
import (
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"
)

type Izamaxer interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/level2bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package testblas
import (
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"
)

type Zcopyer interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zgbmv.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/internal/rand"
)

type Zgbmver interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zgemm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/internal/rand"
)

type Zgemmer interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zhbmv.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"math"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/internal/rand"
)

type Zhbmver interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zhemm.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"math/cmplx"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zher2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"math/cmplx"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/internal/rand"
)

type Zher2ker interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zherk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"math/cmplx"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"
)

type Zswaper interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zsymm.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"math/cmplx"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zsyr2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/zsyrk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"math/cmplx"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/ztbmv.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/internal/rand"
)

type Ztbmver interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/ztbsv.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/internal/rand"
)

type Ztbsver interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/ztpsv.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/internal/rand"
)

type Ztpsver interface {
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/ztrmm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/ztrsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/blas"
)
Expand Down
2 changes: 1 addition & 1 deletion blas/testblas/ztrsv.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/internal/rand"
)

type Ztrsver interface {
Expand Down
2 changes: 1 addition & 1 deletion cmplxs/cmplxs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/cmplxs/cscalar"
"gonum.org/v1/gonum/floats"
Expand Down
2 changes: 1 addition & 1 deletion diff/fd/gradient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"math"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/floats"
)
Expand Down
2 changes: 1 addition & 1 deletion diff/fd/jacobian_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"math"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/floats"
"gonum.org/v1/gonum/mat"
Expand Down
2 changes: 1 addition & 1 deletion dsp/fourier/fourier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"reflect"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/floats"
)
Expand Down
2 changes: 1 addition & 1 deletion dsp/fourier/radix24_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"testing"
"unsafe"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/cmplxs"
)
Expand Down
2 changes: 1 addition & 1 deletion floats/floats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
"testing"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/floats/scalar"
)
Expand Down
2 changes: 1 addition & 1 deletion graph/coloring/coloring.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"errors"
"sort"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/graph"
"gonum.org/v1/gonum/graph/internal/set"
Expand Down
2 changes: 1 addition & 1 deletion graph/coloring/coloring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"
"time"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/graph"
"gonum.org/v1/gonum/graph/encoding/graph6"
Expand Down
2 changes: 1 addition & 1 deletion graph/community/bisect.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"fmt"
"math"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/graph"
)
Expand Down
4 changes: 2 additions & 2 deletions graph/community/bisect_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"log"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/graph/community"
"gonum.org/v1/gonum/graph/simple"
Expand Down Expand Up @@ -210,7 +210,7 @@ func ExampleProfile_multiplex() {
// Low:0.1 High:0.72 Score:26 Communities:[[0] [1 7 9 12] [2 8 11] [3 4 5 10] [6]] Q=[24.7 1.97]
// Low:0.72 High:1.1 Score:24 Communities:[[0 6] [1 7 9 12] [2 8 11] [3 4 5 10]] Q=[16.9 14.1]
// Low:1.1 High:1.2 Score:18 Communities:[[0 2 6 11] [1 7 9 12] [3 4 5 8 10]] Q=[9.16 25.1]
// Low:1.2 High:1.6 Score:10 Communities:[[0 3 4 5 6 10] [1 7 9 12] [2 8 11]] Q=[10.5 26.7]
// Low:1.2 High:1.6 Score:10 Communities:[[0 3 4 5 6 10] [1 7 9 12] [2 8 11]] Q=[11 25.2]
// Low:1.6 High:1.6 Score:8 Communities:[[0 1 6 7 9 12] [2 8 11] [3 4 5 10]] Q=[5.56 39.8]
// Low:1.6 High:1.8 Score:2 Communities:[[0 2 3 4 5 6 10] [1 7 8 9 11 12]] Q=[-1.82 48.6]
// Low:1.8 High:2.3 Score:-6 Communities:[[0 2 3 4 5 6 8 10 11] [1 7 9 12]] Q=[-5 57.5]
Expand Down
2 changes: 1 addition & 1 deletion graph/community/louvain_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"sort"

"golang.org/x/exp/rand"
"gonum.org/v1/gonum/internal/rand"

"gonum.org/v1/gonum/graph"
"gonum.org/v1/gonum/graph/internal/set"
Expand Down
Loading

0 comments on commit 426635e

Please sign in to comment.