XSLPparseformula
XSLPparseformula |
Purpose
This function is deprecated and may be removed in future releases. Parse a formula written as an unparsed array of tokens into internal parsed (reverse Polish) format
Synopsis
int XPRS_CC XSLPparseformula(XSLPprob Prob, int *inType, double *inValue, int *nToken, int *Type, double *Value);
Arguments
|
Prob
|
The current SLP problem.
|
|
inType
|
Array of token types providing the unparsed formula.
|
|
inValue
|
Array of values corresponding to the types in
inType.
|
|
nToken
|
Address of an integer to receive the number of tokens in the parsed formula (not counting the terminating
XSLP_EOF token). May be
NULL if not required.
|
|
Type
|
Array of token types providing the parsed formula.
|
|
Value
|
Array of values corresponding to the types in
Type.
|
Example
Assuming that
x and
y are already defined as columns with index
iX and
iY respectively, the following example converts the formula "sin(x+y)" into internal parsed format, and then writes it out as a sequence of tokens.
int n, iSin, iX, iY;
int inType[7], Type[20];
double inValue[7], Value[20];
n = 0;
XSLPgetindex(Prob, XSLP_INTERNALFUNCNAMESNOCASE,
"SIN", &iSin);
Type[n] = XSLP_IFUN; Value[n++] = iSin;
Type[n++] = XSLP_LB;
Type[n] = XSLP_COL; Value[n++] = iX;
Type[n] = XSLP_OP; Value[n++] = XSLP_PLUS;
Type[n] = XSLP_COL; Value[n++] = iY;
Type[n++] = XSLP_RB;
Type[n++] = XSLP_EOF;
XSLPparseformula(Prob, inType, inValue,
NULL, Type, Value);
printf("\n");
for (n=0;Type[n] != XSLP_EOF;n++) {
XSLPitemname(Prob, Type[n], Value[n], Buffer);
printf(" %s", Buffer);
}
Further information
For possible token types and values see the chapter on "Formula Parsing".
Related topics
© 2001-2019 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.
