From 58092d75132fb72b702691d24618009cf9936f88 Mon Sep 17 00:00:00 2001 From: schillic Date: Wed, 13 Mar 2019 19:41:04 +0100 Subject: [PATCH] convert internal options representation back to Options type --- src/solve.jl | 10 +++++++++- test/Reachability/solve_continuous.jl | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) 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),