Skip to content

Commit

Permalink
less invasive changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch authored May 22, 2024
1 parent 704ea17 commit dd75d9d
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions stdlib/LinearAlgebra/test/abstractq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,31 +127,30 @@ n = 5
@test QS isa Array{eltype(Q),0}
end

@testset "matrix division" begin
q, r = F
R = randn(Float64, 5, 5)
@test q / r Matrix(q) / r
@test_throws DimensionMismatch MyQ(q) / r # doesn't have size flexibility
@test q / R collect(q) / R
@test copy(r') \ q' (q / r)'
@test_throws DimensionMismatch copy(r') \ MyQ(q')
@test r \ q' r \ Matrix(q)'
@test R \ q' R \ MyQ(q') R \ collect(q')
@test R \ q R \ MyQ(q) R \ collect(q)
B = copy(A')
G = lq(B)
l, q = G
L = R
@test l \ q l \ Matrix(q)
@test_throws DimensionMismatch l \ MyQ(q)
@test L \ q L \ collect(q)
@test q' / copy(l') (l \ q)'
@test_throws DimensionMismatch MyQ(q') / copy(l')
@test q' / l Matrix(q)' / l
@test q' / L MyQ(q') / L collect(q)' / L
@test q / L Matrix(q) / L
@test MyQ(q) / L collect(q) / L
end
# matrix division
q, r = F
R = randn(Float64, 5, 5)
@test q / r Matrix(q) / r
@test_throws DimensionMismatch MyQ(q) / r # doesn't have size flexibility
@test q / R collect(q) / R
@test copy(r') \ q' (q / r)'
@test_throws DimensionMismatch copy(r') \ MyQ(q')
@test r \ q' r \ Matrix(q)'
@test R \ q' R \ MyQ(q') R \ collect(q')
@test R \ q R \ MyQ(q) R \ collect(q)
B = copy(A')
G = lq(B)
l, q = G
L = R
@test l \ q l \ Matrix(q)
@test_throws DimensionMismatch l \ MyQ(q)
@test L \ q L \ collect(q)
@test q' / copy(l') (l \ q)'
@test_throws DimensionMismatch MyQ(q') / copy(l')
@test q' / l Matrix(q)' / l
@test q' / L MyQ(q') / L collect(q)' / L
@test q / L Matrix(q) / L
@test MyQ(q) / L collect(q) / L
end

end # module

0 comments on commit dd75d9d

Please sign in to comment.