Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise discretize #503

Merged
merged 25 commits into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions docs/src/lib/discretize.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,3 @@ CurrentModule = Reachability.ReachSets
```@docs
discretize
```

## Dense-time reachability

```@docs
discr_bloat_firstorder
discr_bloat_interpolation
```

## Discrete-time reachability

```@docs
discr_no_bloat
```
20 changes: 4 additions & 16 deletions src/ReachSets/ContinuousPost/BFFPSV18/BFFPSV18.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
function options_BFFPSV18()
return OptionSpec[
# general options
OptionSpec(:approx_model, "forward", domain=String, domain_check=(
OptionSpec(:approximation, "forward", domain=String, domain_check=(
mforets marked this conversation as resolved.
Show resolved Hide resolved
v -> v in ["forward", "backward", "firstorder", "nobloating"]),
info="model for bloating/continuous time analysis"),
OptionSpec(:algorithm, "explicit", domain=String, domain_check=(
Expand All @@ -41,16 +41,10 @@ function options_BFFPSV18()
"containing its indices"),

# discretization options
OptionSpec(:lazy_sih, false, domain=Bool,
OptionSpec(:sih_method, "concrete", domain=String,
info="use a lazy symmetric interval hull in discretization?"),
mforets marked this conversation as resolved.
Show resolved Hide resolved
OptionSpec(:lazy_expm, false, domain=Bool,
info="use a lazy matrix exponential all the time?"),
OptionSpec(:lazy_expm_discretize, false, domain=Bool,
info="use a lazy matrix exponential in discretization?"),
OptionSpec(:pade_expm, false, domain=Bool,
info="use the Padé approximant method (instead of Julia's " *
" built-in 'exp') to compute the lazy matrix exponential " *
"in discretization?"),
OptionSpec(:exp_method, "base", domain=String,
info="method to compute the matrix exponential"),
mforets marked this conversation as resolved.
Show resolved Hide resolved
OptionSpec(:assume_sparse, false, domain=Bool,
info="use an analysis for sparse discretized matrices?"),

Expand Down Expand Up @@ -208,12 +202,6 @@ function normalization_BFFPSV18!(𝑂::TwoLayerOptions)
end

function validation_BFFPSV18(𝑂)
# lazy_expm_discretize & lazy_expm
if !𝑂[:lazy_expm_discretize] && 𝑂[:lazy_expm]
throw(DomainError(𝑂[:lazy_expm_discretize], "cannot use option " *
"':lazy_expm' with deactivated option ':lazy_expm_discretize'"))
end

# block_types
if haskey_specified(𝑂, :block_types)
for (key, value) in 𝑂[:block_types]
Expand Down
14 changes: 4 additions & 10 deletions src/ReachSets/ContinuousPost/BFFPSV18/check_property.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,10 @@ function check_property(S::IVP{<:AbstractContinuousSystem},
# Time discretization
# ===================
info("Time discretization...")
Δ = @timing begin
discretize(
S,
options[:δ],
approx_model=options[:approx_model],
pade_expm=options[:pade_expm],
lazy_expm=options[:lazy_expm_discretize],
lazy_sih=options[:lazy_sih]
)
end
Δ = @timing discretize(S, options[:δ], approximation=options[:approximation],
exp_method=options[:exp_method],
sih_method=options[:sih_method])
# TODO: remove this conversion and the option assume_sparse ?
Δ = matrix_conversion_lazy_explicit(Δ, options)
mforets marked this conversation as resolved.
Show resolved Hide resolved
return check_property(Δ, property, options)
end
15 changes: 5 additions & 10 deletions src/ReachSets/ContinuousPost/BFFPSV18/reach.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,11 @@ function reach(system::IVP{<:AbstractContinuousSystem},
# Time discretization
# ===================
info("Time discretization...")
Δ = @timing begin
discretize(
system,
options[:δ],
approx_model=options[:approx_model],
pade_expm=options[:pade_expm],
lazy_expm=options[:lazy_expm_discretize],
lazy_sih=options[:lazy_sih]
)
end
Δ = @timing discretize(system, options[:δ], approximation=options[:approximation],
exp_method=options[:exp_method],
sih_method=options[:sih_method])

# TODO: remove this conversion and the option assume_sparse ?
Δ = matrix_conversion_lazy_explicit(Δ, options)
return reach(Δ, invariant, options)
end
Expand Down
Loading