Skip to content

Commit

Permalink
Set the seed in a umfpack test to avoid sporadic test errors due to (#…
Browse files Browse the repository at this point in the history
…28355)

unlucky draws.
  • Loading branch information
andreasnoack authored Jul 31, 2018
1 parent 33e8b62 commit 749f073
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions stdlib/SuiteSparse/test/umfpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ using LinearAlgebra: Adjoint, Transpose, SingularException
end
end

@testset "Rectangular cases" for elty in (Float64, ComplexF64)
for (m, n) in ((10,5), (5, 10))
A = sparse([1:min(m,n); rand(1:m, 10)], [1:min(m,n); rand(1:n, 10)], elty == Float64 ? randn(min(m, n) + 10) : complex.(randn(min(m, n) + 10), randn(min(m, n) + 10)))
F = lu(A)
L, U, p, q, Rs = F.:(:)
@test (Diagonal(Rs) * A)[p,q] L * U
end
@testset "Rectangular cases. elty=$elty, m=$m, n=$n" for
elty in (Float64, ComplexF64),
(m, n) in ((10,5), (5, 10))

Random.seed!(30072018)
A = sparse([1:min(m,n); rand(1:m, 10)], [1:min(m,n); rand(1:n, 10)], elty == Float64 ? randn(min(m, n) + 10) : complex.(randn(min(m, n) + 10), randn(min(m, n) + 10)))
F = lu(A)
L, U, p, q, Rs = F.:(:)
@test (Diagonal(Rs) * A)[p,q] L * U
end

@testset "Issue #4523 - complex sparse \\" begin
Expand Down

0 comments on commit 749f073

Please sign in to comment.