GRBNLConstr#

GRBNLConstr#

Gurobi nonlinear constraint object. Nonlinear constraints are always associated with a particular model. You create a nonlinear constraint object by adding a constraint to a model (using GRBModel.AddNLConstr), rather than by using a GRBNLConstr constructor.

The methods on nonlinear constraint objects are used to get and set nonlinear constraint attributes. Note, however, that it is generally more efficient to query attributes for a set of constraints at once. This is done using the attribute query method on the GRBModel object (GRBModel.Get).

The section Nonlinear Constraint Attributes lists the attributes specific to this type of constraint. The full list of attributes can be found in the Attributes section of this document. Examples of how to query and set attributes can also be found in this section.

char Get(GRB.CharAttr attr)#
double Get(GRB.DoubleAttr attr)#
int Get(GRB.IntAttr attr)#
string Get(GRB.StringAttr attr)#

Query the value of a nonlinear constraint attribute.

Parameters:

attr – The attribute being queried.

Returns:

The current value of the requested attribute.

void Set(GRB.CharAttr attr, char newvalue)#
void Set(GRB.DoubleAttr attr, double newvalue)#
void Set(GRB.IntAttr attr, int newvalue)#
void Set(GRB.StringAttr attr, string newvalue)#

Set the value of a nonlinear constraint attribute.

Parameters:
  • attr – The attribute being modified.

  • newvalue – The desired new value of the attribute.