XSLPgetindex
PurposeRetrieve the index of an Xpress-SLP entity with a given nameSynopsisint XPRS_CC XSLPgetindex(XSLPprob Prob, int Type, char *cName, int *Index);Arguments
Prob The current SLP problem. Type Type of entity. The following are defined:
XSLP_CVNAMES (=3) Character variables; XSLP_XVNAMES (=4) Extended variable arrays; XSLP_USERFUNCNAMES (=5) User functions; XSLP_INTERNALFUNCNAMES (=6) Internal functions; XSLP_USERFUNCNAMESNOCASE (=7) User functions, case insensitive; XSLP_INTERNALFUNCNAMESNOCASE (=8) Internal functions, case insensitive;The constants 1 (for row names) and 2 (for column names) may also be used.
cName Character string containing the name, terminated by a null character. Index Integer to receive the index of the item.ExampleThe following example retrieves the index of the internal SIN function using both an upper-case and a lower case version of the name.int UpperIndex, LowerIndex; XSLPgetindex(Prob, XSLP_INTERNALFUNCNAMESNOCASE, "SIN", &UpperIndex); XSLPgetindex(Prob, XSLP_INTERNALFUNCNAMESNOCASE, "sin", &LowerIndex);UpperIndex and LowerIndex will contain the same value because the search was made using case-insensitive matching.Further informationAll entities count from 1. This includes the use of 1 or 2 (row or column) for Type which ignore the setting of XPRS_CSTYLE. A value of zero returned in Index means there is no matching item. The case-insensitive types will find the first match regardless of the case of cName or of the defined function.
Related topics
If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.