XSLPgetcoefformula
XSLPgetcoefformula |
Purpose
Retrieve a single matrix coefficient as a formula split into tokens
Synopsis
int XPRS_CC XSLPgetcoefformula(XSLPprob Prob, int RowIndex, int ColIndex, double *Factor, int Parsed, int BufferSize, int *TokenCount, int *Type, double *Value);
Arguments
Prob
|
The current SLP problem.
|
RowIndex
|
Integer holding the row index for the coefficient.
|
ColIndex
|
Integer holding the column index for the coefficient.
|
Factor
|
Address of a double precision variable to receive the value of the constant factor multiplying the formula in the coefficient.
|
Parsed
|
Integer indicating whether the formula of the item is to be returned in internal unparsed format (
Parsed=0) or parsed (reverse Polish) format (
Parsed=1).
|
BufferSize
|
Maximum number of tokens to return, i.e. length of the Type and Value arrays.
|
TokenCount
|
Number of tokens returned in Type and Value.
|
Type
|
Integer array to hold the token types for the formula.
|
Value
|
Double array of values corresponding to
Type.
|
Example
The following example displays the formula for the coefficient in row 2, column 3 in unparsed form:
int n, Type[10]; double Value[10]; int TokenCount; XSLPgetcoefformula(Prob, 2, 3, &Factor, 0, 10, &TokenCount, Type, Value); for (n=0;Type[n] != XSLP_EOF;n++) printf("\nType=%-3d Value=%lg",Type[n],Value[n]);
Further information
The Type and Value arrays are terminated by an XSLP_EOF token.
If the requested coefficient is constant, then Factor will be set to 1.0 and the value will be returned with token type XSLP_CON.
Related topics