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 discretization module #841

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions src/Discretization/CorrectionHullModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
module CorrectionHullModule

using ..DiscretizationModule
using ..Exponentiation: _exp, _alias, IntervalExpAlg, interval_matrix
using ..Exponentiation: _exp, _alias, IntervalExpAlg
using ..Overapproximate: _convert_or_overapproximate, _overapproximate
using IntervalMatrices: IntervalMatrix, correction_hull, input_correction, _exp_remainder
using IntervalMatrices: AbstractIntervalMatrix, IntervalMatrix, correction_hull,
input_correction, _exp_remainder
using MathematicalSystems
using LazySets
using LazySets: LinearMap
Expand Down Expand Up @@ -137,7 +138,7 @@ function discretize(ivp::IVP{<:CLCCS,<:LazySet}, δ, alg::CorrectionHull)

Φ = _exp(A, δ, alg.exp)

A_interval = interval_matrix(A)
A_interval = A isa AbstractIntervalMatrix ? A : IntervalMatrix(A)

origin_not_contained_in_U = zeros(dim(U)) ∉ Uz

Expand Down
8 changes: 2 additions & 6 deletions src/Discretization/DiscretizationModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ next_set(inputs::AbstractInput, state::Int64) = collect(nextinput(inputs, state)

abstract type AbstractApproximationModel end

function _default_approximation_model(ivp::IVP{<:AbstractContinuousSystem})
function _default_approximation_model(::IVP{<:AbstractContinuousSystem})
return Forward()
end

Expand All @@ -39,17 +39,13 @@ isinterval(A::IntervalMatrix{N,IT}) where {N,IT<:IA.Interval{N}} = true
isinterval(A::AbstractMatrix{IT}) where {IT<:IA.Interval} = true

# options for a-posteriori transformation of a discretized set
# valid options are:
# AbstractDirections, Val{:lazy}, Val{:concrete}, Val{:vrep}, Val{:zono}, Val{:zonotope}
# _alias(setops) = setops # no-op

_alias(setops::AbstractDirections) = setops
_alias(setops::Val{:lazy}) = setops
_alias(setops::Val{:concrete}) = setops
_alias(setops::Val{:vrep}) = setops
_alias(setops::Val{:box}) = setops
_alias(setops::Val{:zono}) = setops
_alias(setops::Val{:zonotope}) = Val(:zono)
_alias(::Val{:zonotope}) = Val(:zono)

"""
discretize(ivp::IVP, δ, alg::AbstractApproximationModel)
Expand Down
Loading