Skip to content
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
3 changes: 3 additions & 0 deletions src/Approximations/box_approximation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ function box_approximation(S::LazySet{N}) where {N}
r = Vector{N}(undef, n)
@inbounds for i in 1:n
lo, hi = extrema(S, i)
if isinf(lo) || isinf(hi)
throw(ArgumentError("the box approximation of an unbounded set is undefined"))
end
ri = (hi - lo) / 2
if ri < zero(N)
if !_geq(ri, zero(N))
Expand Down
3 changes: 3 additions & 0 deletions test/Sets/Line.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ for N in [Float64, Rational{Int}, Float32]
# boundedness
@test !isbounded(l1)

# box_approximation
@test_throws ArgumentError box_approximation(l1)

# ispolyhedral
@test ispolyhedral(l1)

Expand Down
Loading