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, types XSLP_COL and XSLP_ROW use 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". The optimizer problem must be initialized first in the normal way. Then the corresponding Xpress NonLinear problem must 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 XSLPload... functions
The XSLPload... 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 irst, using the normal Optimizer Library functions XPRSloadlp or XPRSloadmip. Then the appropriate parts of the Xpress NonLinear problem can be loaded. After all the XSLPload... functions have been called, XSLPconstruct should be called to create the SLP matrix and data structures. If XSLPconstruct 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 XSLPadd... function.
It is possible to remove parts of the SLP strcutures with the various XSLPdel functions, and XSLPunconstruct can also be used to remove the augmentation.
Xpress NonLinear is compatible with the Xpress quadratic programming optimizer. XPRSloadqp and XPRSloadmiqp can be used to load quadratic problems (or quadratically constrained problmes using XPRSloadqcqp and XPRSloadmiqcqp). The quadratic objective will be optimized using the Xpress quadratic optimizer; the nonlinear constraints will be handled with the normal SLP procedures. Please note, that this separation is only useful for a convex quadratic objective and convex quadratic inequality constraints. All nonconvex quadratic matrices should be handled as SLP strctures.
For a description on when it's more beneficial to use the XPRS library to solve QP or QCQP problems, please 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. When called from the SLP library, these functions have an XSLP prefix and take an SLP problem as their first argument. They are also exported to the XPRS library, where they can be called on an XPRSprob without having to explicitly create an XSLPprob first.
Add or replace a single matrix formula using a character string for the formula.
|
|
Retrieve a single matrix formula in a character string.
|
|
Add or change a single matrix coefficient using a character string for the formula. For a simpler version of this function see
XPRSnlpchgformulastr.
|
|
Retrieve a single matrix coefficient as a formula in a character string. For a simpler version of this function see
XPRSnlpgetformulastr.
|
|
Add non-linear coefficients to the SLP problem. For a simpler version of this function see
XSLPaddformulas.
|
|
Add a set of distribution factors.
|
|
Add non-linear formulas to the SLP problem.
|
|
Add sets of standard tolerance values to an SLP problem.
|
|
Add user function definitions to an SLP problem.
|
|
Add SLP variables defined as matrix columns to an SLP problem.
|
|
Calculate the slack values for the provided solution in the non-linear problem
|
|
Re-calculate consistent values for SLP variables based on the current values of the remaining variables.
|
|
Establish a re-calculation sequence for SLP variables with determining rows.
|
|
Set a variable specific cascade iteration limit
|
|
Add or change a single matrix coefficient using a character string for the formula. For a simpler version of this function see
XPRSnlpchgformulastr.
|
|
Add or change a single matrix coefficient using a parsed or unparsed formula. For a simpler version of this function see
XSLPchgformula.
|
|
Changes the type of the delta assigned to a nonlinear variable
|
|
Set or change a distribution factor.
|
|
Add or replace a single matrix formula using a parsed or unparsed formula
|
|
Add or replace a single matrix formula using a character string for the formula.
|
|
Change the status setting of a constraint
|
|
Set or change the initial penalty error weight for a row
|
|
Add or change a set of convergence tolerances used for SLP variables.
|
|
Define a column as an SLP variable or change the characteristics and values of an existing SLP variable.
|
|
Create the full augmented SLP matrix and data structures, ready for optimization
|
|
Copy the user-defined callbacks from one SLP problem to another
|
|
Copy the values of the control variables from one SLP problem to another
|
|
Copy an existing SLP problem to another
|
|
Create a new SLP problem
|
|
Delete coefficients from the current problem. For a simpler version of this function see
XSLPdelformulas.
|
|
Delete nonlinear formulas from the current problem
|
|
This function is deprecated and may be removed in future releases. Delete tolerance sets from the current problem
|
|
Delete a user function from the current problem
|
|
This function is deprecated and may be removed in future releases. Convert SLP variables to normal columns. Variables must not appear in SLP structures
|
|
Delete an SLP problem and release all the associated memory
|
|
Evaluate a coefficient using the current values of the variables
|
|
Evaluate a formula using the current values of the variables
|
|
Fixe the values of the error vectors
|
|
Free any memory allocated by Xpress NonLinear and close any open Xpress NonLinear files
|
|
This function is deprecated and may be removed in future releases. This function has the same effect as XPRSgetbanner
|
|
Retrieve a single matrix coefficient as a formula in a character string. For a simpler version of this function see
XPRSnlpgetformulastr.
|
|
Retrieve a single matrix coefficient as a formula split into tokens. For a simpler version of this function see
XSLPchgformula.
|
|
Retrieve the list of positions of the nonlinear coefficients in the problem. For a simpler version of this function see
XSLPgetformularows.
|
|
Get current column information.
|
|
Retrieve the value of a double precision problem attribute
|
|
Retrieve the value of a double precision problem control
|
|
Get a distribution factor.
|
|
Retrieve a single matrix formula as a formula split into tokens.
|
|
Retrieve the list of positions of the nonlinear formulas in the problem
|
|
Retrieve a single matrix formula in a character string.
|
|
Retrieve the index of an Xpress NonLinear entity with a given name
|
|
Retrieve the value of an integer problem attribute
|
|
Retrieve the value of an integer problem control
|
|
Retrieve the error message corresponding to the last Xpress NonLinear error during an SLP run
|
|
Retrieve the value of a problem pointer attribute
|
|
Get current row information.
|
|
Retrieve the status setting of a constraint
|
|
Get the initial penalty error weight for a row
|
|
Obtain the current SLP solution values
|
|
Retrieve the value of a string problem attribute
|
|
Retrieve the value of a string problem control
|
|
Retrieve the values of a set of convergence tolerances for an SLP problem.
|
|
Retrieve information about an SLP variable.
|
|
Imports a function from a library file to be called as a user function
|
|
Initializes the Xpress NonLinear system
|
|
Interrupts the current SLP optimization
|
|
Retrieves the name of an Xpress NonLinear entity or the value of a function token as a character string.
|
|
Load non-linear coefficients into the SLP problem. For a simpler version of this function see
XSLPloadformulas.
|
|
Load a set of distribution factors.
|
|
Load non-linear formulas into the SLP problem
|
|
Load sets of standard tolerance values into an SLP problem.
|
|
Load SLP variables defined as matrix columns into an SLP problem.
|
|
Maximize an SLP problem
|
|
Minimize an SLP problem
|
|
A combined version of XSLPmsaddjob and XSLPmsaddpreset. The preset described is loaded, topped up with the specific settings supplied
|
|
Adds a multistart job to the multistart pool
|
|
Loads a preset of jobs into the multistart job pool.
|
|
Removes all scheduled jobs from the multistart job pool
|
|
Maximize or minimize an SLP problem
|
|
Restores the problem to its pre-solve state
|
|
Perform a nonlinear presolve on the problem
|
|
Print a summary of any evaluation errors that may have occurred during solving a problem
|
|
Print the dimensions and memory allocations for a problem
|
|
Read an Xpress NonLinear extended MPS format matrix from a file into an SLP problem
|
|
Reset the SLP problem to match a just augmented system
|
|
Continue the maximization of an SLP problem.
|
|
Continue the minimization of an SLP problem.
|
|
Restore the Xpress NonLinear problem from a file created by
XSLPsave
|
|
Save the Xpress NonLinear problem to file
|
|
Save the Xpress NonLinear problem to a named file
|
|
Analyze the current matrix for largest/smallest coefficients and ratios
|
|
Set a user callback to be called at the end of the cascading process, after the last variable has been cascaded
|
|
Set a user callback to be called at the start of the cascading process, before any variables have been cascaded
|
|
Set a user callback to be called after each column has been cascaded
|
|
Set a user callback to be called after cascading a column was not successful
|
|
Set a user callback to be called when an evaluation of a coefficient fails during the solve
|
|
Set a user callback to be called during the Xpress-SLP augmentation process
|
|
Set a user callback to be called when an SLP problem is about to be destroyed
|
|
Set a user callback used to override the update of variables with small determining column
|
|
Set a user callback to be called during MISLP when an integer solution is obtained
|
|
Set a user callback to be called at the end of each SLP iteration
|
|
Set a user callback to be called at the start of each SLP iteration
|
|
Set a user callback to be called after each column has been tested for convergence
|
|
Set a user callback to be called whenever Xpress NonLinear outputs a line of text according to
XSLP_ECHOXPRSMESSAGES.
|
|
Set a user callback to be called every time a new multistart job finishes. Can be used to overwrite the default solution ranking function
|
|
Set a user callback to be called every time a new multistart job is created, and the pre-loaded settings are applied
|
|
Set a user callback to be called every time a multistart winner has been declared
|
|
Set a user callback to be called during MISLP when an optimal SLP solution is obtained at a node
|
|
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
|
|
Set a user callback to be called after the nonlinear presolver has been applied.
|
|
Set a user callback to be called before the linearization is updated
|
|
Set a user callback to be called at the end of the SLP optimization
|
|
Set a user callback to be called during MISLP after the SLP optimization at each node.
|
|
Set a user callback to be called at the start of the SLP optimization
|
|
Transfer the current solution to initial values
|
|
Set the value of a double precision problem control
|
|
Set the values of one SLP control to its default value
|
|
Set the values of all SLP controls to their default values
|
|
Set the determining row of a variable
|
|
Set the function error flag for the problem
|
|
Set the initial value of a variable
|
|
Set the value of an integer problem control
|
|
Define an output file to be used to receive messages from Xpress NonLinear
|
|
Set the value of a control parameter by name
|
|
Set the value of a string problem control
|
|
Removes the augmentation and returns the problem to its pre-linearization state
|
|
Updates the current linearization
|
|
Validate the feasibility of constraints in a converged solution
|
|
Validates the first order optimality conditions also known as the Karush-Kuhn-Tucker (KKT) conditions versus the currect solution
|
|
Validates the current problem formulation and statement
|
|
Prints an extensive analysis on a given constraint of the SLP problem
|
|
Validate the feasibility of constraints for a given solution
|
|
Write the current problem to a file in extended MPS or text format
|
|
Write the current solution to an MPS like file format
|
© 2001-2024 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.