Initializing help system before first use

Library functions and the programming interface

Topics covered in this chapter:

Counting

All Xpress NonLinear entities are numbered from 1. The 0th item is defined, and is an empty entity of the appropriate type. Therefore, whenever an Xpress NonLinear function returns a zero value, it means that there is no data of that type.

In parsed and unparsed function arrays, type XPRS_TOK_COL uses indices counted from zero, the same as the Xpress Optimizer library.

The Xpress NonLinear problem pointer

Xpress NonLinear uses the same concept as the Optimizer library, with a "pointer to a problem". In general, users are advised to use the XPRSnlp or XPRSslp versions of nonlinear functions which work directly on the optimizer XPRSprob. Alternatively, it is still possible to manually create an instance of an XSLPprob that can be provided to XSLP versions of these functions, which is explained in the following.

The optimizer problem must be initialized first in the normal way. Then the corresponding Xpress NonLinear problem can be initialized, including a pointer to the underlying optimizer problem. For example:

{
	...
	XPRSprob prob=NULL;
	XSLPprob SLPprob=NULL;

	XPRSinit("");
	XSLPinit();
	XPRScreateprob(&prob);
	XSLPcreateprob(&SLPprob,&prob);
	...
}

At the end of the program, the Xpress NonLinear problem should be destroyed. You are responsible for destroying the underlying XPRSprob linear problem afterwards. For example:

{
...
  XSLPdestroyprob(SLPprob);
  XPRSdestroyprob(prob);
  XSLPfree();
  XPRSfree();
  ...
}

The following functions are provided to manage Xpress NonLinear problems. See the documentation below on the individual functions for more details.

XSLPcopycontrols(XSLPprob prob1, XSLPprob prob2)
   Copy the settings of control variables

XSLPcopycallbacks(XSLPprob prob1, XSLPprob prob2)
   Copy the callback settings

XSLPcopyprob(XSLPprob prob1, XSLPprob prob2, char *ProbName)
   Copy a problem completely

XSLPcreateprob(XSLPprob *prob1, XPRSprob *prob2)
   Create an Xpress NonLinear problem

XSLPdestroyprob(XSLPprob prob1)
   Delete an Xpress NonLinear problem from memory

XSLPrestore(XSLPprob prob1)
   Restore Xpress NonLinear data structures from file

XSLPsave(XSLPprob prob1)
   Save Xpress NonLinear data structures to file

The load functions

The load functions can be used to load an Xpress NonLinear problem directly into the Xpress data structures. Because there are so many additional items which can be loaded apart from the basic (linear) matrix, the loading process is divided into several functions.

The best practice is to load the linear part of the problem first, using the normal Optimizer Library functions XPRSloadlp or XPRSloadmip. Then the appropriate parts of the Xpress NonLinear problem can be loaded. After all the load functions have been called, XPRSslpconstruct can be called to manually create the SLP matrix and data structures. If XPRSslpconstruct is not invoked before a call to one of the Xpress NonLinear optimization routines, then it will be called by the optimization routine itself.

All of these functions initialize their data areas. Therefore, if a second call is made to the same function for the same problem, the previous data will be deleted. If you want to include additional data of the same type, then use the corresponding add function.

It is possible to remove parts of the SLP structures with the various del functions, and XPRSslpunconstruct can also be used to remove the augmentation.

Xpress NonLinear is compatible with the quadratic API functions within the Xpress Optimizer. XPRSloadqp and XPRSloadmiqp can be used to load quadratic problems (or quadratically constrained problems using XPRSloadqcqp and XPRSloadmiqcqp). With default values for the NLPREFORMULATE control, quadratic matrices and quadratic terms in formulas will be converted between the two as necessary so that all convex quadratic terms can be handled by the appropriate methods within the Xpress Optimizer while any non-convex quadratics are kept in formulas to be handled by Xpress XSLP, Xpress Global or Knitro. For more details on the distinction between convex and non-convex quadratics, see Selecting the right algorithm for a nonlinear problem - when to use the XPRS library instead of XSLP.

Library functions

A large number of routines are available for Library users of Xpress NonLinear, ranging from simple routines for the input and solution of problems from matrix files to sophisticated callback functions and greater control over the solution process. Library users have access to a set of functions providing advanced control over their program's interaction with the SLP module and catering for more complicated problem development. They are exported to the XPRS library, where they can be called on an XPRSprob without having to explicitly create an XSLPprob first. Alternatively, these functions also have an XSLP prefixed version that takes an SLP problem as their first argument.

Add a user callback to be called every time a new multistart job finishes.
[ Callback, Multistart]
Add a user callback to be called every time a new multistart job is created, and the pre-loaded settings are applied
[ Callback, Multistart]
Add a user callback to be called every time a multistart winner has been declared
[ Callback, Multistart]
Add a user callback to be called when an evaluation of a coefficient fails during the solve
[ Callback, Numerics]
Add a user callback to be called at the end of the cascading process, after the last variable has been cascaded
[ Callback, Cascading, SLP]
Add a user callback to be called at the start of the cascading process, before any variables have been cascaded
[ Callback, Cascading, SLP]
Add a user callback to be called after each column has been cascaded
[ Callback, Cascading, SLP]
Add a user callback to be called after cascading a column was not successful
[ Callback, Cascading, SLP]
Add a user callback to be called during the Xpress-SLP augmentation process
[ Callback, SLP]
Add a user callback used to override the update of variables with small determining column
[ Callback, Cascading, SLP]
Add a user callback to be called during MISLP when an integer solution is obtained
[ Callback, MISLP]
Add a user callback to be called at the end of each SLP iteration
[ Callback, SLP]
Add a user callback to be called at the start of each SLP iteration
[ Callback, SLP]
Add a user callback to be called after each column has been tested for convergence
[ Callback, SLP, SLP-convergence]
Add a user callback to be called before the linearization is updated
[ Callback, SLP]
A combined version of XPRSmsaddjob and XPRSmsaddpreset.
[ Data Input, Multistart]
Adds a multistart job to the multistart pool
[ Data Input, Multistart]
Loads a preset of jobs into the multistart job pool.
[ Data Input, Multistart]
Removes all scheduled jobs from the multistart job pool
[ Multistart]
Add non-linear formulas to the SLP problem.
[ Problem Modification]
Add user function definitions to an SLP problem.
[ User Functions]
Calculate the slack values for the provided solution in the non-linear problem
[ Solution]
Add or replace a single matrix formula using a parsed or unparsed formula
[ Problem Modification]
Add or replace a single matrix formula using a character string for the formula.
[ Problem Modification]
Delete nonlinear formulas from the current problem
[ Problem Modification]
Delete a user function from the current problem
[ User Functions]
Evaluate a formula using the current values of the variables
[ Solution]
Retrieve a single matrix formula as a formula split into tokens.
[ Problem Information]
Retrieve the list of positions of the nonlinear formulas in the problem
[ Problem Information]
Retrieve a single matrix formula in a character string.
[ Problem Information]
Imports a function from a library file to be called as a user function
[ User Functions]
Load non-linear formulas into the SLP problem
[ Problem Information]
Maximize or minimize an SLP problem
[ Solution Process]
Restores the problem to its pre-solve state
[ Presolve]
Print a summary of any evaluation errors that may have occurred during solving a problem
[ Logging]
Transfer the current solution to initial values
[ Data Input]
Set the function error flag for the problem
[ Misc]
Set the initial value of columns
[ Data Input]
Validate the feasibility of constraints in a converged solution
[ Solution]
Validates the first order optimality conditions also known as the Karush-Kuhn-Tucker (KKT) conditions versus the current solution
[ Solution]
Validates the current problem formulation and statement
[ Solution]
Prints an extensive analysis on a given constraint of the SLP problem
[ Solution]
Validate the feasibility of constraints for a given solution
[ Solution]
Removes a callback function previously added by XPRSaddcbmsjobend.
[ Callback, Multistart]
Removes a callback function previously added by XPRSaddcbmsjobstart.
[ Callback, Multistart]
Removes a callback function previously added by XPRSaddcbmswinner.
[ Callback, Multistart]
Removes a callback function previously added by XPRSaddcbnlpcoefevalerror.
[ Callback, Numerics]
Removes a callback function previously added by XPRSaddcbslpcascadeend.
[ Callback, Cascading, SLP]
Removes a callback function previously added by XPRSaddcbslpcascadestart.
[ Callback, Cascading, SLP]
Removes a callback function previously added by XPRSaddcbslpcascadevar.
[ Callback, Cascading, SLP]
Removes a callback function previously added by XPRSaddcbslpcascadevarfail.
[ Callback, Cascading, SLP]
Removes a callback function previously added by XPRSaddcbslpconstruct.
[ Callback, SLP]
Removes a callback function previously added by XPRSaddcbslpdrcol.
[ Callback, Cascading, SLP]
Removes a callback function previously added by XPRSaddcbslpintsol.
[ Callback, MISLP]
Removes a callback function previously added by XPRSaddcbslpiterend.
[ Callback, SLP]
Removes a callback function previously added by XPRSaddcbslpiterstart.
[ Callback, SLP]
Removes a callback function previously added by XPRSaddcbslpitervar.
[ Callback, SLP, SLP-convergence]
Removes a callback function previously added by XPRSaddcbslppreupdatelinearization.
[ Callback, SLP]
Set a user callback to be called every time a new multistart job finishes.
[ Callback, Multistart]
Set a user callback to be called every time a new multistart job is created, and the pre-loaded settings are applied
[ Callback, Multistart]
Set a user callback to be called every time a multistart winner has been declared
[ Callback, Multistart]
Set a user callback to be called when an evaluation of a coefficient fails during the solve
[ Callback, Numerics]
Add non-linear coefficients to the SLP problem.
[ Problem Modification, SLP]
Re-calculate consistent values for SLP variables based on the current values of the remaining variables.
[ Cascading, SLP, Solution Process]
Establish a re-calculation sequence for SLP variables with determining rows.
[ Data Input, SLP]
Set a variable specific cascade iteration limit
[ Data Input, SLP]
Add or change a single matrix coefficient using a parsed or unparsed formula.
[ Problem Modification, SLP]
Add or change a single matrix coefficient using a character string for the formula.
[ Problem Modification, SLP]
Change the current solution values for a set of columns, given in the input space.
[ Data Input]
Changes the type of the delta assigned to a nonlinear variable
[ Problem Modification, SLP]
Change the current (presolved) solution values for a set of columns.
[ Data Input]
Set or change the initial penalty error weight for a row
[ Data Input, SLP]
Create the full augmented SLP matrix and data structures, ready for optimization
[ SLP, Solution Process]
Delete coefficients from the current problem.
[ Problem Modification, SLP]
Evaluate a coefficient using the current values of the variables
[ Solution]
Fix the values of the error vectors
[ Solution Process]
Retrieve a single matrix coefficient as a formula split into tokens.
[ Problem Information, SLP]
Retrieve the list of positions of the nonlinear coefficients in the problem.
[ Problem Information, SLP]
Retrieve a single matrix coefficient as a formula in a character string.
[ Problem Information, SLP]
Get current column information.
[ SLP, Solution]
Get current row information.
[ SLP, Solution]
Retrieve the status setting of a constraint
[ Bit-vector, SLP, Solution]
Get the initial penalty error weight for a row
[ Data Information, SLP]
Load non-linear coefficients into the SLP problem.
[ Problem Information, SLP]
Reset the SLP problem to match a just augmented system
[ SLP, Solution Process]
Set the determining row of a variable
[ Cascading, Data Input, SLP]
Set the initial step bounds of columns
[ Data Input]
Set or clear whether a row is enforced, that is, whether it must not have a penalty error vector
[ Data Input, SLP]
Removes the augmentation and returns the problem to its pre-linearization state
[ SLP, Solution Process]
Updates the current linearization
[ SLP, Solution Process]
Copy the user-defined callbacks from one SLP problem to another
[ Callback]
Copy the values of the control variables from one SLP problem to another
[ Controls and Attributes]
Copy an existing SLP problem to another
[ Problem Creation]
Create a new SLP problem
[ Problem Creation]
Delete an SLP problem and release all the associated memory
[ Problem Creation]
Free any memory allocated by Xpress NonLinear and close any open Xpress NonLinear files
[ Licensing]
Retrieve the value of a double precision problem attribute
[ Controls and Attributes]
Retrieve the value of a double precision problem control
[ Controls and Attributes]
Retrieve the index of an Xpress NonLinear entity with a given name
[ Problem Information, User Functions]
Retrieve the value of an integer problem attribute
[ Controls and Attributes]
Retrieve the value of an integer problem control
[ Controls and Attributes]
Retrieve the error message corresponding to the last Xpress NonLinear error during an SLP run
[ Misc]
Retrieve the value of a problem pointer attribute
[ Controls and Attributes]
Retrieve the value of a string problem attribute
[ Controls and Attributes]
Retrieve the value of a string problem control
[ Controls and Attributes]
Initializes the Xpress NonLinear system
[ Licensing]
Interrupts the current SLP optimization
[ Solution Process]
Retrieves the name of an Xpress NonLinear entity or the value of a function token as a character string.
[ Names Manager]
Perform a nonlinear presolve on the problem
[ Presolve]
Print the dimensions and memory allocations for a problem
[ Logging]
Read an Xpress NonLinear extended MPS format matrix from a file into an SLP problem
[ File IO, Problem Creation]
Restore the Xpress NonLinear problem from a file created by XSLPsave
[ File IO, Save Restore]
Save the Xpress NonLinear problem to file
[ File IO, Save Restore]
Save the Xpress NonLinear problem to a named file
[ File IO, Save Restore]
Analyze the current matrix for largest/smallest coefficients and ratios
[ Numerics]
Set a user callback to be called at the end of the cascading process, after the last variable has been cascaded
[ Callback, Cascading, SLP]
Set a user callback to be called at the start of the cascading process, before any variables have been cascaded
[ Callback, Cascading, SLP]
Set a user callback to be called after each column has been cascaded
[ Callback, Cascading, SLP]
Set a user callback to be called after cascading a column was not successful
[ Callback, Cascading, SLP]
Set a user callback to be called during the Xpress-SLP augmentation process
[ Callback, SLP]
Set a user callback to be called when an SLP problem is about to be destroyed
[ Callback]
Set a user callback used to override the update of variables with small determining column
[ Callback, Cascading, SLP]
Set a user callback to be called during MISLP when an integer solution is obtained
[ Callback, MISLP]
Set a user callback to be called at the end of each SLP iteration
[ Callback, SLP]
Set a user callback to be called at the start of each SLP iteration
[ Callback, SLP]
Set a user callback to be called after each column has been tested for convergence
[ Callback, SLP, SLP-convergence]
Set a user callback to be called whenever Xpress NonLinear outputs a line of text according to XSLP_ECHOXPRSMESSAGES.
[ Callback, Logging]
Set a user callback to be called during MISLP when an optimal SLP solution is obtained at a node
[ Callback, MISLP]
Set a user callback to be called during MISLP after the set-up of the SLP problem to be solved at a node, but before SLP optimization
[ Callback, MISLP]
Set a user callback to be called after the nonlinear presolver has been applied.
[ Callback, SLP]
Set a user callback to be called before the linearization is updated
[ Callback, SLP]
Set a user callback to be called at the end of the SLP optimization
[ Callback, SLP]
Set a user callback to be called during MISLP after the SLP optimization at each node.
[ Callback, MISLP]
Set a user callback to be called at the start of the SLP optimization
[ Callback, SLP]
Set the value of a double precision problem control
[ Controls and Attributes]
Set the values of one SLP control to its default value
[ Controls and Attributes]
Set the values of all SLP controls to their default values
[ Controls and Attributes]
Set the value of an integer problem control
[ Controls and Attributes]
Define an output file to be used to receive messages from Xpress NonLinear
[ File IO, Logging]
Set the value of a control parameter by name
[ Controls and Attributes]
Set the value of a string problem control
[ Controls and Attributes]
Write the current problem to a file in extended MPS or text format
[ File IO, Problem Information]
Write the current solution to an MPS like file format
[ File IO, Solution]

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