hdavid16 / DisjunctiveProgramming.jl

A JuMP extension for Generalized Disjunctive Programming
MIT License
27 stars 3 forks source link

Quadratic constraints that are modeled using `@constraint` #21

Closed hdavid16 closed 2 years ago

hdavid16 commented 2 years ago

Since quadratic constraints can be modeled using the standard constraint macro, these can be reformulated without the hack in https://github.com/hdavid16/DisjunctiveProgramming.jl/issues/7.

These constraints are nonlinear so they need to be reformulated as such.

hdavid16 commented 2 years ago

To identify if a constraint is quadratic:

ref_obj = constraint_object(ref) # ref is the ConstraintRef
ref_obj.func isa QuadExpr # this will give true if quadratic