Initializing help system before first use

XPRSgetnames

XPRSgetnames


Purpose
Returns the names for the rows, columns, sets, piecewise linear or general constraints in a given range. The names will be returned in a character buffer, each name being separated by a null character.
Synopsis
int XPRS_CC XPRSgetnames(XPRSprob prob, int type, char names[], int first, int last);
Arguments
prob 
The current problem.
type 
if row names are required;
if column names are required.
if set names are required.
if piecewise linear constraint names are required.
if general constraint names are required.
names 
Buffer long enough to hold the names. Since each name is 8*NAMELENGTH characters long (plus a null terminator), the array, names, would be required to be at least as long as ( first-last+1)*( 8*NAMELENGTH+1) characters. The names of the row/column/set first+i will be written into the names buffer starting at position i*8*NAMELENGTH+i.
first 
First row, column, set, piecewise linear or general constraint in the range.
last 
Last row, column, set, piecewise linear or general constraint in the range.
Example
The following example retrieves the row and column names of the current problem:
int cols, rows, nl;
...
XPRSgetintattrib(prob,XPRS_COLS,&cols);
XPRSgetintattrib(prob,XPRS_ROWS,&rows);
XPRSgetintattrib(prob,XPRS_NAMELENGTH,&nl);

cnames = (char *) malloc(sizeof(char)*(8*nl+1)*cols);
rnames = (char *) malloc(sizeof(char)*(8*nl+1)*rows);
XPRSgetnames(prob,1,rnames,0,rows-1);
XPRSgetnames(prob,2,cnames,0,cols-1);
To display names[i], use
int namelength;
...

XPRSgetintattrib(prob,XPRS_NAMELENGTH,&namelength);
printf("%s",names + i*(8*namelength+1)); 
Related topics

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.