Skip to content

Commit

Permalink
rename CacheMinkowskiSum
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jan 15, 2020
1 parent 10cee9e commit 9028e5c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
9 changes: 3 additions & 6 deletions src/ReachSets/ContinuousPost/BFFPS19/reach.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using ..Utils: LDS, CLCDS

using LazySets: CacheMinkowskiSum,
isdisjoint

import LazySets.Approximations: overapproximate

"""
Expand Down Expand Up @@ -140,10 +137,10 @@ function reach_mixed(problem::Union{IVP{<:CLDS{NUM}, <:LazySet{NUM}},
# first set in a series
function _f(k, i, x::LinearMap{NUM}) where {NUM}
@assert k == 1 "a LinearMap is only expected in the first iteration"
return CacheMinkowskiSum(LazySet{NUM}[x])
return CachedMinkowskiSumArray(LazySet{NUM}[x])
end
# further sets of the series
function _f(k, i, x::MinkowskiSum{NUM, <:CacheMinkowskiSum}) where NUM
function _f(k, i, x::MinkowskiSum{NUM, <:CachedMinkowskiSumArray}) where NUM
if has_constant_directions(block_options_iter, i)
# forget sets if we do not use epsilon-close approximation
forget_sets!(x.X)
Expand All @@ -152,7 +149,7 @@ function reach_mixed(problem::Union{IVP{<:CLDS{NUM}, <:LazySet{NUM}},
if lazy_inputs_interval(k)
# overapproximate lazy set
y = overapproximate_fun(i, x.X)
return CacheMinkowskiSum(LazySet{NUM}[y])
return CachedMinkowskiSumArray(LazySet{NUM}[y])
end
return x.X
end
Expand Down
8 changes: 3 additions & 5 deletions src/ReachSets/ContinuousPost/BFFPSV18/check_property.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using LazySets: CacheMinkowskiSum

"""
check_property(S, property, options)
Expand Down Expand Up @@ -92,10 +90,10 @@ function check_property(S::IVP{<:AbstractDiscreteSystem},
# first set in a series
function _f(k, i, x::LinearMap{NUM}) where {NUM}
@assert k == 1 "a LinearMap is only expected in the first iteration"
return CacheMinkowskiSum(LazySet{NUM}[x])
return CachedMinkowskiSumArray(LazySet{NUM}[x])
end
# further sets of the series
function _f(k, i, x::MinkowskiSum{NUM, <:CacheMinkowskiSum}) where NUM
function _f(k, i, x::MinkowskiSum{NUM, <:CachedMinkowskiSumArray}) where NUM
if has_constant_directions(block_options_iter, i)
# forget sets if we do not use epsilon-close approximation
forget_sets!(x.X)
Expand All @@ -104,7 +102,7 @@ function check_property(S::IVP{<:AbstractDiscreteSystem},
if lazy_inputs_interval(k)
# overapproximate lazy set
y = overapproximate_fun(i, x.X)
return CacheMinkowskiSum(LazySet{NUM}[y])
return CachedMinkowskiSumArray(LazySet{NUM}[y])
end
return x.X
end
Expand Down
9 changes: 3 additions & 6 deletions src/ReachSets/ContinuousPost/BFFPSV18/reach.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using ..Utils: LDS, CLCDS

using LazySets: CacheMinkowskiSum,
isdisjoint

import LazySets.Approximations: overapproximate

"""
Expand Down Expand Up @@ -120,10 +117,10 @@ function reach(problem::Union{IVP{<:CLDS{NUM}, <:LazySet{NUM}},
# first set in a series
function _f(k, i, x::LinearMap{NUM}) where {NUM}
@assert k == 1 "a LinearMap is only expected in the first iteration"
return CacheMinkowskiSum(LazySet{NUM}[x])
return CachedMinkowskiSumArray(LazySet{NUM}[x])
end
# further sets of the series
function _f(k, i, x::MinkowskiSum{NUM, <:CacheMinkowskiSum}) where NUM
function _f(k, i, x::MinkowskiSum{NUM, <:CachedMinkowskiSumArray}) where NUM
if has_constant_directions(block_options_iter, i)
# forget sets if we do not use epsilon-close approximation
forget_sets!(x.X)
Expand All @@ -132,7 +129,7 @@ function reach(problem::Union{IVP{<:CLDS{NUM}, <:LazySet{NUM}},
if lazy_inputs_interval(k)
# overapproximate lazy set
y = overapproximate_fun(i, x.X)
return CacheMinkowskiSum(LazySet{NUM}[y])
return CachedMinkowskiSumArray(LazySet{NUM}[y])
end
return x.X
end
Expand Down
5 changes: 5 additions & 0 deletions test/Reachability/solve_continuous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ s = solve(IVP(LCS(sparse(A)), X0),
op=BFFPSV18(:vars=>[1,3], :partition=>[1:2, 3:4], :exp_method=>"lazy",
:assume_sparse=>true))

s = solve(IVP(LCS(A), X0),
Options(:T=>0.1),
op=BFFPSV18(:vars=>[1,3], :partition=>[1:2, 3:4],
:lazy_inputs_interval => (k -> false)))

# uses Interval for set_type_init and set_type_iter but Hyperrectangle for
# set_type_proj
s = solve(IVP(LCS(sparse(A)), X0),
Expand Down

0 comments on commit 9028e5c

Please sign in to comment.