Skip to content

Commit b04f16f

Browse files
authored
Merge pull request #3974 from JuliaReach/schillic/reduce_order_spz
Revise assertion in `reduce_order` of `SPZ`
2 parents eb49f21 + f2d6914 commit b04f16f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Sets/SparsePolynomialZonotope/reduce_order.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function reduce_order(P::SparsePolynomialZonotope, r::Real,
1212
method::AbstractReductionMethod=GIR05())
1313
@assert r 1 "cannot reduce below order 1 (got $r)"
1414

15-
if order(P) <= r
15+
if order(P) r
1616
return P
1717
end
1818

@@ -22,8 +22,8 @@ function reduce_order(P::SparsePolynomialZonotope, r::Real,
2222
h = ngens_dep(P)
2323
q = ngens_indep(P)
2424

25-
a = min(h + q, ceil(Int, h + q - n * (r - 1)))
26-
@assert a > 0 # holds because `r > order(P)`
25+
a = ceil(Int, h + q - n * (r - 1))
26+
@assert n a h + q # holds because `1 ≤ r < order(P)`
2727

2828
G = genmat_dep(P)
2929
GI = genmat_indep(P)

0 commit comments

Comments
 (0)