Skip to content

Commit 7edd581

Browse files
committed
Rectification: add some 'isconvextype' special cases
1 parent cb9fac3 commit 7edd581

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/LazyOperations/Rectification.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ isoperationtype(::Type{<:Rectification}) = true
113113

114114
isconvextype(::Type{<:Rectification}) = false
115115

116+
isconvextype(::Type{<:Rectification{N,<:AbstractHyperrectangle}}) where {N} = true
117+
isconvextype(::Type{<:Rectification{N,<:EmptySet}}) where {N} = true
118+
isconvextype(::Type{<:Rectification{N,<:Universe}}) where {N} = true
119+
116120
function _compute_exact_representation!(R::Rectification)
117121
if isnothing(R.cache.set)
118122
R.cache.set = to_union_of_projections(R)

test/LazyOperations/Rectification.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ for N in [Float64, Rational{Int}, Float32]
6969
@test !isbounded(RI4) && !isboundedtype(typeof(RI4))
7070
@test !isbounded(Rectification(HalfSpace(N[-1], N(0))))
7171

72+
# isconvextype
73+
@test !isconvextype(typeof(Rectification(Ball1(N[0, 0], N(1)))))
74+
@test isconvextype(typeof(RI1))
75+
@test isconvextype(typeof(Rectification(EmptySet{N}(2))))
76+
@test isconvextype(typeof(Rectification(Universe{N}(2))))
77+
7278
# conversion
7379
@test convert(Interval, RI1) == Interval(N(0), N(1))
7480
@test convert(Hyperrectangle, RB1) ==

0 commit comments

Comments
 (0)