Initializing help system before first use

XSLPchgfuncobject

XSLPchgfuncobject


Purpose
Change the address of one of the objects which can be accessed by the user functions
Synopsis
int XPRS_CC XSLPchgfuncobject(int *ArgInfo, int ObjType, void **Address)
Arguments
ArgInfo 
The array of argument information for the user function.
ObjType 
An integer indicating which object is to be changed
XSLP_GLOBALFUNCOBJECT 
The Global Function Object;
XSLP_USERFUNCOBJECT 
The User Function Object for the function;
XSLP_INSTANCEFUNCOBJECT 
The Instance Function Object for the instance of the function.
Address 
Pointer holding the address of the object.
Example
The following example from within a user function checks if there is a function instance. If so, it gets the Instance Function Object. If it is NULL an array is allocated and its address is saved as the new Instance Function 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);
 }
}

Further information

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.


Related topics

© 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.