Skip to content

Commit 6a2a8ed

Browse files
committed
remove unnecessary assert
1 parent cdd0c38 commit 6a2a8ed

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

examples/ex2.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ m = Model()
1212
@constraint(m, con5, x[1] <= 9)
1313
@constraint(m, con6, x[2] <= 6)
1414

15-
@disjunction(m,(con1,con2,con3),(con4,con5,con6),reformulation=:BMR)
15+
@disjunction(m,(con1,con2,con3),(con4,con5,con6),reformulation=:CHR)

src/reformulate.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,8 @@ function lin_perspective_function(ref, bin_var_ref, var, i)
150150
#check var is present in the constraint
151151
coeff = normalized_coefficient(ref,var)
152152
iszero(coeff) && return
153-
#check CHR can be applied to this constraint
154-
rhs = normalized_rhs(ref) #get rhs
155-
@assert !iszero(rhs) "The convex hull reformulation cannot be done on constraint $ref because its right-hand-side is zero. Use Big-M instead."
156153
#modify constraint using convex hull
154+
rhs = normalized_rhs(ref) #get rhs
157155
var_i_ref = variable_by_name(ref.model, "$(var)_$i")
158156
set_normalized_rhs(ref,0) #set rhs to 0
159157
set_normalized_coefficient(ref, var, 0) #remove original variable

0 commit comments

Comments
 (0)