Console and Library Functions
A large number of routines are available for both Console and Library users of the Xpress‑Optimizer, 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. Of these, the core functionality is available to both sets of users and comprises the 'Console Mode'. Library users additionally have access to a set of more 'advanced' functions, which extend the functionality provided by the Console Mode, providing more control over their program's interaction with the Optimizer and catering for more complicated problem development.
Console Mode Functions
With both the Console and Advanced Mode functions described side-by-side in this chapter, library users can use this as a quick reference for the full capabilities of the Optimizer library. For users of Console Xpress, only the following functions will be of relevance:
Command DescriptionEXIT Terminate the Console Optimizer.HELP Quick reference help for the optimizer consolePRINTRANGE Writes the ranging information to screen.PRINTSOL Write the current solution to screen.QUIT Terminate the Console Optimizer.STOP Terminate the Console Optimizer.ALTER Alters or changes matrix elements, right hand sides and constraint senses in the current problem.BASISCONDITION Calculates the condition number of the current basis after solving the LP relaxation.FIXGLOBAL Fixes all the global entities to the values of the last found MIP solution. This is useful for finding the reduced costs for the continuous variables after the global variables have been fixed to their optimal values.GETMESSAGESTATUS Manages suppression of messages.GLOBAL Starts the global search for an integer solution after solving the LP relaxation with XPRSmaxim (MAXIM) or XPRSminim (MINIM) or continues a global search if it has been interrupted.GOAL Perform goal programming.IIS Initiates the search for Irreducible Infeasible Sets (IIS) amongst problems which are linear infeasible.MAXIM, MINIM Begins a search for the optimal LP solution.POSTSOLVE Postsolve the current matrix when it is in a presolved state.RANGE Calculates the ranging information for a problem and saves it to the binary ranging file problem_name.rng.READBASIS Instructs the Optimizer to read in a previously saved basis from a file.READBINSOL Reads a solution from a binary solution file.READDIRS Reads a directives file to help direct the global search.READPROB Reads an (X)MPS or LP format matrix from file.RESTORE Restores the Optimizer's data structures from a file created by XPRSsave (SAVE). Optimization may then recommence from the point at which the file was created.SAVE Saves the current data structures, i.e. matrices, control settings and problem attribute settings to file and terminates the run so that optimization can be resumed later.SCALE Re-scales the current matrix.SETMESSAGESTATUS Manages suppression of messages.SETPROBNAME Sets the current default problem name. This command is rarely used.WRITEBASIS Writes the current basis to a file for later input into the Optimizer.WRITEBINSOL Writes the current MIP or LP solution to a binary solution file for later input into the Optimizer.WRITEOMNI Writes the current solution to the binary OMNI format file SOLFILE, as recorded in the solution file problem_name .sol. Optionally the current matrix may also be written. All information is appended to this file.WRITEPROB Writes the current problem to an MPS or LP file.WRITEPRTRANGE Writes the ranging information to a fixed format ASCII file, problem_name.rrt. The binary range file (.rng) must already exist, created by XPRSrange (RANGE).WRITEPRTSOL Writes the current solution to a fixed format ASCII file, problem_name .prt.WRITERANGE Writes the ranging information to a CSV format ASCII file, problem_name.rsc (and .hdr). The binary range file (.rng) must already exist, created by XPRSrange (RANGE) and an associated header file.WRITESOL Writes the current solution to a CSV format ASCII file, problem_name.asc (and .hdr).For a list of functions by task, refer to Quick Reference.
Layout For Function Descriptions
All functions mentioned in this chapter are described under the following set of headings:
Function Name
The description of each routine starts on a new page for the sake of clarity. The library name for a function is on the left and the Console Xpress name, where relevant, is on the right.
Purpose
A short description of the routine and its purpose begins the information section.
Synopsis
A synopsis of the syntax for usage of the routine is provided. "Optional" arguments and flags may be specified as NULL if not required. Where this possibility exists, it will be described alongside the argument, or in the Further Information at the end of the routine's description. Where the function forms part of the Console Mode, the library syntax is described first, followed by the Console Xpress syntax.
Arguments
A list of arguments to the routine with a description of possible values for them follows.
Error Values
Optimizer return codes are described in Return Codes and Error Messages. For library users, however, a return code of 32 indicates that additional error information may be obtained, specific to the function which caused the error. Such is available by calling
XPRSgetintattrib(prob,XPRS_ERRORCODE,&errorcode);Likely error values returned by this for each function are listed in the Error Values section. A description of the error may be obtained using the XPRSgetlasterror function. If no attention need be drawn to particular error values, this section will be omitted.
Associated Controls
Controls which affect a given routine are listed next, separated into lists by type. The control name given here should have XPRS_ prefixed by library users, in a similar way to the XPRSgetintattrib example in the Error Values section above. Console Xpress users should use the controls without this prefix, as described in Xpress‑MP Getting Started manual. These controls must be set before the routine is called if they are to have any effect.
Examples
One or two examples are provided which explain certain aspects of the routine's use.
Further Information
Additional information not contained elsewhere in the routine's description is provided at the end.
Related Topics
Finally a list of related routines and topics is provided for comparison and reference.
If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.