@@ -38,14 +38,13 @@ function test_interface(alg, prob1, prob2)
38
38
A2 = prob2. A
39
39
b2 = prob2. b
40
40
x2 = prob2. u0
41
- A3 = prob3. A
42
- b3 = prob3. b
43
- A4 = prob4. A
44
- b4 = prob4. b
45
41
46
42
sol = solve (prob1, alg; cache_kwargs... )
47
43
@test A1 * sol. u ≈ b1
48
44
45
+ sol = solve (prob1, alg; cache_kwargs... )
46
+ @test A2 * sol. u ≈ b2
47
+
49
48
cache = SciMLBase. init (prob1, alg; cache_kwargs... ) # initialize cache
50
49
sol = solve! (cache)
51
50
@test A1 * sol. u ≈ b1
@@ -57,29 +56,13 @@ function test_interface(alg, prob1, prob2)
57
56
cache. b = b2
58
57
sol = solve! (cache; cache_kwargs... )
59
58
@test A2 * sol. u ≈ b2
60
-
61
- # Test complex numbers via cache interface
62
- cache. A = A3
63
- cache. b = b3
64
- sol = solve! (cache; cache_kwargs... )
65
- @test A3 * sol. u ≈ b3
66
-
67
- # Test mixed types via cache interface
68
- cache. A = A4
69
- cache. b = b4
70
- sol = solve! (cache; cache_kwargs... )
71
- @test A4 * sol. u ≈ b4
72
-
73
- # Test mixed types from scratch
74
- sol = solve (prob4, alg; cache_kwargs... )
75
- @test A4 * sol. u ≈ b4
76
-
77
59
return
78
60
end
79
61
80
62
@testset " LinearSolve" begin
81
63
@testset " Default Linear Solver" begin
82
64
test_interface (nothing , prob1, prob2)
65
+ test_interface (nothing , prob3, prob4)
83
66
84
67
A1 = prob1. A * prob1. A'
85
68
b1 = prob1. b
251
234
for alg in test_algs
252
235
@testset " $alg " begin
253
236
test_interface (alg, prob1, prob2)
237
+ test_interface (alg, prob3, prob4)
254
238
end
255
239
end
256
240
if LinearSolve. appleaccelerate_isavailable ()
271
255
@testset " fact_alg = $fact_alg " begin
272
256
alg = GenericFactorization (fact_alg = fact_alg)
273
257
test_interface (alg, prob1, prob2)
258
+ test_interface (alg, prob3, prob4)
274
259
end
275
260
end
276
261
end
288
273
(" MINRES" , KrylovJL_MINRES (kwargs... )))
289
274
@testset " $(alg[1 ]) " begin
290
275
test_interface (alg[2 ], prob1, prob2)
276
+ test_interface (alg[2 ], prob3, prob4)
291
277
end
292
278
end
293
279
end
303
289
)
304
290
@testset " $(alg[1 ]) " begin
305
291
test_interface (alg[2 ], prob1, prob2)
292
+ test_interface (alg[2 ], prob3, prob4)
306
293
end
307
294
end
308
295
end
316
303
(" GMRES" , KrylovKitJL_GMRES (kwargs... )))
317
304
@testset " $(alg[1 ]) " begin
318
305
test_interface (alg[2 ], prob1, prob2)
306
+ test_interface (alg[2 ], prob3, prob4)
319
307
end
320
308
@test alg[2 ] isa KrylovKitJL
321
309
end
0 commit comments