File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 175175 @test_throws SingularException lu (A)
176176end
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+
178213end
You can’t perform that action at this time.
0 commit comments