diff --git a/src/LazyOperations/Rectification.jl b/src/LazyOperations/Rectification.jl index a4e57da42e..246dcef340 100644 --- a/src/LazyOperations/Rectification.jl +++ b/src/LazyOperations/Rectification.jl @@ -113,6 +113,10 @@ isoperationtype(::Type{<:Rectification}) = true isconvextype(::Type{<:Rectification}) = false +isconvextype(::Type{<:Rectification{N,<:AbstractHyperrectangle}}) where {N} = true +isconvextype(::Type{<:Rectification{N,<:EmptySet}}) where {N} = true +isconvextype(::Type{<:Rectification{N,<:Universe}}) where {N} = true + function _compute_exact_representation!(R::Rectification) if isnothing(R.cache.set) R.cache.set = to_union_of_projections(R) diff --git a/test/LazyOperations/Rectification.jl b/test/LazyOperations/Rectification.jl index de97ad85be..3eb9096e4a 100644 --- a/test/LazyOperations/Rectification.jl +++ b/test/LazyOperations/Rectification.jl @@ -69,6 +69,12 @@ for N in [Float64, Rational{Int}, Float32] @test !isbounded(RI4) && !isboundedtype(typeof(RI4)) @test !isbounded(Rectification(HalfSpace(N[-1], N(0)))) + # isconvextype + @test !isconvextype(typeof(Rectification(Ball1(N[0, 0], N(1))))) + @test isconvextype(typeof(RI1)) + @test isconvextype(typeof(Rectification(EmptySet{N}(2)))) + @test isconvextype(typeof(Rectification(Universe{N}(2)))) + # conversion @test convert(Interval, RI1) == Interval(N(0), N(1)) @test convert(Hyperrectangle, RB1) ==