XPRSgetattribinfo
XPRSgetattribinfo |
Purpose
Accesses the id number and the type information of an attribute given its name. An attribute name may be for example
XPRS_ROWS. Names are case-insensitive and may or may not have the
XPRS_ prefix. The id number is the constant used to identify the attribute for calls to functions such as
XPRSgetintattrib. The type information returned will be one of the below integer constants defined in the
xprs.h header file. The function will return an id number of 0 and a type value of
XPRS_TYPE_NOTDEFINED if the name is not recognized as an attribute name. Note that this will occur if the name is a control name and not an attribute name.
XPRS_TYPE_NOTDEFINED | The name was not recognized. |
XPRS_TYPE_INT | 32 bit integer. |
XPRS_TYPE_INT64 | 64 bit integer. |
XPRS_TYPE_DOUBLE | Double precision floating point. |
XPRS_TYPE_STRING | String. |
Synopsis
int XPRS_CC XPRSgetattribinfo(XPRSprob prob, const char* sCaName, int* iHeaderId, int* iTypeinfo);
Arguments
prob
|
The current problem.
|
sCaName
|
The name of the attribute to be queried. Names are case-insensitive and may or may not have the
XPRS_ prefix. A full list of all attributes may be found in Chapter
Control Parameters, or from the list in the
xprs.h header file.
|
iHeaderId
|
Pointer to an integer where the id number will be returned.
|
iTypeInfo
|
Pointer to an integer where the type id will be returned.
|
Example
The following code example obtains the id number and the type id of the control or attribute with name given by
sCaName. Note that the name happens to be a control name in this example:
const char *sCaName = "presolve"; int iHeaderId, iTypeInfo; ... if(XPRSgetattribinfo(prob, sCaName, &iHeaderId, &iTypeInfo) || iHeaderId==0) { if(XPRSgetcontrolinfo(prob, sCaName, &iHeaderId, &iTypeInfo) || iHeaderId==0) { printf("Unrecognized name: %s\n", sCaName); } }
Related topics