Skip to content

Commit

Permalink
convert internal options representation back to Options type
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Mar 13, 2019
1 parent b81c820 commit 58092d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}...) =
Expand Down
1 change: 1 addition & 0 deletions test/Reachability/solve_continuous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 58092d7

Please sign in to comment.