XSLPgetxvitem


Purpose
Retrieve information about an item in an extended variable array
Synopsis
int XPRS_CC XSLPgetxvitem(XSLPprob Prob, int nSLPXV, int nXVitem, int Parsed, int *VarType, int *VarIndex, int *IntIndex, double *Reserved1, double *Reserved2, int *Reserved3, int *Type, double *Value);
Arguments
Prob 
The current SLP problem.
nSLPXV 
index of the XV.
nXVitem 
index of the item in the XV. This always counts from 1 and is independent of the setting of XPRS_CSTYLE.
Parsed 
integer indicating whether the formula of the item is to be retrieved in internal unparsed format (Parsed=0) or internal parsed (reverse Polish) format (Parsed=1).
VarType 
Address of an integer holding the token type of the XV variable. This can be zero (there is no variable), XSLP_VAR, XSLP_CVAR or XSLP_XV. May be NULL if not required.
VarIndex 
Address of an integer holding the index within the VarType of the XV variable. May be NULL if not required.
IntIndex 
Address of an integer holding the index within the Xpress-SLP string table of the internal variable name. Zero means there is no internal name. May be NULL if not required.
Reserved1 
Reserved for future use.
Reserved2 
Reserved for future use.
Reserved3 
Reserved for future use.
Type 
Integer array of token types to describe the value or formula for the XVitem. May be NULL if not required.
Value 
Double array of values corresponding to Type, describing the value or formula for the XVitem. May be NULL if not required.
Example
The following example retrieves the information for the second item in XV number 3.
int VarType, VarIndex, IntIndex, Type[10];
double Value[10];
char Buffer[60];
XSLPgetxvitem(Prob, 3, 2, 0,
              &VarType, &VarIndex, &IntIndex,
              NULL, NULL, NULL, Type, Value);
if (VarType)
  printf("\nVariable type %d index %d", VarType, VarIndex);
if (IntIndex) {
  XSLPgetstring(Prob, IntIndex, Buffer);
  printf("\nName %s",Buffer);
}

if (!VarType) 
 for (i=0;Type[i] != XSLP_EOF;i++) {
  printf("\nType=%d Value=%lg", Type[i], Value[i]);
 }
The formula is retrieved in unparsed format. It is assumed that there will never be more than 10 tokens in the formula, including the terminator.
Further information

If VarType is zero (meaning that the XVitem is not a variable), then VarIndex is not used.

The formula in Type and Value will be terminated by an XSLP_EOF token. Type and Value must be large enough to hold the formula.


Related topics
XSLPaddxvs, XSLPgetxvitem, XSLPloadxvs


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