Skip to content

Commit b70d841

Browse files
committed
srand -> seed!
1 parent e0b9684 commit b70d841

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

test/runtests.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ using Compat.SparseArrays, Compat.DelimitedFiles, Compat.Random
33
using IterativeSolvers, FileIO, AlgebraicMultigrid
44
import AlgebraicMultigrid: Pinv, Classical
55

6+
if VERSION < v"0.7-"
7+
const seed! = srand
8+
else
9+
using Random: seed!
10+
end
11+
612
include("sa_tests.jl")
713

814
@testset "AlgebraicMultigrid Tests" begin
@@ -33,7 +39,7 @@ end
3339
# Ruge-Stuben splitting
3440
S = poisson(7)
3541
@test RS()(S) == [0, 1, 0, 1, 0, 1, 0]
36-
srand(0)
42+
seed!(0)
3743
S = sprand(10,10,0.1); S = S + S'
3844
@test RS()(S) == [0, 1, 1, 0, 0, 0, 0, 0, 1, 1]
3945

test/sa_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function generate_matrices()
4242
cases = []
4343

4444
# Random matrices
45-
srand(0)
45+
seed!(0)
4646
for T in (Float32, Float64)
4747

4848
for s in [2, 3, 5]
@@ -189,7 +189,7 @@ end
189189
function test_approximate_spectral_radius()
190190

191191
cases = []
192-
srand(0)
192+
seed!(0)
193193

194194
push!(cases, [2. 0.
195195
0. 1.])

0 commit comments

Comments
 (0)