XSLPchguserfuncobject
XSLPchguserfuncobject |
Purpose
Change or define one of the objects which can be accessed by the user functions
Synopsis
int XPRS_CC XSLPchguserfuncobject(XSLPprob Prob, int Entity, void **Address);
Arguments
|
Prob
|
The current SLP problem.
|
||||||
|
Entity
|
An integer indicating which object is to be defined. The value is interpreted as follows:
|
||||||
|
Address
|
The address of a pointer to the object. If
Address is
NULL, then any setting of the user function object is left unaltered.
|
Example
The following example sets the
Global Function Object. It then sets the
User Function Object for the function
ProfitCalcs.
double *GlobObj;
void *ProfitObj;
int iUF;
XSLPchguserfuncobject(Prob, 0, &GlobObj);
if (!XSLPgetindex(Prob, XSLP_USERFUNCNAMESNOCASE,
"ProfitCalcs", &iUF)) {
XSLPchguserfuncobject(Prob, iUF, &ProfitObj);
}
The function objects can be of any type. The index of the user function is obtained using the case-insensitive search for names. If the name is not found,
XSLPgetindex returns a nonzero value.
Further information
As instance numbers are not normally meaningful, this function should only be used with a negative value of
n to reset all
Instance Function Objects to
NULL when a model is being re-optimized within the same program execution.
Related topics
