diff --git a/src/solve.jl b/src/solve.jl index feaba999..a26b7f69 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -50,7 +50,15 @@ To see all available input options, see function solve(system::InitialValueProblem, options::Options; op::ContinuousPost=default_operator(system)) - solve!(system, copy(options), op=op) + res = solve!(system, copy(options), op=op) + merged_options = merge(res.options.defaults, res.options.specified) + if res isa ReachSolution + return ReachSolution(res.Xk, merged_options) + elseif res isa CheckSolution + return CheckSolution(res.satisfied, res.violation, merged_options) + else + error("unknown solution type $(typeof(res))") + end end solve(system::AbstractSystem, options::Pair{Symbol,<:Any}...) = diff --git a/test/Reachability/solve_continuous.jl b/test/Reachability/solve_continuous.jl index 546a2fce..21b13f28 100644 --- a/test/Reachability/solve_continuous.jl +++ b/test/Reachability/solve_continuous.jl @@ -14,6 +14,7 @@ X0 = BallInf(ones(4), 0.1) # default options (computes all variables) s = solve(IVP(LCS(A), X0), :T=>0.1) @test dim(s.Xk[1].X) == 4 +@test s.options isa Options # two variables and custom partition s = solve(IVP(LCS(A), X0),