Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tgymnich committed Sep 5, 2023
1 parent 83a4fe5 commit af07cd6
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/mps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,39 @@ end
@test_throws SingularException lu(A)
end

@testset "solves" begin
b = MtlVector(rand(Float32, 1024))
B = MtlMatrix(rand(Float32, 1024, 1024))

A = MtlMatrix(rand(Float32, 1024, 512))
x = lu(A) \ b
@test A * x b
X = lu(A) \ B
@test A * X B

A = UpperTriangular(MtlMatrix(rand(Float32, 1024, 1024)))
x = A \ b
@test A * x b
X = A \ B
@test A * X B

A = UnitUpperTriangular(MtlMatrix(rand(Float32, 1024, 1024)))
x = A \ b
@test A * x b
X = A \ B
@test A * X B

A = LowerTriangular(MtlMatrix(rand(Float32, 1024, 1024)))
x = A \ b
@test A * x b
X = A \ B
@test A * X B

A = UnitLowerTriangular(MtlMatrix(rand(Float32, 1024, 1024)))
x = A \ b
@test A * x b
X = A \ B
@test A * X B
end

end

0 comments on commit af07cd6

Please sign in to comment.