Problem Attributes



During the optimization process, various properties of the problem being solved are stored and made available to users of the Xpress‑MP Libraries in the form of problem attributes. These can be accessed in much the same manner as for the controls. Examples of problem attributes include the sizes of arrays, for which library users may need to allocate space before the arrays themselves are retrieved. A full list of the attributes available and their types may be found in this chapter.

Retrieving Problem Attributes

Library users are provided with the following three functions for obtaining the values of attributes:

XPRSgetintattrib XPRSgetdblattrib XPRSgetstrattrib

Much as for the controls previously, it should be noted that the attributes as listed in this chapter must be prefixed with XPRS_ to be used with the Xpress‑MP Libraries and failure to do so will result in an error. An example of their usage is the following which returns and prints the optimal value of the objective function after the linear problem has been solved:

XPRSgetdblattrib(prob, XPRS_LPOBJVAL, &lpobjval);
printf("The objective value is %2.1f\n", lpobjval);



If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.