diff --git a/src/ConcreteOperations/minkowski_sum.jl b/src/ConcreteOperations/minkowski_sum.jl index 332c83ce68..104934a3f7 100644 --- a/src/ConcreteOperations/minkowski_sum.jl +++ b/src/ConcreteOperations/minkowski_sum.jl @@ -245,7 +245,6 @@ function minkowski_sum(X::AbstractSingleton, Y::AbstractSingleton) return Singleton(element(X) + element(Y)) end - function _minkowski_sum_vpolygon(P::LazySet, Q::LazySet) return minkowski_sum(convert(VPolygon, P), convert(VPolygon, Q)) end diff --git a/src/Sets/Hyperplane/init_SymEngine.jl b/src/Sets/Hyperplane/init_SymEngine.jl index 81078a7131..c0926b6506 100644 --- a/src/Sets/Hyperplane/init_SymEngine.jl +++ b/src/Sets/Hyperplane/init_SymEngine.jl @@ -5,8 +5,9 @@ function free_symbols(expr::Expr, ::Type{<:Hyperplane}) lhs = convert(SymEngine.Basic, expr.args[1]) # treats the 4 in :(2*x1 = 4) - rhs = :args in fieldnames(typeof(expr.args[2])) ? convert(SymEngine.Basic, expr.args[2].args[2]) : - convert(SymEngine.Basic, expr.args[2]) + rhs = :args in fieldnames(typeof(expr.args[2])) ? + convert(SymEngine.Basic, expr.args[2].args[2]) : + convert(SymEngine.Basic, expr.args[2]) return SymEngine.free_symbols(lhs - rhs) end diff --git a/src/Sets/Zonotope/split.jl b/src/Sets/Zonotope/split.jl index 5554d701bc..920acb797b 100644 --- a/src/Sets/Zonotope/split.jl +++ b/src/Sets/Zonotope/split.jl @@ -41,8 +41,10 @@ function load_StaticArraysCore_split() function _split_ret(Z₁::Zonotope{N,SV,SM}, Z₂::Zonotope{N,SV,SM}) where {N,n,p,SV<:MVector{n,N},SM<:MMatrix{n,p,N}} - Z₁ = Zonotope(StaticArraysCore.SVector{n}(Z₁.center), StaticArraysCore.SMatrix{n,p}(Z₁.generators)) - Z₂ = Zonotope(StaticArraysCore.SVector{n}(Z₂.center), StaticArraysCore.SMatrix{n,p}(Z₂.generators)) + Z₁ = Zonotope(StaticArraysCore.SVector{n}(Z₁.center), + StaticArraysCore.SMatrix{n,p}(Z₁.generators)) + Z₂ = Zonotope(StaticArraysCore.SVector{n}(Z₂.center), + StaticArraysCore.SMatrix{n,p}(Z₂.generators)) return Z₁, Z₂ end end diff --git a/test/Interfaces/SymEngine.jl b/test/Interfaces/SymEngine.jl index f942c6a802..5e53813834 100644 --- a/test/Interfaces/SymEngine.jl +++ b/test/Interfaces/SymEngine.jl @@ -1,10 +1,10 @@ # _is_linearcombination -@test LazySets._is_linearcombination(:(2*x1 - 4)) -@test LazySets._is_linearcombination(:(6.1 - 5.3*f - 0.1*g)) -@test !LazySets._is_linearcombination(:(2*x1^2)) -@test !LazySets._is_linearcombination(:(x1^2 - 4*x2 + x3 + 2)) +@test LazySets._is_linearcombination(:(2 * x1 - 4)) +@test LazySets._is_linearcombination(:(6.1 - 5.3 * f - 0.1 * g)) +@test !LazySets._is_linearcombination(:(2 * x1^2)) +@test !LazySets._is_linearcombination(:(x1^2 - 4 * x2 + x3 + 2)) # _free_symbols @test LazySets._free_symbols(:(x1 = 1)) == [SymEngine.Basic(:(x1))] -@test LazySets._free_symbols(:(2*x2 <= 4)) == [SymEngine.Basic(:(x2))] +@test LazySets._free_symbols(:(2 * x2 <= 4)) == [SymEngine.Basic(:(x2))] @test_throws ErrorException LazySets._free_symbols(:(x3 != 4)) diff --git a/test/Sets/HalfSpace.jl b/test/Sets/HalfSpace.jl index 3778550d31..481658bca5 100644 --- a/test/Sets/HalfSpace.jl +++ b/test/Sets/HalfSpace.jl @@ -257,24 +257,24 @@ for N in [Float64] # _is_halfspace @test all(LazySets._is_halfspace.([:(x1 <= 0), :(x1 < 0), :(x1 > 0), :(x1 >= 0)])) @test !LazySets._is_halfspace(:(x1 = 0)) - @test LazySets._is_halfspace(:(2*x1 <= 4)) - @test LazySets._is_halfspace(:(6.1 <= 5.3*f - 0.1*g)) - @test !LazySets._is_halfspace(:(2*x1^2 <= 4)) - @test !LazySets._is_halfspace(:(x1^2 > 4*x2 - x3)) - @test LazySets._is_halfspace(:(x1 > 4*x2 - x3)) + @test LazySets._is_halfspace(:(2 * x1 <= 4)) + @test LazySets._is_halfspace(:(6.1 <= 5.3 * f - 0.1 * g)) + @test !LazySets._is_halfspace(:(2 * x1^2 <= 4)) + @test !LazySets._is_halfspace(:(x1^2 > 4 * x2 - x3)) + @test LazySets._is_halfspace(:(x1 > 4 * x2 - x3)) # convert H = convert(HalfSpace, :(x1 <= -0.03)) - @test H == HalfSpace([1.0], -0.03) + @test H == HalfSpace([1.0], -0.03) H = convert(HalfSpace, :(x1 < -0.03)) @test H == HalfSpace([1.0], -0.03) H = convert(HalfSpace, :(x1 > -0.03)) @test H == HalfSpace([-1.0], 0.03) H = convert(HalfSpace, :(x1 >= -0.03)) @test H == HalfSpace([-1.0], 0.03) - H = convert(HalfSpace, :(x1 + x2 <= 2*x4 + 6)) + H = convert(HalfSpace, :(x1 + x2 <= 2 * x4 + 6)) @test H == HalfSpace([1.0, 1.0, -2.0], 6.0) - H = convert(HalfSpace, :(x1 + x2 <= 2*x4 + 6), vars=SymEngine.Basic[:x1, :x2, :x3, :x4]) + H = convert(HalfSpace, :(x1 + x2 <= 2 * x4 + 6); vars=SymEngine.Basic[:x1, :x2, :x3, :x4]) @test H == HalfSpace([1.0, 1.0, 0.0, -2.0], 6.0) end end diff --git a/test/Sets/Hyperplane.jl b/test/Sets/Hyperplane.jl index 5d37a2fdb3..f4b05636f7 100644 --- a/test/Sets/Hyperplane.jl +++ b/test/Sets/Hyperplane.jl @@ -209,20 +209,20 @@ for N in [Float64] # _is_halfspace @test LazySets._is_hyperplane(:(x1 = 0)) @test !LazySets._is_hyperplane(:(x1 <= 0)) - @test LazySets._is_hyperplane(:(2*x1 = 4)) - @test LazySets._is_hyperplane(:(6.1 = 5.3*f - 0.1*g)) - @test !LazySets._is_hyperplane(:(2*x1^2 = 4)) - @test !LazySets._is_hyperplane(:(x1^2 = 4*x2 - x3)) - @test LazySets._is_hyperplane(:(x1 = 4*x2 - x3)) + @test LazySets._is_hyperplane(:(2 * x1 = 4)) + @test LazySets._is_hyperplane(:(6.1 = 5.3 * f - 0.1 * g)) + @test !LazySets._is_hyperplane(:(2 * x1^2 = 4)) + @test !LazySets._is_hyperplane(:(x1^2 = 4 * x2 - x3)) + @test LazySets._is_hyperplane(:(x1 = 4 * x2 - x3)) # convert H = convert(Hyperplane, :(x1 = -0.03)) @test H == Hyperplane([1.0], -0.03) H = convert(Hyperplane, :(x1 + 0.03 = 0)) @test H == Hyperplane([1.0], -0.03) - H = convert(Hyperplane, :(x1 + x2 = 2*x4 + 6)) + H = convert(Hyperplane, :(x1 + x2 = 2 * x4 + 6)) @test H == Hyperplane([1.0, 1.0, -2.0], 6.0) - H = convert(Hyperplane, :(x1 + x2 = 2*x4 + 6), vars=SymEngine.Basic[:x1, :x2, :x3, :x4]) + H = convert(Hyperplane, :(x1 + x2 = 2 * x4 + 6); vars=SymEngine.Basic[:x1, :x2, :x3, :x4]) @test H == Hyperplane([1.0, 1.0, 0.0, -2.0], 6.0) end end