Skip to content

Commit 098c8d3

Browse files
committed
update notation: constraint added, not replaced
1 parent 694eb85 commit 098c8d3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/bigm.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function big_m_reformulation!(constr::NonlinearConstraintRef, bin_var, M0, i, j,
3535
gx = gx - M*(1-λ) #add bigM
3636

3737
#update constraint
38-
replace_constraint(constr, bin_var, gx, op, rhs)
38+
add_reformulated_constraint(constr, bin_var, gx, op, rhs)
3939
end
4040
big_m_reformulation!(constr::AbstractArray{<:ConstraintRef}, bin_var, M, i, j, k) =
4141
big_m_reformulation(constr[k], bin_var, M, i, j, k)

src/constraint.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ function parse_constraint(constr::ConstraintRef)
142142
end
143143

144144
"""
145-
replace_constraint(constr::ConstraintRef, bin_var::Symbol, sym_expr, op, rhs)
145+
add_reformulated_constraint(constr::ConstraintRef, bin_var::Symbol, sym_expr, op, rhs)
146146
147147
Replace nonlinear or quadratic constraint with its hull reformulation.
148148
"""
149-
function replace_constraint(constr::ConstraintRef, bin_var::Symbol, sym_expr, op, rhs)
149+
function add_reformulated_constraint(constr::ConstraintRef, bin_var::Symbol, sym_expr, op, rhs)
150150
#convert symbolic function to expression
151151
op = eval(op)
152152
expr = Base.remove_linenums!(build_function(op(sym_expr,rhs))).args[2].args[1]

src/hull.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function hull_reformulation!(constr::ConstraintRef, bin_var, eps, i, j, k)
6666
pers_func = substitute(pers_func, Dict(FSG1 => (1-ϵ)*λ+ϵ,
6767
FSG2 => ϵ*(1-λ)))
6868
pers_func = simplify(pers_func)
69-
replace_constraint(constr, bin_var, pers_func, op, rhs)
69+
add_reformulated_constraint(constr, bin_var, pers_func, op, rhs)
7070
end
7171
hull_reformulation!(constr::AbstractArray{<:ConstraintRef}, bin_var, eps, i, j, k) =
7272
hull_reformulation!(constr[k], bin_var, eps, i, j, k)

0 commit comments

Comments
 (0)