XSLPpreparseformula
XSLPpreparseformula |
int XPRS_CC XSLPpreparseformula(XSLPprob Prob, char *Formula, int *nToken, int *Type, double *Value, char *StringTable, int *SizeTable);
Prob
|
The current SLP problem.
|
Formula
|
Character string containing the formula, written in the same free-format style as formulae in Extended MPS format, with spaces separating tokens.
|
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.
|
StringTable
|
Character buffer to receive the names of the unidentified tokens.
|
SizeTable
|
Address of an integer variable to hold the size of
StringTable actually used. May be
NULL if not required.
|
int n, Type[20]; double Value[20]; char Strings[200]; XSLPpreparseformula(Prob, "sin ( x + y )", NULL, Type, Value, Strings, NULL); printf("\n"); for (n=0;Type[n] != XSLP_EOF;n++) { if (Type[n] == XSLP_UNKNOWN) printf("\n? %s",Strings[(int)Value[n]]); else { XSLPitemname(Prob, Type[n], Value[n], Buffer); printf(" %s", Buffer); } }
Only operands and numbers are identified by XSLPpreparseformula. All other operands, including names of variables, functions are left as strings of type XSLP_UNKNOWN. The Value of such a type is the index in StringTable of the start of the token name.
The parsed formula can be converted into a calculable formula by replacing the XSLP_UNKNOWN tokens by the correct types and values.
© 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.