8.5.6. MDOSOS¶
-
class MDOSOS¶
Represent SOS constraints in MindOpt applications
Methods
Retrieve the int attribute value owned by the SOS constraint by name
Retrieve the index of this SOS constraint
Test whether this SOS constraint is the same as another SOS constraint
Set the value of the int attribute owned by the SOS constraint
-
int get(MDO_IntAttr attr)¶
Retrieve the int attribute value owned by the SOS constraint by name
- Parameters
MDO_IntAttr attr – Attribute name
- Returns
Attribute value
-
int index()¶
Retrieve the index of this SOS constraint
- Returns
The index of this SOS constraint.
-
bool sameAs(MDOSOS s2)¶
Test whether this SOS constraint is the same as another SOS constraint.
- Parameters
MDOSOS s2 – Compared SOS constraints
- Returns
Return True if the two SOS constraints are the same
-
void set(MDO_IntAttr attr, int value)¶
Set the value of the int attribute owned by the SOS constraint.
- Parameters
MDO_IntAttr attr – Attribute name
int value – The new value to be set.
-
int get(MDO_IntAttr attr)¶