public class XPRB extends java.lang.Object implements XOctrl, java.lang.AutoCloseable
try (XPRB bcl = new XPRB()) {
...
}
| Modifier and Type | Field and Description |
|---|---|
static int |
BV
Variable type: binary
|
static int |
CTR
Model object type: constraint
|
static int |
DICT_IDX
Dictionary choice: index set element names dictionary
|
static int |
DICT_NAMES
Dictionary choice: names dictionary
|
static int |
DIR
Problem status: directives added
|
static int |
DN
Branching directive: first branch downwards
|
static int |
E
Constraint type: equation
|
static int |
G
Constraint type: inequality "greater or equal"
|
static int |
GEN
Problem status: matrix generated
|
static int |
IDX
Model object type: index set
|
static double |
INFINITY
Plus infinity
|
static int |
L
Constraint type: inequality "less or equal"
|
static int |
LCOST
Range type: lower cost
|
static int |
LOACT
Range type: lower activity
|
static int |
LP
Matrix file format: extended LP
|
static int |
LP_CUTOFF
LP status: objective value worse than cutoff value
|
static int |
LP_CUTOFF_IN_DUAL
LP status: LP cutoff in dual
|
static int |
LP_INFEAS
LP status: LP infeasible
|
static int |
LP_NONCONVEX
LP status: QP nonconvex
|
static int |
LP_OPTIMAL
LP status: LP optimal
|
static int |
LP_UNBOUNDED
LP status: LP unbounded
|
static int |
LP_UNFINISHED
LP status: LP unfinished
|
static int |
LP_UNSOLVED
LP status: LP unsolved
|
static int |
MAXIM
Sense of the objective function: maximization
|
static int |
MINIM
Sense of the objective function: minimization
|
static int |
MIP_INFEAS
MIP status: global search complete, no integer solution found
|
static int |
MIP_LP_NOT_OPTIMAL
MIP status: LP has not been optimized
|
static int |
MIP_LP_OPTIMAL
MIP status: LP has been optimized
|
static int |
MIP_NO_SOL_FOUND
MIP status: global search incomplete, no integer solution found
|
static int |
MIP_NOT_LOADED
MIP status: problem has not been loaded
|
static int |
MIP_OPTIMAL
MIP status: global search complete, an integer solution has been found
|
static int |
MIP_SOLUTION
MIP status: global search incomplete, an integer solution has been found
|
static int |
MIP_UNBOUNDED
MIP status: LP unbounded
|
static int |
MOD
Problem status: problem modified
|
static int |
MPS
Matrix file format: extended MPS
|
static int |
N
Constraint type: non-binding
|
static int |
PD
Branching directive: pseudocost on branching downwards
|
static int |
PI
Variable type: partial integer
|
static int |
PL
Variable type: continuous
|
static int |
PR
Branching directive: priority
|
static int |
PU
Branching directive: pseudocost on branching upwards
|
static int |
R
Constraint type: range
|
static int |
S1
SOS type: Special ordered set of type 1
|
static int |
S2
SOS type: Special ordered set of type 2
|
static int |
SC
Variable type: semi-continuous
|
static int |
SI
Variable type: semi-continuous integer
|
static int |
SOL
Problem status: solution available
|
static int |
SOS
Model object type: SOS
|
static int |
UCOST
Range type: upper cost
|
static int |
UDN
Range type: lower unit cost
|
static int |
UI
Variable type: general integer
|
static int |
UP
Branching directive: first branch upwards
|
static int |
UPACT
Range type: upper activity
|
static int |
UUP
Range type: upper unit cost
|
static int |
VAR
Model object type: variable
|
static int |
XPRS_PROB
BCL - Optimizer synchronization: force problem reloading
|
static int |
XPRS_SOL
BCL - Optimizer synchronization: LP solution update
|
static int |
XPRS_SOLMIP
BCL - Optimizer synchronization: MIP solution update
|
XPRS_ACTIVENODES, XPRS_ACTIVESET, XPRS_ALG_BARRIER, XPRS_ALG_DEFAULT, XPRS_ALG_DUAL, XPRS_ALG_PRIMAL, XPRS_AUTOPERTURB, XPRS_BACKTRACK, XPRS_BAR_DEFAULT, XPRS_BAR_MIN_DEGREE, XPRS_BAR_MIN_LOCAL_FILL, XPRS_BAR_NESTED_DISSECTION, XPRS_BARAASIZE, XPRS_BARCROSSOVER, XPRS_BARDENSECOL, XPRS_BARDUALINF, XPRS_BARDUALOBJ, XPRS_BARDUALSTOP, XPRS_BARGAPSTOP, XPRS_BARINDEFLIMIT, XPRS_BARITER, XPRS_BARITERLIMIT, XPRS_BARLSIZE, XPRS_BARORDER, XPRS_BAROUTPUT, XPRS_BARPRIMALINF, XPRS_BARPRIMALOBJ, XPRS_BARPRIMALSTOP, XPRS_BARSTEPSTOP, XPRS_BARSTOP, XPRS_BARTHREADS, XPRS_BESTBOUND, XPRS_BIGM, XPRS_BIGMMETHOD, XPRS_BRANCHCHOICE, XPRS_BRANCHVALUE, XPRS_BRANCHVAR, XPRS_BREADTHFIRST, XPRS_CACHESIZE, XPRS_CHOLESKYALG, XPRS_CHOLESKYTOL, XPRS_COLS, XPRS_CONBRANCH, XPRS_COVERCUTS, XPRS_CPKEEPALLCUTS, XPRS_CPMAXCUTS, XPRS_CPMAXELEMS, XPRS_CPUTIME, XPRS_CRASH, XPRS_CROSSOVER, XPRS_CSTYLE, XPRS_CUTDEPTH, XPRS_CUTFREQ, XPRS_CUTS, XPRS_CUTSTRATEGY, XPRS_DEFAULTALG, XPRS_DEGRADEFACTOR, XPRS_DENSECOLLIMIT, XPRS_DUALGRADIENT, XPRS_DUALINFEAS, XPRS_DUALIZE, XPRS_ELEMS, XPRS_ELIMTOL, XPRS_ERRORCODE, XPRS_ETATOL, XPRS_EXTRACOLS, XPRS_EXTRAELEMS, XPRS_EXTRAMIPENTS, XPRS_EXTRAPRESOLVE, XPRS_EXTRAROWS, XPRS_FEASTOL, XPRS_GOMCUTS, XPRS_HEURDEPTH, XPRS_HEURDIVESTRATEGY, XPRS_HEURFREQ, XPRS_HEURMAXSOL, XPRS_HEURNODES, XPRS_HEURSELECT, XPRS_HEURSTRATEGY, XPRS_IIS, XPRS_INVERTFREQ, XPRS_INVERTMIN, XPRS_KEEPBASIS, XPRS_KEEPMIPSOL, XPRS_KEEPNROWS, XPRS_LNPBEST, XPRS_LNPITERLIMIT, XPRS_LP_CUTOFF, XPRS_LP_CUTOFF_IN_DUAL, XPRS_LP_INFEAS, XPRS_LP_OPTIMAL, XPRS_LP_UNBOUNDED, XPRS_LP_UNFINISHED, XPRS_LP_UNSOLVED, XPRS_LPITERLIMIT, XPRS_LPLOG, XPRS_LPOBJVAL, XPRS_LPSTATUS, XPRS_MARKOWITZTOL, XPRS_MATRIXTOL, XPRS_MAXCUTTIME, XPRS_MAXIIS, XPRS_MAXMIPSOL, XPRS_MAXNODE, XPRS_MAXPAGELINES, XPRS_MAXTIME, XPRS_MIP_INFEAS, XPRS_MIP_LP_NOT_OPTIMAL, XPRS_MIP_LP_OPTIMAL, XPRS_MIP_NO_SOL_FOUND, XPRS_MIP_NOT_LOADED, XPRS_MIP_OPTIMAL, XPRS_MIP_SOLUTION, XPRS_MIPABSCUTOFF, XPRS_MIPABSSTOP, XPRS_MIPADDCUTOFF, XPRS_MIPENTS, XPRS_MIPINFEAS, XPRS_MIPLOG, XPRS_MIPOBJVAL, XPRS_MIPPRESOLVE, XPRS_MIPRELCUTOFF, XPRS_MIPRELSTOP, XPRS_MIPSOLNODE, XPRS_MIPSOLS, XPRS_MIPSTATUS, XPRS_MIPTARGET, XPRS_MIPTHREADID, XPRS_MIPTHREADS, XPRS_MIPTOL, XPRS_MPSECHO, XPRS_MPSERRIGNORE, XPRS_MPSFORMAT, XPRS_MPSNAMELENGTH, XPRS_NAMELENGTH, XPRS_NODEDEPTH, XPRS_NODES, XPRS_NODESELECTION, XPRS_NUMIIS, XPRS_OBJFIXED, XPRS_OBJRHS, XPRS_OBJSENSE, XPRS_OMNIFORMAT, XPRS_OPTIMALITYTOL, XPRS_OUTPUTLOG, XPRS_OUTPUTTOL, XPRS_PARENTNODE, XPRS_PENALTY, XPRS_PERTURB, XPRS_PIVOTTOL, XPRS_PPFACTOR, XPRS_PRESOLVE, XPRS_PRESOLVEOPS, XPRS_PRESOLVESTATE, XPRS_PRICINGALG, XPRS_PRIMALINFEAS, XPRS_PSEUDOCOST, XPRS_QELEMS, XPRS_REFACTOR, XPRS_REL10STYLE, XPRS_RELPIVOTTOL, XPRS_ROWS, XPRS_SBBEST, XPRS_SBITERLIMIT, XPRS_SBSELECT, XPRS_SBTHREADS, XPRS_SCALING, XPRS_SETMEMBERS, XPRS_SETS, XPRS_SIMPLEXITER, XPRS_SOLUTIONFILE, XPRS_SOSREFTOL, XPRS_SPARECOLS, XPRS_SPAREELEMS, XPRS_SPAREMIPENTS, XPRS_SPAREROWS, XPRS_SUMPRIMALINF, XPRS_TRACE, XPRS_TREECOVERCUTS, XPRS_TREEGOMCUTS, XPRS_VARSELECTION, XPRS_VERSION| Constructor and Description |
|---|
XPRB()
Deprecated.
Since version 46.00, use the optimizer's Java API instead.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
beginLicensing()
Deprecated.
Due to an issue in how this function behaved before Xpress 8.11, it is recommended
that you use XPRS.beginLicensing() instead.
|
void |
close()
Release native resources acquired by BCL.
|
static boolean |
debugGetEnableCallbackStackTrace()
Read the "enableCallbackStackTrace" property.
|
static void |
debugSetEnableCallbackStackTrace(boolean enableCallbackStackTrace)
Enable printing stack traces from exceptions in callbacks.
|
static void |
disableFinalizers()
Prevent BCL finalizers from calling native code.
|
static void |
endLicensing()
Deprecated.
Use XPRS.endLicensing() instead.
|
void |
finalize()
Deprecated.
As of version 8.14, use
close(), or, even better,
use try-with-resources. |
static int |
getTime()
Deprecated.
As of version 8.14, use
System.currentTimeMillis(). |
static java.lang.String |
getVersion()
Get the version number of BCL.
|
static boolean |
isFinalizersDisabled() |
static XPRBlicense |
license()
Generate a license object.
|
static XPRBlicense |
license(java.lang.String path)
Generate a license object.
|
static void |
license(XPRBlicense lic)
Check license.
|
XPRBprob |
newProb(java.lang.String name)
Deprecated.
Since version 46.00, use the optimizer's Java API instead.
|
static void |
setColOrder(int num)
Set a column ordering criterion for matrix generation.
|
static void |
setMsgLevel(int level)
Set the message print level.
|
static void |
setOutputStream()
Set the output stream object.
|
static void |
setOutputStream(java.lang.Object stream)
Set the output stream object.
|
static void |
setRealFmt(java.lang.String fmt)
Set the format for printing real numbers.
|
public static final int PL
public static final int BV
public static final int UI
public static final int PI
public static final int SC
public static final int SI
public static final int PR
public static final int UP
public static final int DN
public static final int PU
public static final int PD
public static final int L
public static final int G
public static final int E
public static final int N
public static final int R
public static final int S1
public static final int S2
public static final int UPACT
public static final int LOACT
public static final int UUP
public static final int UDN
public static final int UCOST
public static final int LCOST
public static final int LP
public static final int MPS
public static final int XPRS_SOL
public static final int XPRS_SOLMIP
public static final int XPRS_PROB
public static final int MAXIM
public static final int MINIM
public static final int GEN
public static final int DIR
public static final int MOD
public static final int SOL
public static final int LP_OPTIMAL
public static final int LP_INFEAS
public static final int LP_CUTOFF
public static final int LP_UNFINISHED
public static final int LP_UNBOUNDED
public static final int LP_CUTOFF_IN_DUAL
public static final int LP_UNSOLVED
public static final int LP_NONCONVEX
public static final int MIP_NOT_LOADED
public static final int MIP_LP_NOT_OPTIMAL
public static final int MIP_LP_OPTIMAL
public static final int MIP_NO_SOL_FOUND
public static final int MIP_SOLUTION
public static final int MIP_INFEAS
public static final int MIP_OPTIMAL
public static final int MIP_UNBOUNDED
public static final int VAR
public static final int CTR
public static final int SOS
public static final int IDX
public static final int DICT_NAMES
public static final int DICT_IDX
public static final double INFINITY
@Deprecated
public XPRB()
throws XPRBlicenseError
XPRS.init.XPRBlicenseError - If no valid license is available.public static XPRBlicense license(java.lang.String path)
path - path to the license file (may be null)license(XPRBlicense lic)public static XPRBlicense license()
license(XPRBlicense lic),
license(null)public static void license(XPRBlicense lic) throws XPRBlicenseError
lic - license object obtained from a call to license(String path)XPRBlicenseError - If the OEM license is not valid.license(String path)public static void setMsgLevel(int level)
XPRBerror.getMessage() and
XPRBerror.getErrorCode() respectively (the same methods apply
to XPRBlicenseError).
XPRB.setMsgLevel(0);
level - message level (= types of messages printed by
BCL). Possible values:
0 disable all output from BCL and Xpress-Optimizer2 print warnings3 print warnings and Optimizer log (default)4 all messages printed public static void setOutputStream(java.lang.Object stream)
XPRB.setOutputStream(System.err);
stream - an object implementing either a 'write' or 'print' methodXPRBprob.setOutputStream(java.lang.Object)public static void setOutputStream()
setOutputStream(System.err)public static void setRealFmt(java.lang.String fmt)
XPRB.setRealFmt("%.10f");
fmt - format string (as used by the C function printf). Possible values include:
"%g" default printing format
(precision: 6 digits; exponential notation if the exponent resulting
from the conversion is less than -4 or greater than or equal to the
precision) "%.numf print real numbers in
the style [-]d.d where the number of digits after the
decimal point is equal to the given precision numpublic static void setColOrder(int num)
XPRB.setColOrder(1);
num - ordering criterion. Possible values:
0 default order1 alphabetical order public static java.lang.String getVersion()
String version;
version = XPRB.getVersion();
System.out.println("BCL version number:" + version);
@Deprecated public XPRBprob newProb(java.lang.String name)
try (XPRB bcl = new XPRB()) {
try (XPRBprob expl2 = bcl.newProb("example2") {
...
}
}
Please see also the XPRBprob(String) constructor that
provides an easier way to create a problem instance in case you only need
one instance.name - problem name, may be nullXPRBprob(String)@Deprecated public static int getTime()
System.currentTimeMillis().
int starttime;
starttime = XPRB.getTime();
System.out.println("Current run time:" +
(XPRB.getTime()-starttime)/1000 + "seconds");
@Deprecated public static boolean beginLicensing()
true if no license has been obtained yet@Deprecated public static void endLicensing()
public void close()
XPRBprob.close()) previously and the program must
not access any BCL objects after this call.
It is recommended to use this function only implicitly via
try-with-resources:
try (XPRB bcl = new XPRB()) { // Initialize BCL
try (XPRBprob expl2 = bcl.newProb("example2")); // Create a problem
...
} // Release problem
} // Finalize BCL (release license)
close in interface java.lang.AutoCloseable@Deprecated public void finalize()
close(), or, even better,
use try-with-resources.finalize in class java.lang.Objectpublic static void disableFinalizers()
AutoCloseable interface or to explicitly close()
these objects when they are no longer needed.public static boolean isFinalizersDisabled()
public static void debugSetEnableCallbackStackTrace(boolean enableCallbackStackTrace)
enableCallbackStackTrace - If set to true the native
code will print a stack trace in case a
callback execution returns with an
exception pending.public static boolean debugGetEnableCallbackStackTrace()