Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark mode
Gurobi Optimizer Reference Manual
Light LogoDark Logo

Concepts

Features

Reference

Gurobi
Back to top

GRBGenConstr#

classGRBGenConstr#

Gurobi general constraint object. General constraints are alwaysassociated with a particular model. You create a general constraintobject by adding a constraint to a model (using one of theGRBModel::addGenConstr*methods), rather than by using aGRBGenConstr constructor.

The methods on general constraint objects are used to get and setgeneral constraint attributes. For example, general constraint types canbe queried by callingget (GRB_IntAttr_GenConstrType).Note, however, that it is generally more efficient to query attributesfor a set of constraints at once. This is done using the attribute querymethod on theGRBModel object (GRBModel::get).

The full list of attributescan be found in theAttributes section of thisdocument. Examples of how to query and set attributes can also be foundinthis section.

doubleget(GRB_DoubleAttrattr)#
intget(GRB_IntAttrattr)#
stringget(GRB_StringAttrattr)#

Query the value of a general constraint attribute.

Parameters:

attr – The attribute being queried.

Returns:

The current value of the requested attribute.

voidset(GRB_DoubleAttrattr,doublenewvalue)#
voidset(GRB_IntAttrattr,intnewvalue)#
voidset(GRB_StringAttrattr,conststring&newvalue)#

Set the value of a general constraint attribute.

Parameters:
  • attr – The attribute being modified.

  • newvalue – The desired new value of the attribute.

Help and Feedback

On this page

[8]ページ先頭

©2009-2025 Movatter.jp