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 e3a0a98
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/ReachSets/ContinuousPost/BFFPS19/reach.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ..Utils: LDS, CLCDS

using LazySets: CacheMinkowskiSum,
isdisjoint
using LazySets: CachedMinkowskiSumArray,
isdisjoint

import LazySets.Approximations: overapproximate

Expand Down Expand Up @@ -140,10 +140,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 +152,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: 4 additions & 4 deletions src/ReachSets/ContinuousPost/BFFPSV18/check_property.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using LazySets: CacheMinkowskiSum
using LazySets: CachedMinkowskiSumArray

"""
check_property(S, property, options)
Expand Down Expand Up @@ -92,10 +92,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 +104,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
10 changes: 5 additions & 5 deletions src/ReachSets/ContinuousPost/BFFPSV18/reach.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ..Utils: LDS, CLCDS

using LazySets: CacheMinkowskiSum,
isdisjoint
using LazySets: CachedMinkowskiSumArray,
isdisjoint

import LazySets.Approximations: overapproximate

Expand Down Expand Up @@ -120,10 +120,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 +132,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 e3a0a98

Please sign in to comment.