Skip to content

Commit

Permalink
Merge pull request #540 from JuliaReach/schillic/fix_options
Browse files Browse the repository at this point in the history
Add no-overapproximation option
  • Loading branch information
schillic authored Mar 15, 2019
2 parents ea298e0 + f3c710c commit 8c28564
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/ReachSets/ContinuousPost/BFFPSV18/BFFPSV18.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ function validation_BFFPSV18(𝑂)
# template directions
option = get(Utils.template_direction_symbols, bo, nothing)
if option == nothing
throw(DomainError(key, "if the `$b_options` option is a " *
"Symbol, it must be one of " *
throw(DomainError(bo, "if the `$b_options` option " *
"is a Symbol, it must be one of " *
"$(keys(Utils.template_direction_symbols))"))
end
𝑂.specified[b_options] = option
Expand All @@ -122,12 +122,14 @@ function validation_BFFPSV18(𝑂)
elseif bo isa Real || bo isa Pair{<:UnionAll, <:Real}
ε = bo isa Real ? bo : bo[2]
if ε <= 0
throw(DomainError(key, "the `$b_options` option must be " *
"positive"))
throw(DomainError(ε, "the `$b_options` option must be " *
"positive"))
end
elseif b_options == :block_options_iter && bo == nothing
# no overapproximation
else
throw(DomainError(key, "the `$b_options` option does not " *
"accept $bo"))
throw(DomainError(bo == nothing ? "nothing" : bo,
"the `$b_options` option does not accept the given input"))
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions src/ReachSets/ContinuousPost/BFFPSV18/reach.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ function overapproximate(X::LazySet, pair::Pair)
return overapproximate(X, pair[1], pair[2])
end

function overapproximate(X::LazySet, ::Nothing)
return X
end

function has_constant_directions(block_options::AbstractVector, i::Int)
return has_constant_directions(block_options[i], i)
end
Expand Down

0 comments on commit 8c28564

Please sign in to comment.