Skip to content

Commit

Permalink
Dry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed Aug 22, 2017
1 parent 86e89e0 commit 8c1baec
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions test/linalg/lu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,13 @@ dimg = randn(n)/2
b_dest = similar(b, resultT)
c_dest = similar(c, resultT)

A_ldiv_B!(b_dest, lua, b)
A_ldiv_B!(c_dest, lua, c)
@test norm(b_dest - lua \ b, 1) < ε*κ*2n
@test norm(c_dest - lua \ c, 1) < ε*κ*n

At_ldiv_B!(b_dest, lua, b)
At_ldiv_B!(c_dest, lua, c)
@test norm(b_dest - lua.' \ b, 1) < ε*κ*2n
@test norm(c_dest - lua.' \ c, 1) < ε*κ*n

Ac_ldiv_B!(b_dest, lua, b)
Ac_ldiv_B!(c_dest, lua, c)
@test norm(b_dest - lua' \ b, 1) < ε*κ*2n
@test norm(c_dest - lua' \ c, 1) < ε*κ*n
for (Aq_ldiv_B!, q) in ((A_ldiv_B!, identity), (At_ldiv_B!, transpose),
(Ac_ldiv_B!, ctranspose))
Aq_ldiv_B!(b_dest, lua, b)
Aq_ldiv_B!(c_dest, lua, c)
@test norm(b_dest - q(lua) \ b, 1) < ε*κ*2n
@test norm(c_dest - q(lua) \ c, 1) < ε*κ*n
end
end
if eltya <: BlasFloat && eltyb <: BlasFloat
e = rand(eltyb,n,n)
Expand Down

0 comments on commit 8c1baec

Please sign in to comment.