diff --git a/docs/src/lib/approximations.md b/docs/src/lib/approximations.md index 5d5adbe3ef..3c815f071d 100644 --- a/docs/src/lib/approximations.md +++ b/docs/src/lib/approximations.md @@ -47,6 +47,7 @@ approximate ```@docs box_approximation interval_hull +□(::LazySet) symmetric_interval_hull box_approximation_symmetric ballinf_approximation diff --git a/src/Approximations/Approximations.jl b/src/Approximations/Approximations.jl index 41f7181afe..e7467588aa 100644 --- a/src/Approximations/Approximations.jl +++ b/src/Approximations/Approximations.jl @@ -16,7 +16,7 @@ using LazySets.JuMP: Model, set_silent, @variable, @constraint, optimize!, value, @NLobjective import Base: convert -import LazySets: project +import LazySets: project, □ using ..LazySets: @assert, activate_assertions # activate assertions by default diff --git a/src/Approximations/box_approximation.jl b/src/Approximations/box_approximation.jl index 8cd3d56772..db60500a65 100644 --- a/src/Approximations/box_approximation.jl +++ b/src/Approximations/box_approximation.jl @@ -78,6 +78,13 @@ Alias for `box_approximation`. """ interval_hull = box_approximation +""" + □(X::LazySet) + +Alias for `box_approximation(X)`. +""" +□(X::LazySet) = box_approximation(X) + # AbstractHyperrectangle specialization function box_approximation(S::AbstractHyperrectangle) return Hyperrectangle(center(S), radius_hyperrectangle(S)) diff --git a/test/Approximations/box_approximation.jl b/test/Approximations/box_approximation.jl index d59a0f6e14..f025868ca9 100644 --- a/test/Approximations/box_approximation.jl +++ b/test/Approximations/box_approximation.jl @@ -38,6 +38,9 @@ for N in [Float64, Rational{Int}, Float32] E = EmptySet{N}(2) @test box_approximation(E) == E + # alias constructors + @test interval_hull(b) == □(b) == box_approximation(b) + # =================================================================== # Testing box_approximation_symmetric (= symmetric interval hull) # ===================================================================