Skip to content

Commit af07cd6

Browse files
committed
add test
1 parent 83a4fe5 commit af07cd6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/mps.jl

+35
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,39 @@ end
175175
@test_throws SingularException lu(A)
176176
end
177177

178+
@testset "solves" begin
179+
b = MtlVector(rand(Float32, 1024))
180+
B = MtlMatrix(rand(Float32, 1024, 1024))
181+
182+
A = MtlMatrix(rand(Float32, 1024, 512))
183+
x = lu(A) \ b
184+
@test A * x b
185+
X = lu(A) \ B
186+
@test A * X B
187+
188+
A = UpperTriangular(MtlMatrix(rand(Float32, 1024, 1024)))
189+
x = A \ b
190+
@test A * x b
191+
X = A \ B
192+
@test A * X B
193+
194+
A = UnitUpperTriangular(MtlMatrix(rand(Float32, 1024, 1024)))
195+
x = A \ b
196+
@test A * x b
197+
X = A \ B
198+
@test A * X B
199+
200+
A = LowerTriangular(MtlMatrix(rand(Float32, 1024, 1024)))
201+
x = A \ b
202+
@test A * x b
203+
X = A \ B
204+
@test A * X B
205+
206+
A = UnitLowerTriangular(MtlMatrix(rand(Float32, 1024, 1024)))
207+
x = A \ b
208+
@test A * x b
209+
X = A \ B
210+
@test A * X B
211+
end
212+
178213
end

0 commit comments

Comments
 (0)