8.5.4. MDOConstr¶
-
class MDOConstr¶
Represent a constraint in MindOpt application.
Methods
Retrieve a constraint-owned int attribute value by its name
Retrieve a constraint-owned char attribute value by its name
Retrieve a constraint-owned double attribute value by its name
Retrieve a constraint-owned string attribute value by its name
Retrieve the index of this constraint
Test if this constraint is the same as another
Set the value of a constraint-owned int attribute
Set the value of a constraint-owned char attribute
Set the value of a constraint-owned double attribute
Set the value of a constraint-owned string attribute
-
int get(MDO_IntAttr attr)¶
Retrieve a constraint-owned int attribute value by its name.
- Parameters
MDO_IntAttr attr – The attribute name.
- Returns
The attribute value.
-
char get(MDO_CharAttr attr)¶
Retrieve a constraint-owned char attribute value by its name.
- Parameters
MDO_CharAttr attr – The attribute name.
- Returns
The attribute value.
-
double get(MDO_DoubleAttr attr)¶
Retrieve a constraint-owned double attribute value by its name.
- Parameters
MDO_DoubleAttr attr – The attribute name.
- Returns
The attribute value.
-
std::string get(MDO_StringAttr attr)¶
Retrieve a constraint-owned string attribute value by its name.
- Parameters
MDO_StringAttr attr – The attribute name.
- Returns
The attribute value.
-
int index()¶
Retrieve the index of this constraint.
- Returns
The index of this constraint.
-
bool sameAs(MDOConstr c2)¶
Test if this constraint is the same as another.
- Parameters
MDOConstr c2 – The constraint to be compared.
- Returns
True if these two are the same
-
void set(MDO_IntAttr attr, int value)¶
Set the value of a constraint-owned int attribute.
- Parameters
MDO_IntAttr attr – The attribute name.
int value – The new value to be set.
-
void set(MDO_CharAttr attr, char value)¶
Set the value of a constraint-owned char attribute.
- Parameters
MDO_CharAttr attr – The attribute name.
char value – The new value to be set.
-
void set(MDO_DoubleAttr attr, double value)¶
Set the value of a constraint-owned double attribute.
- Parameters
MDO_DoubleAttr attr – The attribute name.
double value – The new value to be set.
-
void set(MDO_StringAttr attr, const std::string &value)¶
Set the value of a constraint-owned string attribute.
- Parameters
MDO_StringAttr attr – The attribute name.
const std::string& value – The new value to be set.
-
int get(MDO_IntAttr attr)¶