8.4.7. MDOPsdVar

class MDOPsdVar

Represent a PSD variable in MindOpt application.

Methods

get

Retrieve a PSD variable-owned int attribute value by its name

get

Retrieve a PSD variable-owned string attribute value by its name

get

Retrieve a PSD variable-owned matrix attribute value by its name

index

Retrieve the index of this PSD variable

sameAs

Test if this PSD variable is the same as another

set

Set the value of a PSD variable-owned int attribute

set

Set the value of a PSD variable-owned string attribute

set

Set the value of a PSD variable-owned matrix attribute

int get(MDO_IntAttr attr)

Retrieve a PSD variable-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 PSD variable-owned string attribute value by its name.

Parameters

MDO_StringAttr attr – The attribute name.

Returns

The attribute value.

MDOMatrix get(MDO_MatAttr attr)

Retrieve a PSD variable-owned matrix attribute value by its name.

Parameters

MDO_MatAttr attr – The attribute name.

Returns

The attribute value.

int index()

Retrieve the index of this PSD variable.

Returns

The index of this PSD variable.

bool sameAs(MDOPsdVar v2)

Test if this PSD variable is the same as another.

Parameters

MDOPsdVar v2 – The PSD variable to be compared.

Returns

True if these two are the same

void set(MDO_IntAttr attr, int value)

Set the value of a PSD variable-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 PSD variable-owned string attribute.

Parameters
  • MDO_StringAttr attr – The attribute name.

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

void set(MDO_MatAttr attr, const MDOMatrix &value)

Set the value of a PSD variable-owned matrix attribute.

Parameters
  • MDO_MatAttr attr – The attribute name.

  • const MDOMatrix& value – The new value to be set.