XSLPsetuserfuncaddress


Purpose
Change the address of a user function
Synopsis
int XPRS_CC XSLPsetuserfuncaddress(XSLPprob Prob, int nSLPUF, void *Address);
Arguments
Prob 
The current SLP problem.
nSLPUF 
The index of the user function.
Address 
The address of the user function.
Example
The following example defines a user function via XSLPchguserfunc and then re-defines the address.
double InternalFunc(double *, int *);
int nUF;

XSLPchguserfunc(Prob, 0, NULL, 023, 1, 
                NULL, NULL, NULL);

XSLPgetintattrib(Prob,XSLP_UFS,&nUF);
XSLPaddnames(Prob,XSLP_USERFUNCNAMES,"Func1",
             nUF,nUF);

XSLPsetuserfuncaddress(Prob, nUF, InternalFunc);
Note that InternalFunc is defined as taking two arguments (double* and int*). This matches the ArgType setting in XSLPchguserfunc. The external function name is NULL because it is not required when the address is given.
Further information

nSLPUF is an Xpress-SLP index and always counts from 1. It is not affected by the setting of XPRS_CSTYLE.

The address of the function is changed to the one provided. XSLPsetuserfuncaddress should only be used for functions declared as of type DLL or VB. Its main use is where a user function is actually internal to the system rather than being provided in an external library. In such a case, the function is initially defined as an external function using XSLPloaduserfuncs, XSLPadduserfuncs or XSLPchguserfunc and the address of the function is then provided using XSLPsetuserfuncaddress.


Related topics
XSLPadduserfuncs XSLPchguserfunc, XSLPchguserfuncaddress XSLPgetuserfunc, XSLPloaduserfuncs


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.