XSLPchgfuncobject
XSLPchgfuncobject |
int XPRS_CC XSLPchgfuncobject(int *ArgInfo, int ObjType, void **Address)
ArgInfo
|
The array of argument information for the user function.
|
||||||
ObjType
|
An integer indicating which object is to be changed
|
||||||
Address
|
Pointer holding the address of the object.
|
int Instance; XSLPgetfuncinfo(ArgInfo, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &Instance); if (Instance) { XSLPgetfuncobject(ArgInfo, XSLP_INSTANCEFUNCOBJECT, &Object); if (Object == NULL) { Object = calloc(4*3, sizeof(double)); XSLPchgfuncobject(ArgInfo, XSLP_INSTANCEFUNCOBJECT, &Object); } }
This function changes the address of one of the objects which can be accessed by any user function. It requires the ArgInfo array of argument information. This is normally provided as one of the arguments to a user function, or it can be created by using the function XSLPsetuserfuncinfo
The identity of the function and the instance are obtained from the ArgInfo array. Within a user function, therefore, using the ArgInfo array passed to the user function will change the objects accessible to that function.
If, instead, XSLPchgfuncobject is used with an array which has been populated by XSLPsetuserfuncinfo, the Global Function Object can be set as usual. The User Function Object cannot be set (use XSLPchguserfuncobject for this purpose). There is no Instance Function Object as such; however, a value can be set by XSLPchgfuncobject which can be used by the function subsequently called by XSLPcalluserfunc. It is the user's responsibility to manage the object and save and restore the address as necessary, because Xpress NonLinear will not retain the information itself.
If Address is NULL, then the corresponding information will be unchanged.