Skip to content

Commit

Permalink
fix some piracies
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Mar 10, 2024
1 parent 79c2d49 commit 02a97fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
9 changes: 3 additions & 6 deletions src/Continuous/normalization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,7 @@ function _second_order_linear_matrix(M::AbstractMatrix{N}, C, K; derivatives_las
return A, M⁻¹
end

function normalize(system::SOLCS{N}; derivatives_last=true) where {N}
n = statedim(system)
function normalize(system::SOLCS; derivatives_last=true)
M = mass_matrix(system)
C = viscosity_matrix(system)
K = stiffness_matrix(system)
Expand Down Expand Up @@ -505,8 +504,8 @@ end

@inline isidentity(B::IdentityMultiple) = B.M.λ == oneunit(B.M.λ)

_wrap_invariant(X::LazySet, n::Int) = X
_wrap_invariant(X::Nothing, n::Int) = Universe(n)
_wrap_invariant(X::LazySet, ::Int) = X
_wrap_invariant(::Nothing, n::Int) = Universe(n)

_wrap_inputs(U::AbstractInput, B::IdentityMultiple) = isidentity(B) ? U : map(u -> B * u, U)
_wrap_inputs(U::AbstractInput, B::AbstractMatrix) = map(u -> B * u, U)
Expand Down Expand Up @@ -562,8 +561,6 @@ end
# Shared functionality for linear continuous post operators
# ==========================================================

Base.:*(im::IdentityMultiple, d::Diagonal) = im.M.λ * d # TODO: add to MathematicalSystems

hasinput(S::AbstractSystem) = inputdim(S) > 0
isconstantinput(::ConstantInput) = true
isconstantinput(::VaryingInput) = false
Expand Down
2 changes: 1 addition & 1 deletion src/Flowpipes/MappedFlowpipe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ function overapproximate(fp::Flowpipe, args...)
return Flowpipe(map(R -> overapproximate(R, args...), fp), fp.ext)
end

function overapproximate(fp::VRT, args...) where {RT,VRT<:AbstractVector{RT}}
function overapproximate(fp::AbstractVector{<:AbstractReachSet}, args...)
return Flowpipe(map(R -> overapproximate(R, args...), fp))
end
12 changes: 0 additions & 12 deletions src/Flowpipes/setops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,11 @@ function _reconvert(V::VPOLY{N,VN}, static::Val{true}, dim::Missing) where {N,VN
return _reconvert(V, static, Val(LazySets.dim(V)))
end

Base.convert(::Type{HPolytope{N,VT}}, P::HPolytope{N,VT}) where {N,VT} = P
function Base.convert(::Type{HPolytope{N,VT}}, P) where {N,VT}
return HPolytope([HalfSpace(VT(c.a), c.b) for c in constraints_list(P)])
end

function Base.convert(::Type{Hyperrectangle{N,Vector{N},Vector{N}}},
H::Hyperrectangle{N,SVector{L,N},SVector{L,N}}) where {N,L}
return Hyperrectangle(Vector(H.center), Vector(H.radius))
end

function Base.convert(::Type{Singleton},
cp::CartesianProduct{N,S1,S2}) where {N,S1<:Singleton{N},S2<:Singleton{N}}
x = element(cp.X)
y = element(cp.Y)
return Singleton(vcat(x, y))
end

# duck-typing sampling functions
LazySets._default_sampler(X::IA.Interval) = LazySets._default_sampler(convert(Interval, X))
LazySets._default_sampler(X::IA.IntervalBox) = LazySets._default_sampler(convert(Hyperrectangle, X))
Expand Down

0 comments on commit 02a97fc

Please sign in to comment.