GRBModel.AddQConstr()

Add a quadratic constraint to a model. Multiple signatures are available.

Important note: the algorithms that Gurobi uses to solve quadratically constrained problems can only handle certain types of quadratic constraints. Constraints of the following forms are always accepted:

If you add a constraint that isn't in one of these forms (and Gurobi presolve is unable to transform the constraint into one of these forms), you'll get an error when you try to solve the model. Constraints where the quadratic terms only involve binary variables will always be transformed into one of these forms.

GRBQConstr AddQConstr ( GRBQuadExpr lhsExpr,
    char sense,
    GRBQuadExpr rhsExpr,
    string name )

GRBQConstr AddQConstr ( GRBTempConstr tempConstr,
    string name )