Skip to content

Commit c2109c3

Browse files
committed
Fix \{A::Triangular,b} test
Change condition number computation to use Inf-norm to be consistent with new error bound.
1 parent 4f5260b commit c2109c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/linalg.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -578,14 +578,14 @@ for relty in (Float16, Float32, Float64, BigFloat), elty in (relty, Complex{relt
578578

579579
for M in (triu(A), tril(A))
580580
TM = Triangular(M)
581-
condM = cond(complex128(M))
581+
condM = elty <:BlasFloat ? cond(TM, Inf) : convert(relty, cond(complex128(M), Inf))
582582
#Linear solver
583583
x = M \ b
584584
tx = TM \ b
585-
@test norm(x-tx,Inf) <= 4*max(eps(), eps(relty))*condM*norm(x,Inf)
585+
@test norm(x-tx,Inf) <= 4*condM*max(eps()*norm(tx,Inf), eps(relty)*norm(x,Inf))
586586
if elty <: BlasFloat #test naivesub! against LAPACK
587587
tx = LinAlg.naivesub!(TM, b, similar(b))
588-
@test norm(x-tx,Inf) <= 4*max(eps(), eps(relty))*condM*norm(x,Inf)
588+
@test norm(x-tx,Inf) <= 4*condM*max(eps()*norm(tx,Inf), eps(relty)*norm(x,Inf))
589589
end
590590

591591
#Eigensystems

0 commit comments

Comments
 (0)