Converting Expr into constr

question

#1

I would like to do something simple as that

constr_expr = MathProgBase.constr_expr(m.d,i)
JuMP.addconstraint(m.model, constr_expr)

Looks like this:

JuMP.addNLconstraint(m, :($(x[1])*$(x[2])*$(x[3])*$(x[4]) >= 25))

would work but I don’t have the $ version of x inside constr_expr.

Getting a constraint and applying it to a model.
It doesn’t work because constr_expr is of type Expr which isn’t supported.

Never worked with Expr so I’m a bit stuck.

Thanks in advance.


#2

If someone else has the problem:

I found a solution here: