Skip to content

Commit

Permalink
revise discretization module
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jun 16, 2024
1 parent ad8edd5 commit 582e891
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 123 deletions.
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

0 comments on commit 582e891

Please sign in to comment.