Initializing help system before first use

# XSLPsetcbpreupdatelinearization, XPRSsetcbslppreupdatelinearization

Purpose
Set a user callback to be called before the linearization is updated
Topic areas
Callback, SLP
Synopsis
`int XPRS_CC XSLPsetcbpreupdatelinearization(XSLPprob prob, int (XPRS_CC *preupdatelinearization) (XSLPprob cbprob, void *cbdata, int *when), void *data);`
Arguments

prob | The current SLP problem.
preupdatelinearization | The function to be called before the linearization is updated. preupdatelinearization returns an integer value. If the return value is nonzero, the optimization will return an error code and the "User Return Code" error will be set.
cbprob | The problem passed to the callback function.
cbdata | The user-defined object passed as data to XSLPsetcbpreupdatelinearization.
when | Indicates the call number, starting at 1. If returned nonzero, another call to the callback will be scheduled. If returned zero, a final call with *when == -1 will be made.
data | Address of a user-defined object, which can be used for any purpose by the function. data is passed to preupdatelinearization as cbdata.

Further information
1. When the linearization is updated, all user functions are evaluated and their derivatives calculated at the current base point. In some models, it is cheaper to compute the derivatives for all user functions at the same time, thereby avoiding repeated calculations for each function. This callback is intended to be used in such cases.
2. During each SLP iteration, the callback is invoked repeatedly, with *when indicating the current call number (starting from 1), until the callback indicates that no further calls are needed, by setting *when = 0. Between each callback invocation, the solver evaluates the user functions without requesting derivatives. After the callback has set *when = 0, the user functions are evaluated one more time, this time requesting derivatives, and then finally the callback is called with *when == -1, marking the end of the linearization update. The only time derivatives will be requested outside of this sequence is during KKT validation. This can be disabled during the solve by clearing the XSLP_CONVERGEBIT_VALIDATION_K bit in XSLP_CONVERGENCEOPS, ensuring that derivatives can always be precomputed.
3. One way that this callback can be used to precompute derivatives for user functions is as follows:
Related topics
User functions, XSLPdeluserfunction, XSLPimportlibfunc
Parent Topic Library functions and the programming interface

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