Skip to content

Commit 210a5c8

Browse files
authored
Fix failing QR scaling test on v1.6 (#232)
1 parent b673c1d commit 210a5c8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/test_muladd.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,11 @@ Random.seed!(0)
615615
Q = qr(randn(5,5)).Q
616616
b = randn(5)
617617
B = randn(5,5)
618-
@test Q*1.0 == ArrayLayouts.lmul!(Q, Matrix{Float64}(I, 5, 5))
618+
# The approx equality becomes exact on v1.10 and above,
619+
# but that's an implementation detail.
620+
# Below this, the LHS uses matrix broadcasting, whereas above this,
621+
# it uses GEMQRT like the RHS
622+
@test Q*1.0 ArrayLayouts.lmul!(Q, Matrix{Float64}(I, 5, 5))
619623
@test Q*b == ArrayLayouts.lmul!(Q, copy(b)) == mul(Q,b)
620624
@test Q*B == ArrayLayouts.lmul!(Q, copy(B)) == mul(Q,B)
621625
@test B*Q == ArrayLayouts.rmul!(copy(B), Q) == mul(B,Q)
@@ -634,7 +638,11 @@ Random.seed!(0)
634638
Q = qr(randn(7,5)).Q
635639
b = randn(5)
636640
B = randn(5,5)
637-
@test Q*1.0 == ArrayLayouts.lmul!(Q, Matrix{Float64}(I, 7, 7))
641+
# The approx equality becomes exact on v1.10 and above,
642+
# but that's an implementatio detail.
643+
# Below this, the LHS uses matrix broadcasting, whereas above this,
644+
# it uses GEMQRT like the RHS
645+
@test Q*1.0 ArrayLayouts.lmul!(Q, Matrix{Float64}(I, 7, 7))
638646
@test Q*b == mul(Q,b)
639647
@test Q*B == mul(Q,B)
640648
@test 1.0*Q ArrayLayouts.rmul!(Matrix{Float64}(I, 7, 7), Q)

0 commit comments

Comments
 (0)