diff --git a/test/mps.jl b/test/mps.jl index 1e28807f5..fd3482eeb 100644 --- a/test/mps.jl +++ b/test/mps.jl @@ -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 \ No newline at end of file