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 ( const GRBQuadExpr& lhsExpr,
    char sense,
    const GRBQuadExpr& rhsExpr,
    string name="" )

GRBQConstr addQConstr ( const GRBQuadExpr& lhsExpr,
    char sense,
    GRBVar rhsVar,
    string name="" )

GRBQConstr addQConstr ( GRBTempConstr& tc,
    string name="" )