XPRS_nml_findname
XPRS_nml_findname |
Purpose
The
XPRS_nml_* functions provide a simple, generic interface to lists of names, which may be names of rows/columns on a problem or may be a list of arbitrary names provided by the user.
XPRS_nml_findname returns the index of the given name in the given name list.
Synopsis
int XPRS_CC XPRS_nml_findname(XPRSnamelist nml, const char* name, int* r_index);
Arguments
nml
|
The namelist in which to look for the name.
|
name
|
Null-terminated string containing the name for which to search.
|
r_index
|
Pointer to variable in which the index of the name is returned, or in which is returned -1 if the name is not found in the namelist.
|
Example
XPRSnamelist mylist; int idx; ... XPRS_nml_findname(mylist, "profit_after_work", &idx); if (idx==-1) printf("'profit_after_work' was not found in the namelist"); else printf("'profit_after_work' was found at position %d", idx);
Related topics