Commit af07cd6 1 parent 83a4fe5 commit af07cd6 Copy full SHA for af07cd6
File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 175
175
@test_throws SingularException lu (A)
176
176
end
177
177
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
+
178
213
end
You can’t perform that action at this time.
0 commit comments