8.4.6. MDOGenConstr

class MDOGenConstr

Represent a general constraint in MindOpt application.

Methods

get

Retrieve a general-constraint-owned int attribute value by its name

get

Retrieve a general-constraint-owned string attribute value by its name

index

Retrieve the index of this general constraint

sameAs

Test if this general constraint is the same as another

set

Set the value of a general-constraint-owned int attribute

set

Set the value of a general-constraint-owned string attribute

int get(MDO_IntAttr attr)

Retrieve a general-constraint-owned int attribute value by its name.

Parameters

MDO_IntAttr attr – The attribute name.

Returns

The attribute value.

std::string get(MDO_StringAttr attr)

Retrieve a general-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 general constraint.

Returns

The index of this constraint.

bool sameAs(MDOGenConstr c2)

Test if this general constraint is the same as another.

Parameters

MDOGenConstr c2 – The general constraint to be compared.

Returns

True if these two are the same

void set(MDO_IntAttr attr, int value)

Set the value of a general-constraint-owned int attribute.

Parameters
  • MDO_IntAttr attr – The attribute name.

  • int value – The new value to be set.

void set(MDO_StringAttr attr, const std::string &value)

Set the value of a general-constraint-owned string attribute.

Parameters
  • MDO_StringAttr attr – The attribute name.

  • const std::string& value – The new value to be set.