Skip to content

Commit 9aec273

Browse files
Update basictests.jl
1 parent e622f96 commit 9aec273

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

test/basictests.jl

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ function test_interface(alg, prob1, prob2)
3838
A2 = prob2.A
3939
b2 = prob2.b
4040
x2 = prob2.u0
41-
A3 = prob3.A
42-
b3 = prob3.b
43-
A4 = prob4.A
44-
b4 = prob4.b
4541

4642
sol = solve(prob1, alg; cache_kwargs...)
4743
@test A1 * sol.u b1
4844

45+
sol = solve(prob1, alg; cache_kwargs...)
46+
@test A2 * sol.u b2
47+
4948
cache = SciMLBase.init(prob1, alg; cache_kwargs...) # initialize cache
5049
sol = solve!(cache)
5150
@test A1 * sol.u b1
@@ -57,29 +56,13 @@ function test_interface(alg, prob1, prob2)
5756
cache.b = b2
5857
sol = solve!(cache; cache_kwargs...)
5958
@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-
7759
return
7860
end
7961

8062
@testset "LinearSolve" begin
8163
@testset "Default Linear Solver" begin
8264
test_interface(nothing, prob1, prob2)
65+
test_interface(nothing, prob3, prob4)
8366

8467
A1 = prob1.A * prob1.A'
8568
b1 = prob1.b
@@ -251,6 +234,7 @@ end
251234
for alg in test_algs
252235
@testset "$alg" begin
253236
test_interface(alg, prob1, prob2)
237+
test_interface(alg, prob3, prob4)
254238
end
255239
end
256240
if LinearSolve.appleaccelerate_isavailable()
@@ -271,6 +255,7 @@ end
271255
@testset "fact_alg = $fact_alg" begin
272256
alg = GenericFactorization(fact_alg = fact_alg)
273257
test_interface(alg, prob1, prob2)
258+
test_interface(alg, prob3, prob4)
274259
end
275260
end
276261
end
@@ -288,6 +273,7 @@ end
288273
("MINRES", KrylovJL_MINRES(kwargs...)))
289274
@testset "$(alg[1])" begin
290275
test_interface(alg[2], prob1, prob2)
276+
test_interface(alg[2], prob3, prob4)
291277
end
292278
end
293279
end
@@ -303,6 +289,7 @@ end
303289
)
304290
@testset "$(alg[1])" begin
305291
test_interface(alg[2], prob1, prob2)
292+
test_interface(alg[2], prob3, prob4)
306293
end
307294
end
308295
end
@@ -316,6 +303,7 @@ end
316303
("GMRES", KrylovKitJL_GMRES(kwargs...)))
317304
@testset "$(alg[1])" begin
318305
test_interface(alg[2], prob1, prob2)
306+
test_interface(alg[2], prob3, prob4)
319307
end
320308
@test alg[2] isa KrylovKitJL
321309
end

0 commit comments

Comments
 (0)