XSLPgetuserfunc
PurposeRetrieve the type and parameters for a user functionSynopsisint XPRS_CC XSLPgetuserfunc(XSLPprob Prob, int nSLPUF, char *xName, int *ArgType, int *ExeType, char *Param1, char *Param2, char *Param3);Arguments
Prob The current SLP problem. nSLPUF The number of the user function. This always counts from 1 and is not affected by the setting of XPRS_CSTYLE. xName Character string to receive the null-terminated external name of the user function. May be NULL if not required. Note that the external name is not the name used in written formulae, which is created by the XSLPaddnames function if required. ArgType Address of an integer to receive the bitmap specifying existence and type of arguments:
Bits 0-2 Type of DVALUE. 0=omitted, 1=NULL, 3=DOUBLE, 4=VARIANT; Bits 3-5 Type of ARGINFO. 0=omitted, 1=NULL, 2=INTEGER, 4=VARIANT; Bits 6-8 Type of ARGNAME. 0=omitted, 4=VARIANT, 6=CHAR; Bits 9-11 Type of RETNAME. 0=omitted, 4=VARIANT, 6=CHAR; Bits 12-14 Type of DELTA. 0=omitted, 1=NULL, 3=DOUBLE, 4=VARIANT; Bits 15-17 Type of RESULTS. 0=omitted, 1=NULL, 3=DOUBLE.May be NULL if not required.
ExeType Address of an integer to receive the bitmap holding the type of function:
Bits 0-2 determine the type of linkage: 1 = User library or DLL; 2 = Excel spreadsheet XLS; 3 = Excel macro XLF; 5 = MOSEL; 6 = VB; 7 = COM Bits 3-7 re-evaluation and derivatives flags: Bit 3-4 re-evaluation setting:
0: default;
Bit 3 = 1: re-evaluation at each SLP iteration;
Bit 4 = 1: re-evaluation when independent variables are outside tolerance; Bit 5 RESERVED Bit 6-7 derivatives setting:
0: default;
Bit 6 = 1: tangential derivatives;
Bit 7 = 1: forward derivatives Bit 8 calling mechanism: 0= standard, 1=CDECL (Windows only) Bit 9 instance setting: 0=standard, 1=function calls are grouped by instance Bit 24 multi-valued function Bit 28 non-differentiable functionMay be NULL if not required.
Param1 Character buffer to hold the first parameter (FILE). May be NULL if not required. Param2 Character buffer to hold the second parameter (ITEM). May be NULL if not required. Param3 Character buffer to hold the third parameter (HEADER). May be NULL if not required.ExampleThe following example retrieves the argument type and external name for user function number 3 and prints a simplified description of the function prototype.int ArgType; char ExtName[60]; XSLPgetuserfunc(Prob, 1, ExtName, &ArgType, NULL, NULL, NULL, NULL); printf("\nFunction is %s(",ExtName); for (i=0;i<6;i++) { if (i) printf(","); if (ArgType & (07 << i*3)) printf("Arg%d",i+1); } printf(")");;Related topics
If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.