Click or drag to resize

XPRBprob Class

Methods for initialisation and handling of XPRBprob objects.
Inheritance Hierarchy
SystemObject
  BCLXPRBprob

Namespace: BCL
Assembly: xprbdn (in xprbdn.dll) Version: 47.01.01+0ba4e76731516b80760698bbaa939494dae84e49
Syntax
public class XPRBprob : IDisposable

The XPRBprob type exposes the following members.

Constructors
 NameDescription
Public methodCode exampleXPRBprob Create the XPRBprob object.
Obsolete
Top
Methods
 NameDescription
Public methodCode exampleaddCuts Add an array of cuts to the Optimizer problem. This method adds an array of previously defined cuts to the problem currently held in Xpress-Optimizer. Typically, this method will be called from the cut manager callback of the Optimizer. Cuts are not stored in the BCL problem. See the BCL examples for demonstrations.
Public methodCode exampleAddDelVarCallback Add a BCL variable deletions callback.
Obsolete
Public methodCode exampleAddErrorCallback Add a BCL error callback.
Public methodCode exampleAddMessageCallback Add a BCL message callback.
Public methodCode exampleaddMIPSol(XPRBsol) Adds a MIP solution from an external source into the Optimizer. The solution is given in the form of an XPRBsol object and can be feasible, infeasible or partial. The function returns immediately after passing the solution to the Optimizer. The solution is placed in a pool until the Optimizer is able to analyze the solution during a MIP solve. If the provided solution is found to be infeasible, a limited local search heuristic will be run to attempt to find a close feasible integer solution. If a partial solution is provided, global columns will be fixed to any provided values and a limited local search will be run in an attempt to find integer feasible values for the remaining unspecified columns. Values provided for continuous columns in partial solutions are currently ignored.
Public methodCode exampleaddMIPSol(XPRBsol, String) Adds a MIP solution from an external source into the Optimizer. The solution is given in the form of an XPRBsol object and can be feasible, infeasible or partial. The function returns immediately after passing the solution to the Optimizer. The solution is placed in a pool until the Optimizer is able to analyze the solution during a MIP solve. If the provided solution is found to be infeasible, a limited local search heuristic will be run to attempt to find a close feasible integer solution. If a partial solution is provided, global columns will be fixed to any provided values and a limited local search will be run in an attempt to find integer feasible values for the remaining unspecified columns. Values provided for continuous columns in partial solutions are currently ignored.
Public methodCode examplebeginCB Start working with BCL within an Optimizer callback. This method precedes any call to BCL functionality within an Optimizer callback. It updates the BCL problem information for working with the local Optimizer subproblem and resets the BCL problem status. This method blocks access to the BCL problem until it is released by a matching call to endCB.
Public methodCode exampleclearDir Delete all directives. Directives may be set on objects of type XPRBvar or XPRBsos.
Public methodCode exampledelCtr Delete an XPRBctr constraint from the current problem.
Public methodCode exampledelCut Release the memory used by an XPRBcut object created for this problem. Does not remove a cut previously added by XPRSprob.addCuts from the problem.
Public methodCode exampledelSol Remove a solution object from this problem.
Public methodCode exampledelSos Delete an XPRBsos from the current problem.
Public methodDisposeReleases all resources used by the XPRBprob
Protected methodDispose(Boolean)Releases the unmanaged resources used by the XPRBprob and optionally releases the managed resources
Public methodCode exampleendCB Terminate working with BCL within an Optimizer callback. This method sets the BCL problem information back to working with the main Optimizer problem, this includes resetting the BCL problem status. There must be a matching call to beginCB
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodCode exampleexportProb Same as exportProb(BCLconstant.XPRB_LP, null);
Public methodCode exampleexportProb(Int32, String) Print problem matrix to a file. This method prints the matrix to a file with an extended LP or extended MPS format. Provided that no extension is given by the user LP files receive the extension .lp. MPS files always receive the extension .mat. When exporting matrices semi-continuous and semi-continuous integer variables are preprocessed: if a lower bound value greater than 0 is given, then the variable is treated like a continuous (resp. integer) variable. The precision used by BCL for printing real numbers can be changed with setRealFmt(string) to obtain more accurate output for very large or very small numbers. For full precision matrix output the user is advised to switch to the Optimizer function XPRSprob.writeProb, preceded by a call to loadMat().
Protected methodFinalize
(Overrides ObjectFinalize)
Public methodCode examplefixMIPEntities Fix all the global entities. Fixes 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.
Public methodCode examplefixMIPEntities(Boolean) Fix all the global entities. Fixes 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.
Public methodCode examplegetCRef Retrieve the reference of the current XPRBprob object.
Public methodCode examplegetCtrByName Retrieve an XPRBctr constraint by name.
Public methodgetCtrs 
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodgetIIS(IList, IList) Same as getIIS(vars, ctrs, null, 1);
Public methodgetIIS(IList, IList, IList) Same as getIIS(vars, ctrs, soss, 1);
Public methodgetIIS(IList, IList, Int32) Same as getIIS(vars, ctrs, null, num);
Public methodgetIIS(IList, IList, IList, Int32) Get IIS variables, constraints, and SOS.
Public methodCode examplegetIndexSetByName Retrieve an XPRBindexSet by name.
Public methodCode examplegetLPStat Get the LP status.
Public methodCode examplegetMIPStat Get the MIP (global) status.
Public methodCode examplegetName Retrieve the name of the current problem.
Public methodCode examplegetNumIIS Get the number of independent IIS. The method returns the number of independent irreducible infeasible sets found by Xpress-Optimizer for an infeasible LP problem.
Public methodCode examplegetObjVal Get the objective function value.
Public methodCode examplegetProbStat Get the problem status.
Public methodCode examplegetSense Get the sense of the objective function.
Public methodCode examplegetSosByName Retrieve an XPRBsos by name.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodCode examplegetVarByName Retrieve an XPRBvar variable by name.
Public methodCode examplegetXPRSprob Returns an XPRSprob problem object for a problem defined in BCL and subsequently loaded into the Xpress-Optimizer.
Public methodisValid 
Public methodCode exampleloadBasis Load a previously saved basis. This method loads a basis for the current problem in the optimizer. The basis must have been saved using method saveBasis(). It is not possible to load a basis saved for any other problem, even if the problems are similar. This method takes into account that the problem may have been modified (addition/deletion of variables and constraints) since the basis has been stored. Note that the problem has to be loaded explicitly (method loadMat()) before the basis is re-input with this method.
Public methodCode exampleloadMat Load a problem into Xpress-Optimizer. This method transforms the current BCL problem definition into a matrix in Xpress-Optimizer. Empty rows and columns are deleted before generating the matrix. Semi-continuous (integer) variables are preprocessed: if a lower bound value greater than 0 is given, then the variable is treated like a continuous (resp. integer) variable. Variables that belong to the problem but do not appear in the matrix receive negative column numbers. Usually, it is not necessary to call this method explicitly because BCL automatically does this conversion whenever it is required.
Public methodloadMIPSol(Double, Int32) Load a MIP solution from the MIP solution pool.
Public methodloadMIPSol(Double, Int32, Boolean) Load a MIP solution from the MIP solution pool.
Public methodlpOptimiseObsolete
Public methodlpOptimise(String)Obsolete
Public methodlpOptimizeObsolete
Public methodCode examplelpOptimize(String)Solve as a continuous problem.
Obsolete
Public methodmaximObsolete
Public methodCode examplemaxim(String) Maximize a problem. This method selects and starts the Xpress-Optimizer solution algorithm. The characters indicating the algorithm choice may be combined where it makes sense, e.g. "dg". If the matrix loaded in Xpress-Optimizer does not correspond to the current problem definition it is regenerated automatically prior to the start of the algorithm. Before solving a problem, the objective function must be selected with setObj(). Note that if you use an incomplete global search you should finish your program with a call to the Xpress-Optimizer method XPRSprob.PostSolve() (see Xpress-Optimizer manual for details) in order to remove all search tree information that has been stored. Otherwise you may not be able to re-run your program.
Obsolete
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodminimObsolete
Public methodCode exampleminim(String) Minimize a problem. This method selects and starts the Xpress-Optimizer solution algorithm. The characters indicating the algorithm choice may be combined where it makes sense, e.g. "dg". If the matrix loaded in Xpress-Optimizer does not correspond to the current problem definition it is regenerated automatically prior to the start of the algorithm. Before solving a problem, the objective function must be selected with setObj(). Note that if you use an incomplete global search you should finish your program with a call to the Xpress-Optimizer method XPRSprob.PostSolve() (see Xpress-Optimizer manual for details) in order to remove all search tree information that has been stored. Otherwise you may not be able to re-run your program.
Obsolete
Public methodmipOptimiseObsolete
Public methodmipOptimise(String)Obsolete
Public methodmipOptimizeObsolete
Public methodCode examplemipOptimize(String)Solve as a discrete problem.
Obsolete
Public methodCode examplenewCtr(String) Create an empty XPRBctr constraint in the current problem.
Public methodCode examplenewCtr(XPRBexpr) Create a new, unnamed, XPRBctr constraint in the current problem.
Public methodCode examplenewCtr(XPRBrelation) Create a new, unnamed, XPRBctr constraint in the current problem.
Public methodCode examplenewCtr(XPRBvar) Create a new, unnamed, XPRBctr constraint in the current problem.
Public methodCode examplenewCtr(String, XPRBexpr) Create a new XPRBctr constraint in the current problem.
Public methodCode examplenewCtr(String, XPRBrelation) Create a new XPRBctr constraint in the current problem.
Public methodCode examplenewCut(Int32) Create a new cut. This method has to be called before XPRBcut.addTerm(XPRBvar, double) or XPRBcut.setTerm(XPRBvar, double) are used to add terms to the cut. Cuts are inequalities or equations. If no type is specified the type BCLconstant.XPRB.E is assumed, it can be changed with method XPRBcut.setType(int).
Public methodCode examplenewCut(XPRBrelation) Create a new cut. This method has to be called before XPRBcut.addTerm(XPRBvar, double) or XPRBcut.setTerm(XPRBvar, double) are used to add terms to the cut. Cuts are inequalities or equations. If no type is specified the type BCLconstant.XPRB.E is assumed, it can be changed with method XPRBcut.setType(int).
Public methodCode examplenewCut(XPRBrelation, Int32) Create a new cut. This method has to be called before XPRBcut.addTerm(XPRBvar, double) or XPRBcut.setTerm(XPRBvar, double) are used to add terms to the cut. Cuts are inequalities or equations. If no type is specified the type BCLconstant.XPRB.E is assumed, it can be changed with method XPRBcut.setType(int).
Public methodCode examplenewIndexSet(Int32) Create a default named new XPRBindexSet index set in the current problem. The maximum size may be altered dynamically at a later time.
Public methodCode examplenewIndexSet(String) Create a new XPRBindexSet index set in the current problem with a maxsize of zero. This size may be altered dynamically at a later time.
Public methodCode examplenewIndexSet(String, Int32) Create a new XPRBindexSet index set in the current problem. This maxsize may be altered dynamically at a later time.
Public methodCode examplenewSol Create a new solution object for this problem.
Public methodCode examplenewSos Create a default XPRBsos Special Ordered Set (of type 1) in the current problem.
Public methodCode examplenewSos(Int32) Create a default named XPRBsos Special Ordered Set in the current problem.
Public methodCode examplenewSos(Int32, XPRBexpr) Create a default named XPRBsos Special Ordered Set in the current problem. For the expression which is given as a parameter, the variables in the expression are added to the SOS and the coefficient of each variable becomes its weight.
Public methodCode examplenewSos(String, Int32) Create an XPRBsos Special Ordered Set in the current problem.
Public methodCode examplenewSos(String, Int32, XPRBexpr) Create an XPRBsos Special Ordered Set in the current problem. For the expression which is given as a parameter, the variables in the expression are added to the SOS and the coefficient of each variable becomes its weight.
Public methodCode examplenewVar(String) Create a new XPRBvar variable in the current problem. The lower bound is set to zero, the upper bound to BCLconstant.XPRB_INFINITY and the type to BCLconstant.XPRB_PL (continuous).
Public methodCode examplenewVar(String, Int32) Create a new XPRBvar variable in the current problem. The lower bound is set to zero and the upper bound to BCLconstant.XPRB_INFINITY.
Public methodCode examplenewVar(String, Int32, Double, Double) Create a new XPRBvar variable in the current problem.
Public methodCode exampleprint Print out the current problem.
Public methodCode exampleprintF Print a string.
Public methodCode examplereadBinSol Read the solution from a binary file. Read a binary solution file (.bin), created by the writeBinSol method, loading it into the Optimizer.
Public methodCode examplereadBinSol(String) Read the solution from a binary file. Read a binary solution file (.bin), created by the writeBinSol method, loading it into the Optimizer.
Public methodCode examplereadBinSol(String, String) Read the solution from a binary file. Read a binary solution file (.bin), created by the writeBinSol method, loading it into the Optimizer.
Public methodCode examplereadSlxSol Read the solution from an ASCII file. Read an ASCII solution file (.slx), created by the writeSlxSol method, loading it into the Optimizer.
Public methodCode examplereadSlxSol(String) Read the solution from an ASCII file. Read an ASCII solution file (.slx), created by the writeSlxSol method, loading it into the Optimizer.
Public methodCode examplereadSlxSol(String, String) Read the solution from an ASCII file. Read an ASCII solution file (.slx), created by the writeSlxSol method, loading it into the Optimizer.
Public methodCode exampleRemoveDelVarCallback Remove a BCL variable deletions callback.
Obsolete
Public methodCode exampleRemoveErrorCallback Remove a BCL error callback.
Public methodCode exampleRemoveMessageCallback Remove a BCL message callback.
Public methodCode examplereset Reset the current XPRBprob object.
Public methodCode examplesaveBasis Save the current basis. This method saves the basis for the current problem in the optimizer by creating a new object of type XPRBbasis.
Public methodCode examplesetColOrder Create the XPRBprob object.
Public methodCode examplesetCutMode Parameter settings for cuts. This methods sets certain Xpress-Optimizer control parameters to enable the addition of cuts defined in BCL during the MIP search.
Public methodCode examplesetDictionarySize Set the size of a dictionary. This method sets the size of the names or indices dictionaries. It can only be called immediately after the creation of a problem. Once the names dictionary has been disabled it cannot be enabled any more. All methods relative to the names cannot be used if this dictionary has been disabled. The indices dictionary cannot be disabled.
Public methodCode examplesetErrCtrl Set the error flag control.
Public methodCode examplesetMsgLevel Set the message print level.
Public methodsetName Set the name of the problem.
Public methodCode examplesetObj(Double) Set double objective function for the current problem (usually used to set "none" with a 0.0 value).
Public methodCode examplesetObj(XPRBctr) Set the objective function for the current problem.
Public methodCode examplesetObj(XPRBexpr) Set the objective function for the current problem.
Public methodCode examplesetRealFmt Set the format for printing real numbers.
Public methodCode examplesetSense Set the sense of the objective function. The objective sense is set to minimization by default.
Public methodsolveObsolete
Public methodCode examplesolve(String) Call Xpress-Optimizer solution algorithm. This method selects and starts the Xpress-Optimizer solution algorithm. The characters indicating the algorithm choice may be combined where it makes sense, e.g. "dg". If the matrix loaded in Xpress-Optimizer does not correspond to the current problem definition it is regenerated automatically prior to the start of the algorithm. The sense of the optimization (default: minimization) can be changed with method setSense(int). Before solving a problem, the objective function must be selected with setObj(). Note that if you use an incomplete global search you should finish your program with a call to the Xpress-Optimizer method XPRSprob.PostSolve() (see Xpress-Optimizer manual for details) in order to remove all search tree information that has been stored. Otherwise you may not be able to re-run your program.
Obsolete
Public methodCode examplesync Synchronize BCL with the Optimizer. This method resets the BCL problem status.
Public methodToString Retrieve the name of the current problem.
(Overrides ObjectToString)
Public methodCode examplewriteBinSol Writes the solution to a binary file. Writes the current MIP or LP Optimizer solution to a binary solution file (.sol) for later input into the Optimizer.
Public methodCode examplewriteBinSol(String) Writes the solution to a binary file. Writes the current MIP or LP Optimizer solution to a binary solution file (.sol) for later input into the Optimizer.
Public methodCode examplewriteBinSol(String, String) Writes the solution to a binary file. Writes the current MIP or LP Optimizer solution to a binary solution file (.sol) for later input into the Optimizer.
Public methodCode examplewriteDir Write directives to a file. This method writes out to a file the directives defined for a problem. The extension .dir is appended to the given file name. When no file name is given (null), the name of the problem is used. If a file of the given name exists already it is replaced.
Public methodCode examplewritePrtSol Write solution to a fixed format ASCII file. Writes the current Optimizer solution to a fixed format ASCII file (.prt).
Public methodCode examplewritePrtSol(String) Write solution to a fixed format ASCII file. Writes the current Optimizer solution to a fixed format ASCII file (.prt).
Public methodCode examplewritePrtSol(String, String) Write solution to a fixed format ASCII file. Writes the current Optimizer solution to a fixed format ASCII file (.prt).
Public methodCode examplewriteSlxSol Write solution to a an ASCII file. Writes the current Optimizer solution to an ASCII solution file (.slx) using a similar format to MPS files.
Public methodCode examplewriteSlxSol(String) Write solution to a an ASCII file. Writes the current Optimizer solution to an ASCII solution file (.slx) using a similar format to MPS files.
Public methodCode examplewriteSlxSol(String, String) Write solution to a an ASCII file. Writes the current Optimizer solution to an ASCII solution file (.slx) using a similar format to MPS files.
Public methodwriteSol Write solution to a CSV file. This method writes the current Optimizer solution to a CSV format ASCII file (.asc and .hdr).
Public methodwriteSol(String) Write solution to a CSV file. This method writes the current Optimizer solution to a CSV format ASCII file (.asc and .hdr).
Public methodCode examplewriteSol(String, String) Write solution to a CSV file. This method writes the current Optimizer solution to a CSV format ASCII file (.asc and .hdr). Please refer to the documentation of XPRSwritesol in the Xpress-Optimizer Reference Manual for a description of the various flags.
Public methodCode exampleXPRBreadarrline(StreamReader, Int32, String, Double, Int32) Read a line of an array from a data file.
Public methodCode exampleXPRBreadarrline(StreamReader, Int32, String, Int32, Int32) Read a line of an array from a data file.
Public methodCode exampleXPRBreadarrline(StreamReader, Int32, String, Object, Int32) Read a line of an array from a data file.
Public methodCode exampleXPRBreadarrline(StreamReader, Int32, String, String, Int32) Read a line of an array from a data file.
Public methodCode exampleXPRBreadline Read a formatted line from a data file. Anything after a comment (! denotes the beginning of a comment) will be ignored. This will read multiple lines if the line ends with &.
Top
Events
 NameDescription
Public eventCode exampleDelVarCallbacks Add or subtract a BCL variable deletions callback using standard +- operators.
Obsolete
Public eventCode exampleErrorCallbacks Add or subtract a BCL error callback using standard +- operators.
Public eventCode exampleMessageCallbacks Add or subtract a BCL message callback using standard +- operators.
Top
Fields
 NameDescription
Protected fieldprob_ref 
Top
Remarks
XPRBprob objects should only be instantiated and used while a BCL session has been established via XPRB.init()
See Also

Reference

BCL Namespace