File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ package kde
3
3
4
4
import (
5
5
"math"
6
- "math/rand"
7
6
8
- "gonum .org/v1/gonum/stat/distuv "
7
+ "golang .org/x/exp/rand "
9
8
10
9
"gonum.org/v1/gonum/floats"
11
10
"gonum.org/v1/gonum/mat"
12
11
"gonum.org/v1/gonum/stat"
13
12
"gonum.org/v1/gonum/stat/distmv"
13
+ "gonum.org/v1/gonum/stat/distuv"
14
14
)
15
15
16
16
var sizeMismatch string = "kde: input size mismatch"
@@ -73,7 +73,7 @@ type Gaussian struct {
73
73
X mat.Matrix
74
74
Chol * mat.Cholesky
75
75
Weights []float64
76
- Src * rand.Rand
76
+ Src rand.Source
77
77
}
78
78
79
79
func (gauss Gaussian ) Dim () int {
@@ -119,7 +119,7 @@ func (gauss Gaussian) Rand(x []float64) []float64 {
119
119
if gauss .Src == nil {
120
120
idx = rand .Intn (n )
121
121
} else {
122
- idx = gauss .Src .Intn (n )
122
+ idx = rand . New ( gauss .Src ) .Intn (n )
123
123
}
124
124
} else {
125
125
c := distuv .NewCategorical (gauss .Weights , gauss .Src )
You can’t perform that action at this time.
0 commit comments