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

Fix some piracies #802

Merged
merged 1 commit into from
Mar 17, 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
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 @@ -114,13 +114,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
Loading