Initializing help system before first use

Constant Derivatives

If a user function has constant derivatives with respect to one or more of its arguments, then it is possible to arrange that Xpress NonLinear bypasses the repeated evaluation of the function when calculating numerical derivatives for such arguments. There is no benefit in using this feature if the function offers analytic derivatives.

There are two ways of providing constant derivative information to Xpress NonLinear:

  • Implicit constant derivatives.
    In this case, Xpress NonLinear will initially calculate derivatives as normal. However, if it finds for a particular argument that the "upward" numerical derivative and the "downward" numerical derivative around a point are the same within tolerances, then the derivative for the argument will be marked as constant and will not be re-evaluated. The tolerances XSLP_CDTOL_A and XSLP_CDTOL_R are used to decide constancy.
  • Interrogate for constant derivatives.
    In this case, Xpress NonLinear will call the user function in a special way for each of the arguments in turn. The user function must recognize the special nature of the call and return a value indicating whether the derivative is constant. If the derivative is constant, it will be calculated once in the usual way (numerically), and the result will be used unchanged thereafter.

If a function is marked for interrogation for constant derivatives, then Xpress NonLinear will issue a series of special calls the first time that derivatives are required. The only difference from a normal call is that the number of derivatives requested (FunctionInfo[2]) will be negative; the absolute value of this number is the number of the argument for which information is required (counting from 1). The single value returned by the function (or in the first element of the return array, depending on the type of function) is zero if the derivative is not constant, or nonzero (normally 1) if the derivative is constant.

The following simple example in C shows how interrogation might be handled:

double XPRS_CC MyUserFunc(double *InputValues, int *FunctionInfo) {
  int iArg;
  if ( (iArg=FunctionInfo[2]) < 0) { /* interrogation */
    switch (-iArg) {
    case 1: /* constant with respect to first argument */
    case 4: /* constant with respect to fourth argument */
      return 1.0; /* constant derivative */
    default:
      return 0.0; /* not constant derivative */
    }
  }

/* normal call for evaluation */
  return MyCalc(InputValues);
}

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