Skip to content

Commit 5d1bebd

Browse files
committed
test that solution contains original problem
1 parent 519b8c8 commit 5d1bebd

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

test/inf_integral_tests.jl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ abstol = 1e-3
77
alg_req = Dict(
88
QuadratureRule(gausslegendre, n = 50) => (
99
nout = Inf, min_dim = 1, max_dim = 1, allows_batch = false,
10-
allows_iip = false, allows_inf = true), QuadGKJL() => (
11-
nout = Inf, allows_batch = true, min_dim = 1, max_dim = 1,
10+
allows_iip = false, allows_inf = true),
11+
QuadGKJL() => (nout = Inf, allows_batch = true, min_dim = 1, max_dim = 1,
1212
allows_iip = true, allows_inf = true),
1313
HCubatureJL() => (nout = Inf, allows_batch = false, min_dim = 1,
14-
max_dim = Inf, allows_iip = true, allows_inf = true), CubatureJLh() => (
15-
nout = Inf, allows_batch = true, min_dim = 1,
14+
max_dim = Inf, allows_iip = true, allows_inf = true),
15+
CubatureJLh() => (nout = Inf, allows_batch = true, min_dim = 1,
1616
max_dim = Inf, allows_iip = true, allows_inf = true)
1717
)
1818
# GaussLegendre(n=50) => (nout = Inf, min_dim = 1, max_dim = 1, allows_batch = false,
@@ -206,11 +206,16 @@ end
206206
# two distinct semi-infinite transformations should still work as expected
207207
(; f, domain, solution) = problems[8]
208208
prob = IntegralProblem(f, domain)
209-
cache = init(prob, QuadGKJL(); abstol, reltol)
210-
sol = solve!(cache).u
211-
@test abs(only(sol) - solution) < max(abstol, reltol * abs(solution))
209+
alg = QuadGKJL()
210+
cache = init(prob, alg; abstol, reltol)
211+
sol = solve!(cache)
212+
@test abs(only(sol.u) - solution) < max(abstol, reltol * abs(solution))
213+
@test sol.prob == IntegralProblem(f, domain)
214+
@test sol.alg == alg
212215
(; domain, solution) = problems[9]
213216
cache.domain = domain
214-
sol = solve!(cache).u
215-
@test abs(only(sol) - solution) < max(abstol, reltol * abs(solution))
217+
sol = solve!(cache)
218+
@test abs(only(sol.u) - solution) < max(abstol, reltol * abs(solution))
219+
@test sol.prob == IntegralProblem(f, domain)
220+
@test sol.alg == alg
216221
end

0 commit comments

Comments
 (0)