Skip to content

Commit

Permalink
Merge pull request #802 from JuliaReach/schillic/790
Browse files Browse the repository at this point in the history
Fix some piracies
  • Loading branch information
schillic authored Mar 17, 2024
2 parents 71baae7 + 441d377 commit 0a3f6f5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 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
7 changes: 0 additions & 7 deletions src/Flowpipes/setops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,6 @@ function Base.convert(::Type{Hyperrectangle{N,Vector{N},Vector{N}}},
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 0a3f6f5

Please sign in to comment.