Example of a formula defining a user function
User function definitions in XSLPadduserfuncs and XSLPloaduserfuncs are provided through the formula structure. Assume we wish to add the function defined in Extended MPS format as
MyFunc = Func1 (DOUBLE,INTEGER) MOSEL = MyModel = MyArray
We also want to evaluate the function only when its arguments have changed outside tolerances. This also requires function instances. In the definition of a user function, there is no distinction made between parsed and unparsed format: the tokens provide information and are interpreted in the order in which they are encountered. The function definition is as follows:
Type | Value |
---|---|
XSLP_STRING | index of Func1 in string table |
XSLP_UFARGTYPE | 26 (octal 32) |
XSLP_UFEXETYPE | 21 (Bit 4 set, and Bits 0-2 = 5) |
XSLP_STRING | index of MyModel in string table |
XSLP_STRING | index of MyArray in string table |
XSLP_EOF | 0 |
The string arguments are interpreted in the order in which they appear. Therefore, if any of the function parameters (param1 to param3 in Extended MPS format) is required, there must be entries for the internal function name and any preceding function parameters. If the fields are blank, use an XSLP_STRING token with a zero value.
The name of the function itself (MyFunc in this case) is provided through the function XSLPaddnames.
© 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.