|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectilog.cplex.IloCplexModeler
ilog.cplex.IloCplex
IloCplex
is the class used to create and solve
a large variety of Mathematical Programming models.
Such models include:
This class implements the modeling interface
IloMPModeler
and its base interfaces. See the
ILOG CPLEX User's Manual for more information about modeling.
Models to be solved by
IloCplex
should be built by the
IloMPModeler
(and base interface) methods to construct
objects from the following list:
IloNumVar
and its
extensions IloIntVar
, IloBoolVar
,
and IloSemiContVar
IloRange
with (piecewise) linear or quadratic expressionsIloConstraint
of the form
expr1 relation expr2,
where both expressions are linear or quadratic and may optionally
contain piecewise linear terms.IloLPMatrix
IloObjective
with a (piecewise) linear
and/or quadratic expressionsIloConversion
IloSOS1
or
IloSOS2
IloCplex
stores such models internally in the standard
math programming matrix representation:
Minimize (or Maximize) c'x + x'Qx subject to L <= Ax <= U a_i'x + x'Q_i x <= r_i, for i = 1, ..., q l <= x <= u.
Thus A is the matrix of linear constraint coefficients, and L and U are the vectors of lower and upper bounds on the vector of variables, x. The Q matrix must be positive semi-definite (or negative semi-definite in the maximization case) and represents the quadratic terms of the objective function. The matrices Q_i must be positive semi-definite and represent the quadratic terms of the i-th quadratic constraint, and the a_i are vectors containing the corresponding linear terms. For more about the Q_i, see the chapter about QCP in the ILOG CPLEX User's Manual.
If the model contains integer, Boolean, or semi-continuous variables,
or if the model has special ordered sets (SOSs), the model is referred to
as a mixed integer program (MIP). You can query whether the
active model is a MIP with the method
IloCplex.isMIP
.
A model with quadratic terms in the objective is referred to as
a mixed integer quadratic program (MIQP) if it is also a MIP,
and a quadratic program (QP) otherwise.
You can query whether the active model has a quadratic objective
by calling method
IloCplex.isQO
.
A model with quadratic constraints is referred to as a quadratically
constrained program (MIQCP) if it is also a MIP, and as QCP otherwise.
You can query whether the active model is
quadratically constrained by calling the method
IloCplex.isQC
.
A QCP may or may not have a quadratic objective; that is, a given problem
may be both QP and QCP. Likewise, a MIQCP may
or may not have a quadratic objective; that is, a given problem may be
both MIQP and MIQCP.
If there are no quadratic terms in the objective, no integer constraints, and the problem is not quadratically constrained, it is called a linear program (LP).
If there are no quadratic terms in the objective, and the problem is not quadratically constrained, but there are integer variables, it is called a mixed integer linear program (MILP).
Special ordered sets (SOS) fall outside the conventional representation in terms of A and Q matrices and are stored separately.
Information related to the matrix representation of the model can be queried through these methods:
IloCplex.getNcols
for querying the number of columns of A,IloCplex.getNrows
for querying the number of rows of A; that is,
the number of linear constraints,IloCplex.getNQCs
for querying the number of quadratic constraints,IloCplex.getNNZs
for querying the number of nonzero elements in A, and IloCplex.getNSOSs
for querying the number of SOS
s.Additional information about the active model can be obtained through iterators defined on the different types of modeling objects.
IloCplex
effectively treats all models as MIQCP models.
That is, it allows the most general case, although the solution algorithms
make efficient use of special cases, such as the absence of quadratic
terms in the formulation.
The method
IloCplex.solve
is used to solve the
active model. It begins by solving the root relaxation of the
MIQCP model, where all integrality constraints and SOSs are ignored. If
the model has no integrality constraints or SOSs, then the optimization
is complete once the root relaxation is solved. Otherwise,
IloCplex
uses a branch and cut procedure to reintroduce
the integrality constraints and SOS constraints. See the ILOG CPLEX
User's Manual for more information about branch and cut.
Most users can simply call the method
solve
to solve their models.
However, several parameters are available for users who require more
control.
Perhaps the most important one is IloCplex.IntParam.RootAlg
,
which determines the algorithm used to solve the root relaxation.
Possible settings, as defined in IloCplex.Algorithm
, are:
IloCplex.Algorithm.Auto
IloCplex
automatically selects an algorithm. This is the
default setting.IloCplex.Algorithm.Primal
IloCplex.Algorithm.Dual
IloCplex.Algorithm.Network
IloCplex.Algorithm.Barrier
IloCplex.Algorithm.Sifting
IloCplex
defaults to
the IloCplex.Algorithm.Auto
setting.IloCplex.Algorithm.Concurrent
IloCplex
defaults to the IloCplex.Algorithm.Auto
setting.Numerous other parameters allow you to control algorithmic aspects of
the optimizer. See
IloCplex.IntParam
,
IloCplex.DoubleParam
,
IloCplex.BooleanParam
, and
IloCplex.StringParam
for further information.
Parameters are set with the method
setParam
.
Even higher levels of control can be achieved through the use of goals
(see
IloCplex.Goal
)
or callbacks (see
IloCplex.Callback
and its extensions).
The solve
method returns a Boolean value indicating whether
(true
) or not
(false
) a solution (not necessarily the optimal one) has been
found. Further information about the solution can be queried with the method
getStatus
. The return code of type
IloCplex.Status
indicates whether the
solution is feasible, bounded, or optimal, or if the model has been proven
to be infeasible or unbounded. See
IloCplex.Status
for more information.
The method
IloCplex.getCplexStatus
provides more detailed information about the status of the optimizer after
IloCplex.solve
returns. For example, it can provide
information about why the optimizer terminated prematurely (time limit,
iteration limit, or other limits). The methods
IloCplex.isPrimalFeasible
and
IloCplex.isDualFeasible
determine whether a primal or dual feasible solution has been found
and can be queried.
The most important solution information computed by IloCplex
are usually the solution vector and the objective function value.
The method
IloCplex.getValue
queries the solution vector and
IloCplex.getObjValue
queries the value of the objective function.
Most optimizers also compute additional solution information.
(for example, dual values, reduced costs, simplex bases, etc.) This
additional information can also be queried through various methods of
IloCplex
. If you attempt to retrieve solution information
that is not available from a particular optimizer, IloCplex
will throw an exception.
If you are solving an LP and a basis is available, the solution can be
further analyzed by performing sensitivity analysis. This information tells * you how sensitive the solution is with respect to changes in
variable bounds, constraint bounds, or objective coefficients.
The information is computed and accessed with the methods
IloCplex.getBoundSA
,
IloCplex.getRangeSA
,
IloCplex.getRHSSA
, and
IloCplex.getObjSA
.
An important consideration when you access solution information is the
numeric quality of the solution.
Since IloCplex
performs arithmetic operations using
finite precision, solutions are always subject to numeric errors.
For most problems, numeric errors are well within reasonable tolerances.
However, for numerically difficult models, you
are advised to verify the quality of the solution using the method
IloCplex.getQuality
,
which offers a variety of quality measures.
Nested Class Summary | |
static class |
IloCplex.Algorithm
Enumeration of algorithm types used by IloCplex. |
static class |
IloCplex.BarrierCallback
This is the callback class to use when IloCplex uses the
barrier optimizer. |
static class |
IloCplex.BasisStatus
Enumeration of possible basis status codes. |
static class |
IloCplex.BooleanParam
Symbolic names for parameters in IloCplex that are
Boolean-valued. |
static class |
IloCplex.BranchCallback
Base class for user-written callbacks that control branching. |
static class |
IloCplex.BranchDirection
Enumeration of branch direction values. |
static class |
IloCplex.BranchType
This class identifies the branch type for BranchCallback . |
static class |
IloCplex.Callback
The callback base class. |
static class |
IloCplex.ConflictStatus
The class of status values returned by refineConflict . |
static class |
IloCplex.ContinuousCallback
The callback base class for user-written callbacks invoked at every iteration of the simplex or barrier optimizers when they are solving a continuous model. |
static class |
IloCplex.ControlCallback
Base class for all callback classes querying or taking control of the MIP branch-and-cut search. |
static class |
IloCplex.CplexEndedException
Exceptions of this class are thrown when a method is called for an IloCplex object or any object that has been created with it
after the end method has been called. |
static class |
IloCplex.CplexStatus
Enumeration of possible IloCplex algorithm
status codes. |
static class |
IloCplex.CrossoverCallback
The base class for user-written callbacks during crossover from a barrier solution to a simplex basis. |
static class |
IloCplex.CutCallback
Base class for user-written callbacks adding cuts during search. |
static class |
IloCplex.DeleteMode
Enumeration of possible values for the delete mode of IloCplex , as controlled by the methods
setDeleteMode and getDeleteMode . |
static class |
IloCplex.DisjunctiveCutCallback
This is the callback class to use to monitor the progress of the generation of disjunctive cuts when a mixed integer programming problem (MIP) is being solved. |
static class |
IloCplex.DoubleParam
Symbolic parameter names for double-valued IloCplex parameters. |
static class |
IloCplex.DualPricing
Enumeration of possible values for the dual pricing parameter IloCplex.IntParam.DPriInd . |
static class |
IloCplex.FlowMIRCutCallback
This is the callback class to use to monitor the progress of the generation of flow cover and mixed integer rounding (MIR) cuts when a mixed integer programming problem (MIP) is being solved. |
static class |
IloCplex.FractionalCutCallback
This is the callback class to use to monitor the progress of the generation of fractional cuts when a mixed integer programming problem (MIP) is being solved. |
static class |
IloCplex.Goal
Base class of user-written implementation classes of goals. |
static class |
IloCplex.HeuristicCallback
Base class for user-written callbacks injecting integer-feasible solutions during search. |
static class |
IloCplex.IncumbentCallback
Class of callbacks called when a new incumbent is found. |
static class |
IloCplex.IntegerFeasibilityStatus
Objects of this class indicate the integer feasibility status of a variable. |
static class |
IloCplex.IntParam
Symbolic parameter names for integer-valued IloCplex parameters. |
static class |
IloCplex.LazyConstraintCallback
Callback class for lazy constraints. |
static class |
IloCplex.MIPCallback
The base class for all MIP callbacks. |
static class |
IloCplex.MIPEmphasis
Enumeration of possible values for the IloCplex.IntParam.MIPEmphasis parameter. |
static class |
IloCplex.MultipleUseException
Exceptions of this class are thrown when a modeling object that is used by one instance of IloCplex is attempted to be used
by anotherIloCplex object at the same time. |
static class |
IloCplex.NetworkCallback
This is the callback class to use when IloCplex uses the
network optimizer. |
static class |
IloCplex.NodeCallback
Base class for user-written callbacks selecting the next node to process during the branch-and-cut search. |
static class |
IloCplex.NodeEvaluator
Node evaluators can be used to control the node selection strategy during the branch-and-cut search. |
static class |
IloCplex.NodeId
A class for uniquely identifying a MIP node in a branch-and-cut tree. |
static class |
IloCplex.NodeSelect
Enumeration of possible values for the IloCplex.IntParam.NodeSel parameter. |
static class |
IloCplex.ParameterSet
A parameter set for IloCplex. |
static class |
IloCplex.PresolveCallback
The callback class for user-written callbacks during presolve. |
static class |
IloCplex.PrimalPricing
Enumeration of possible values for the primal pricing parameter IloCplex.IntParam.PPriInd . |
static class |
IloCplex.ProbingCallback
The base class for user-written callbacks that monitor probing progress. |
static class |
IloCplex.Quality
Objects of this class contain information computed to measure the quality of a solution. |
static class |
IloCplex.QualityType
This class contains symbolic names for IloCplex
solution qualities. |
static class |
IloCplex.Relaxation
Enumeration of possible values for the parameter FeasOptMode . |
static class |
IloCplex.SearchLimit
This class allows you to limit the branch-and-cut search within certain subtrees. |
static class |
IloCplex.SimplexCallback
This is the callback class to use when IloCplex uses the
simplex optimizer. |
static class |
IloCplex.SolveCallback
The base class for user-written solve callbacks to control how node relaxations are solved within branch and cut. |
static class |
IloCplex.Status
Enumeration of possible solution status values, as returned by method cplex.getStatus . |
static class |
IloCplex.StringParam
Symbolic parameter names for string-valued IloCplex parameters. |
static class |
IloCplex.UnknownObjectException
Exceptions of this class are thrown if operations are attempted for modeling objects that not part of the active model. |
static class |
IloCplex.UnsupportedObjectException
Exceptions of this class are thrown when a modeling object that cannot be extracted is added to the invoking IloCplex object. |
static class |
IloCplex.UserCutCallback
This is the callback class to use to add user-written cuts during the branch-and-cut search. |
static class |
IloCplex.VariableSelect
Enumeration of possible values for the IloCplex.IntParam.VarSel parameter. |
Nested classes inherited from class ilog.cplex.IloCplexModeler |
IloCplexModeler.Exception |
Constructor Summary | |
IloCplex()
This constructor creates an instance of IloCplex
with an empty active model. |
Method Summary | |
IloConstraint |
addCut(IloConstraint cut)
Adds the constraint cut as a cut to the invoking
IloCplex object. |
IloConstraint[] |
addCuts(IloConstraint[] cut)
Adds the constraints given in cut as cuts to the invoking
IloCplex object. |
IloConstraint[] |
addCuts(IloConstraint[] cut,
int start,
int num)
Adds num constraints given in cut
as cuts to the invoking IloCplex object, starting
with element cut[start] . |
IloConstraint |
addLazyConstraint(IloConstraint cut)
This is an advanced method. |
IloConstraint[] |
addLazyConstraints(IloConstraint[] cut)
This is an advanced method. |
IloConstraint[] |
addLazyConstraints(IloConstraint[] cut,
int start,
int num)
This is an advanced method. |
IloConstraint |
addUserCut(IloConstraint cut)
This is an advanced method. |
IloConstraint[] |
addUserCuts(IloConstraint[] cuts)
This is an advanced method. |
IloConstraint[] |
addUserCuts(IloConstraint[] cuts,
int start,
int num)
This is an advanced method. |
IloCplex.Goal |
and(IloCplex.Goal goal1,
IloCplex.Goal goal2)
Creates and returns an and goal from two arguments. |
IloCplex.Goal |
and(IloCplex.Goal goal1,
IloCplex.Goal goal2,
IloCplex.Goal goal3)
Creates and returns an and goal from three arguments. |
IloCplex.Goal |
and(IloCplex.Goal goal1,
IloCplex.Goal goal2,
IloCplex.Goal goal3,
IloCplex.Goal goal4)
Creates and returns an and goal from four arguments. |
IloCplex.Goal |
and(IloCplex.Goal goal1,
IloCplex.Goal goal2,
IloCplex.Goal goal3,
IloCplex.Goal goal4,
IloCplex.Goal goal5)
Creates and returns an and goal from five arguments. |
IloCplex.Goal |
and(IloCplex.Goal goal1,
IloCplex.Goal goal2,
IloCplex.Goal goal3,
IloCplex.Goal goal4,
IloCplex.Goal goal5,
IloCplex.Goal goal6)
Creates and returns an and goal from six arguments. |
IloCplex.Goal |
apply(IloCplex.Goal goal,
IloCplex.NodeEvaluator evaluator)
Returns a goal that applies the evaluator to
the search tree defined by the goal . |
IloNumVarBound |
bound(IloNumVar var,
IloNumVarBoundType type)
Creates and returns an object of type IloNumVarBound
to represent the specified bound of the variable var . |
IloCplex.Goal |
branchAsCplex()
Creates and returns a goal that branches the same way IloCplex
would in the absence of any goal at the current node. |
void |
clearCallbacks()
Removes all callbacks from the invoking IloCplex object. |
void |
clearCuts()
Deletes all cuts added by the user to the invoking IloCplex object
with the methods addCut and addCuts . |
void |
clearLazyConstraints()
This is an advanced method. |
void |
clearModel()
Removes all modeling objects from the active model. |
void |
clearUserCuts()
This is an advanced method. |
IloCplex.Goal |
constraintGoal(IloConstraint cut)
Creates and returns a constraint goal for the specified constraint cut . |
IloCplex.Goal |
constraintGoal(IloConstraint[] cut)
Creates and returns a constraint goal for the constraints specified in array cut . |
void |
delDirection(IloNumVar var)
Removes any existing branching direction assignments from the variable var . |
void |
delDirections(IloNumVar[] var)
Removes any existing assignments of branching direction from all the variables in array var . |
void |
delDirections(IloNumVar[] var,
int start,
int num)
Removes any existing branching direction assignments from num
consecutive variables in the array var ,
starting with the variable var[start] . |
void |
delPriorities(IloNumVar[] var)
Removes any existing branch priority assignment from the variables in array var . |
void |
delPriorities(IloNumVar[] var,
int start,
int num)
Removes any existing branch priority assignment from num
consecutive variables in the array var ,
starting with the variable var[start] . |
void |
delPriority(IloNumVar var)
Removes any existing branch priority assignment from variable var . |
double |
dualFarkas(IloConstraint[] rng,
double[] y)
This is an advanced method. |
void |
end()
Releases the IloCplex license held by the invoking object,
and all the memory allocated by it. |
IloCplex.Goal |
eqGoal(double lhs,
IloNumExpr expr)
Creates a constraint goal for the constraint lhs == expr . |
IloCplex.Goal |
eqGoal(IloNumExpr expr,
double rhs)
Creates a constraint goal for the constraint expr == rhs . |
IloCplex.Goal |
eqGoal(IloNumExpr expr1,
IloNumExpr expr2)
Creates a constraint goal for the constraint expr1 == expr2 . |
void |
exportModel(java.lang.String name)
Writes the active model to the file indicated by filename . |
IloCplex.Goal |
failGoal()
Creates and returns a goal that always fails. |
boolean |
feasOpt(IloConstraint[] cts,
double[] prefs)
This method computes a minimum-cost relaxation in order to make the active model feasible by relaxing the constraints specified in cts . |
boolean |
feasOpt(IloNumVar[] vars,
double[] varlb,
double[] varub)
This method computes a minimum-cost relaxation in order to make the active model feasible by relaxing the bounds of the variables specified in the array vars . |
boolean |
feasOpt(IloRange[] rngs,
double[] rnglb,
double[] rngub)
This method computes a minimum-cost relaxation in order to make the active model feasible by relaxing the bounds of the range constraints specified in the array rngs . |
boolean |
feasOpt(IloRange[] rngs,
double[] rnglb,
double[] rngub,
IloNumVar[] vars,
double[] varlb,
double[] varub)
This method computes a minimum-cost relaxation in order to make the active model feasible by relaxing the bounds of the variables specified in the array vars and
by relaxing the bounds of the range constraints specified in
the array rngs . |
IloCplex.Goal |
geGoal(double lhs,
IloNumExpr expr)
Creates a constraint goal for the constraint lhs >= expr . |
IloCplex.Goal |
geGoal(IloNumExpr expr,
double rhs)
Creates a constraint goal for the constraint expr >= rhs . |
IloCplex.Goal |
geGoal(IloNumExpr expr1,
IloNumExpr expr2)
Creates a constraint goal for the constraint expr1 >= expr2 . |
int |
getAlgorithm()
Returns the algorithm that was used to generate the current solution. |
double[] |
getAX(IloLPMatrix matrix)
Returns an array containing the row activity values for the constraints corresponding to the rows of an LP matrix. |
double[] |
getAX(IloLPMatrix matrix,
int start,
int num)
Returns row activity values for a range of num consecutive rows, starting from the
index specified by start , of an LP matrix. |
double |
getAX(IloRange rng)
Returns the row activity value for a range constraint. |
double[] |
getAX(IloRange[] rng)
Returns row activity values for an array of range constraints. |
double[] |
getAX(IloRange[] rng,
int start,
int num)
Queries row activity values for a set of range constraints. |
IloCplex.BasisStatus |
getBasisStatus(IloConstraint con)
Returns the basis status for the constraint con . |
IloCplex.BasisStatus |
getBasisStatus(IloNumVar var)
Returns the basis status for variable var . |
IloCplex.BasisStatus[] |
getBasisStatuses(IloConstraint[] con)
Returns basis statuses for the constraints in array con . |
IloCplex.BasisStatus[] |
getBasisStatuses(IloConstraint[] con,
int start,
int num)
Returns basis statuses for num consecutive
constraints, starting from the index specified by
start , in the array of constraints con . |
IloCplex.BasisStatus[] |
getBasisStatuses(IloNumVar[] var)
Returns basis statuses for the variables in array var . |
IloCplex.BasisStatus[] |
getBasisStatuses(IloNumVar[] var,
int start,
int num)
Returns basis statuses for num consecutive variables,
starting from the index specified by start ,
in the array var . |
double |
getBestObjValue()
This method returns a bound on the optimal solution value of the active problem in a MIP. |
void |
getBoundSA(double[] lblower,
double[] lbupper,
double[] ublower,
double[] ubupper,
IloLPMatrix matrix)
Computes and returns sensitivity analysis for the bounds of all variables in the specified LP matrix. |
void |
getBoundSA(double[] lblower,
double[] lbupper,
double[] ublower,
double[] ubupper,
IloLPMatrix matrix,
int start,
int num)
Computes and returns sensitivity analysis for the bounds of num consecutive variables, starting from
the index specified by start ,
in the specified LP matrix. |
void |
getBoundSA(double[] lblower,
double[] lbupper,
double[] ublower,
double[] ubupper,
IloNumVar[] var)
Computes and returns sensitivity analysis for the bounds of the variables in the array vars . |
void |
getBoundSA(double[] lblower,
double[] lbupper,
double[] ublower,
double[] ubupper,
IloNumVar[] var,
int start,
int num)
Computes and returns sensitivity analysis for the bounds of the num consecutive variables, starting from the index
specified by start , in the array var . |
IloCplex.ConflictStatus |
getConflict(IloConstraint ct)
This method accesses a conflict previously computed by the method refineConflict and returns the conflict status for the
constraint ct . |
IloCplex.ConflictStatus[] |
getConflict(IloConstraint[] cts)
This method accesses the constraints of a conflict previously computed by the method refineConflict and returns the status of the constraints
in the array cts . |
IloCplex.ConflictStatus[] |
getConflict(IloConstraint[] cts,
int start,
int num)
This method accesses a conflict (or a subset of a conflict) previously computed by the method refineConflict and returns the conflict status
of num consecutive constraints in the
array cts . |
IloCplex.CplexStatus |
getCplexStatus()
Returns the status of the IloCplex algorithm. |
IloCplex.CplexStatus |
getCplexSubStatus()
Returns the IloCplex.CplexStatus
status of the last node problem solved. |
double |
getCutoff()
Returns the cutoff for the objective value when nodes are being solved during branch-and-cut search. |
boolean |
getDefault(IloCplex.BooleanParam which)
Returns the default value of a Boolean parameter. |
double |
getDefault(IloCplex.DoubleParam which)
Returns the default value of a double parameter. |
int |
getDefault(IloCplex.IntParam which)
Returns the default value of an integer parameter. |
java.lang.String |
getDefault(IloCplex.StringParam which)
Returns the default value of a string parameter. |
IloCplex.DeleteMode |
getDeleteMode()
Returns the current delete mode of the invoking IloCplex
object. |
IloCplex.BranchDirection |
getDirection(IloNumVar var)
Returns the branch direction for a variable. |
IloCplex.BranchDirection[] |
getDirections(IloNumVar[] var)
Returns the branch directions for an array of variables. |
IloCplex.BranchDirection[] |
getDirections(IloNumVar[] var,
int start,
int num)
Returns branch directions for num consecutive
variables, starting from the index specified by var[start] . |
IloCopyable |
getDiverging()
This method returns the diverging variable or constraint, in a case where the primal simplex algorithm has determined the problem to be infeasible. |
double |
getDual(IloRange rng)
Returns the dual solution value for a constraint. |
double[] |
getDuals(IloLPMatrix matrix)
Returns the dual solution vector for the constraints corresponding to the rows of an LP matrix. |
double[] |
getDuals(IloLPMatrix matrix,
int start,
int num)
Returns dual solution values for the constraints corresponding to a range of num rows of an LP matrix. |
double[] |
getDuals(IloRange[] rng)
Returns dual solution values for an array of range constraints. |
double[] |
getDuals(IloRange[] rng,
int start,
int num)
Returns dual solution values for num
consecutive range constraints, starting from
the index specified by start . |
int |
getIncumbentNode()
Returns the node number where the current incumbent was found. |
double[] |
getInfeasibilities(IloConstraint[] con)
Returns infeasibility values for an array of constraints. |
double[] |
getInfeasibilities(IloConstraint[] con,
int start,
int num)
Returns infeasibility values for num consecutive constraints,
starting from the index specified by start , from
an array con of constraints. |
double[] |
getInfeasibilities(IloLPMatrix matrix)
Returns infeasibility values for the constraints corresponding to the rows of an LP matrix. |
double[] |
getInfeasibilities(IloLPMatrix matrix,
int start,
int num)
Returns infeasibility values for the constraints corresponding to a range of num
rows of LP matrix, starting from the row specified by
start . |
double[] |
getInfeasibilities(IloNumVar[] var)
Returns infeasibility values for an array of variables. |
double[] |
getInfeasibilities(IloNumVar[] var,
int start,
int num)
Returns infeasibility values for num consecutive variables,
starting from the index specified by start . |
double |
getInfeasibility(IloConstraint con)
Returns the infeasibility value for a constraint. |
double |
getInfeasibility(IloNumVar ivar)
Returns the infeasibility for a variable. |
double |
getMax(IloCplex.DoubleParam which)
Returns the maximum allowed value for a double parameter. |
int |
getMax(IloCplex.IntParam which)
Returns the maximum allowed value for an integer parameter. |
double |
getMin(IloCplex.DoubleParam which)
Returns the minimum value allowed for a double parameter. |
int |
getMin(IloCplex.IntParam which)
Returns the minimum value allowed for an integer parameter. |
int |
getNbarrierIterations()
Returns the number of barrier iterations from the last solve. |
int |
getNbinVars()
Returns the number of binary (or Boolean) variables in the matrix representation of the active model. |
int |
getNcliques()
Deprecated. No replacement |
int |
getNcols()
Returns the number of columns in the matrix representation of the active model. |
int |
getNcovers()
Deprecated. No replacement |
int |
getNcrossDExch()
Returns the number of dual exchange operations in the crossover of the last solve. |
int |
getNcrossDPush()
Returns the number of dual push operations in the crossover of the last solve. |
int |
getNcrossPExch()
Returns the number of primal exchange operations in the crossover of the last solve. |
int |
getNcrossPPush()
Returns the number of primal push operations in the crossover of the last solve. |
int |
getNdualSuperbasics()
Returns the number of dual superbasic variables in the basis. |
int |
getNintVars()
Returns the number of integer variables in the matrix representation of the active model. |
int |
getNiterations()
Returns the number of iterations from the last solve. |
int |
getNnodes()
Returns the number of branch-and-cut nodes explored in solving the active model. |
int |
getNnodesLeft()
Returns the number of unexplored nodes in the branch-and-cut tree. |
int |
getNNZs()
Returns the number of nonzero elements in the matrix representation of the active model. |
int |
getNphaseOneIterations()
Returns the number of phase I simplex iterations from the last solve. |
int |
getNprimalSuperbasics()
Returns the number of primal superbasic variables in the basis. |
int |
getNQCs()
Returns the number of quadratic constraints in the active model. |
int |
getNrows()
Returns the number of rows of the matrix representation of the active model. |
int |
getNsemiContVars()
Returns the number of semi-continuous variables in the matrix representation of the active model. |
int |
getNsemiIntVars()
Returns the number of semi-integer variables in the matrix representation of the active model. |
int |
getNsiftingIterations()
Returns the number of sifting iterations from the last solve. |
int |
getNsiftingPhaseOneIterations()
Returns the number of sifting phase I iterations from the last solve. |
int |
getNSOS1()
Returns the number of SOS s of type 1 in the active model. |
int |
getNSOS2()
Returns the number of SOS s of type 2 in the active model. |
int |
getNSOSs()
Returns the number of SOS s of both types, 1 and 2 in the
active model. |
void |
getObjSA(double[] lower,
double[] upper,
IloLPMatrix matrix)
Computes and returns sensitivity analysis for objective coefficients of the variables corresponding to the columns of the specified LP matrix. |
void |
getObjSA(double[] lower,
double[] upper,
IloLPMatrix matrix,
int start,
int num)
Computes and returns sensitivity analysis for objective coefficients of the variables corresponding to a range of num consecutive columns of the specified LP matrix. |
void |
getObjSA(double[] lower,
double[] upper,
IloNumVar[] var)
Computes and returns sensitivity analysis for objective coefficients for an array of variables. |
void |
getObjSA(double[] lower,
double[] upper,
IloNumVar[] var,
int start,
int num)
Computes and returns sensitivity analysis for objective coefficients for num consecutive variables, starting
at the index specified by start . |
double |
getObjValue()
Returns the objective value of the current solution. |
boolean |
getParam(IloCplex.BooleanParam which)
Returns the current value of a Boolean parameter. |
double |
getParam(IloCplex.DoubleParam which)
Returns the current value of a double parameter. |
int |
getParam(IloCplex.IntParam which)
Returns the current value of an integer parameter. |
java.lang.String |
getParam(IloCplex.StringParam which)
Returns the current value of a string parameter. |
IloCplex.ParameterSet |
getParameterSet()
Returns a parameter set corresponding to the present parameter state. |
int[] |
getPriorities(IloNumVar[] var)
Returns branch priorities for an array of variables. |
int[] |
getPriorities(IloNumVar[] var,
int start,
int num)
Returns branch priorities for num consecutive variables,
starting from the index specified by start . |
int |
getPriority(IloNumVar var)
Returns the branch priority for a variable. |
IloCplex.Quality |
getQuality(IloCplex.QualityType which)
Returns an instance of IloCplex.Quality that contains
the requested quality measure. |
void |
getRangeSA(double[] lblower,
double[] lbupper,
double[] ublower,
double[] ubupper,
IloLPMatrix matrix)
Computes and returns sensitivity analysis for the constraints corresponding to the rows of the LP matrix matrix . |
void |
getRangeSA(double[] lblower,
double[] lbupper,
double[] ublower,
double[] ubupper,
IloLPMatrix matrix,
int start,
int num)
Computes and returns sensitivity analysis for the constraints corresponding to num rows of the LP matrix
matrix starting with row start . |
void |
getRangeSA(double[] lblower,
double[] lbupper,
double[] ublower,
double[] ubupper,
IloRange[] rng)
Computes and returns sensitivity analysis for the bounds of the range constraints in the array rng . |
void |
getRangeSA(double[] lblower,
double[] lbupper,
double[] ublower,
double[] ubupper,
IloRange[] rng,
int start,
int num)
Computes and returns sensitivity analysis for the bounds of num consecutive range constraints in the array
rng , starting with the index specified by
rng[start] . |
IloLinearNumExpr |
getRay()
This is an advanced method. |
double |
getReducedCost(IloNumVar ivar)
Returns the reduced cost for a variable. |
double[] |
getReducedCosts(IloLPMatrix matrix)
Returns reduced costs for the variables corresponding to the columns of an LP matrix. |
double[] |
getReducedCosts(IloLPMatrix matrix,
int start,
int num)
Returns reduced costs for the variables corresponding to a range of num
columns of LP matrix, starting from the column specified by
start . |
double[] |
getReducedCosts(IloNumVar[] var)
Returns reduced costs for an array of variables. |
double[] |
getReducedCosts(IloNumVar[] var,
int start,
int num)
Returns reduced costs for num consecutive variables,
starting from the index specified by start . |
void |
getRHSSA(double[] lower,
double[] upper,
IloLPMatrix matrix)
Computes and returns sensitivity analysis for righthand side (RHS) values of the constraints corresponding to the rows of an LP matrix. |
void |
getRHSSA(double[] lower,
double[] upper,
IloLPMatrix matrix,
int start,
int num)
Computes and returns sensitivity analysis for the righthand side (RHS) values of num
constraints, corresponding to a range of rows of an LP matrix,
starting from the index specified by start . |
void |
getRHSSA(double[] lower,
double[] upper,
IloRange[] rng)
Computes and returns sensitivity analysis for the righthand side (RHS) values of a range of constraints. |
void |
getRHSSA(double[] lower,
double[] upper,
IloRange[] rng,
int start,
int num)
Computes and returns sensitivity analysis for the righthand side (RHS) values of num
constraints, starting from the index specified by start . |
double |
getSlack(IloRange rng)
Returns the slack value for a range constraint. |
double[] |
getSlacks(IloLPMatrix matrix)
Returns slack values for the constraints corresponding to the rows of an LP matrix. |
double[] |
getSlacks(IloLPMatrix matrix,
int start,
int num)
Returns slack values for a range of num consecutive rows,
starting from the index specified by start , of an LP matrix. |
double[] |
getSlacks(IloRange[] rng)
Returns slack values for an array of range constraints. |
double[] |
getSlacks(IloRange[] rng,
int start,
int num)
Returns slack values for num consecutive constraints,
starting from the index specified by start , from
an array rng . |
IloCplex.Status |
getStatus()
Returns the solution status of the active model. |
int |
getSubAlgorithm()
Returns the type of the algorithm that was used to generate the solution of the last branch-and-cut node solved during a MIP solve terminated because of an error during mixed integer optimization. |
double |
getValue(IloNumExpr expr)
Returns the value that expr takes for the current solution. |
double |
getValue(IloNumVar var)
Returns the solution value for a variable. |
double[] |
getValues(IloLPMatrix matrix)
Returns the solution vector for the columns of an LP matrix. |
double[] |
getValues(IloLPMatrix matrix,
int start,
int num)
Returns the solution vector for a range of num
columns of an LP matrix, starting at the index specified by
start . |
double[] |
getValues(IloNumVar[] var)
Returns solution values for an array of variables. |
double[] |
getValues(IloNumVar[] var,
int start,
int num)
Returns solution values for a set of variables. |
java.lang.String |
getVersion()
Returns a string that indicates the version of CPLEX. |
IloCplex.Goal |
globalCutGoal(IloConstraint cut)
Creates and returns a global cut goal for the constraint cut . |
IloCplex.Goal |
globalCutGoal(IloConstraint[] cut)
Creates and returns a global cut goal for the constraints specified in array cut . |
void |
importModel(java.lang.String name)
Reads a model from the file indicated by name
into the active model. |
boolean |
isDualFeasible()
Returns true if a dual feasible solution is available. |
boolean |
isMIP()
Returns true if the active model is a MIP. |
boolean |
isPrimalFeasible()
Returns true if a primal feasible solution is available. |
boolean |
isQC()
Returns true if the active model has quadratic
constraints. |
boolean |
isQO()
Returns true if the active model has a quadratic objective
function. |
IloCplex.Goal |
leGoal(double lhs,
IloNumExpr expr)
Creates a constraint goal for the constraint lhs >= expr . |
IloCplex.Goal |
leGoal(IloNumExpr expr,
double rhs)
Creates a constraint goal for the constraint expr <= rhs . |
IloCplex.Goal |
leGoal(IloNumExpr expr1,
IloNumExpr expr2)
Creates a constraint goal for the constraint expr1 <= expr2 . |
IloCplex.Goal |
limitSearch(IloCplex.Goal goal,
IloCplex.SearchLimit limit)
This function creates and returns a goal that limits the exploration of the search tree defined by goal , as specified by
limit . |
IloNumVarBound |
lowerBound(IloNumVar var)
Creates and returns an object of type IloNumVarBound
to represent the lower bound of the variable var . |
IloCplex.Goal |
or(IloCplex.Goal goal1,
IloCplex.Goal goal2)
Creates and returns an or goal from two arguments. |
IloCplex.Goal |
or(IloCplex.Goal goal1,
IloCplex.Goal goal2,
IloCplex.Goal goal3)
Creates and returns an or goal from three arguments. |
IloCplex.Goal |
or(IloCplex.Goal goal1,
IloCplex.Goal goal2,
IloCplex.Goal goal3,
IloCplex.Goal goal4)
Creates and returns an or goal from four arguments. |
IloCplex.Goal |
or(IloCplex.Goal goal1,
IloCplex.Goal goal2,
IloCplex.Goal goal3,
IloCplex.Goal goal4,
IloCplex.Goal goal5)
Creates and returns an or goal from five arguments. |
IloCplex.Goal |
or(IloCplex.Goal goal1,
IloCplex.Goal goal2,
IloCplex.Goal goal3,
IloCplex.Goal goal4,
IloCplex.Goal goal5,
IloCplex.Goal goal6)
Creates and returns an or goal from six arguments. |
java.io.PrintStream |
output()
Returns the output stream of the invoking IloCplex object. |
static void |
putenv(java.lang.String envstr)
Sets the ILOG_LICENSE_FILE environment variable
used by CPLEX. |
void |
qpIndefCertificate(IloNumVar[] var,
double[] x)
Returns a vector proving that the Q matrix of QP is not positive semi-definite. |
void |
readBasis(java.lang.String name)
Reads a simplex basis from the BAS file indicated by name ,
and copies that basis into the invoking object. |
void |
readMIPStart(java.lang.String name)
Reads the SOL file denoted by name and
copies the MIP start information into the invoking object. |
void |
readOrder(java.lang.String name)
Reads the ORD file indicated by name
and copies the priority order information
into the invoking CPLEX problem object. |
void |
readParam(java.lang.String name)
Reads parameters and their settings from the file indicated by name and applies them to the invoking object. |
void |
readSolution(java.lang.String name)
Reads a solution from the SOL file denoted by name
and copies this information into the invoking object. |
void |
readVectors(java.lang.String name)
Deprecated. |
boolean |
refineConflict(IloConstraint[] cons,
double[] prefs)
Refines a conflict from an array of constraints. |
boolean |
refineConflict(IloConstraint[] cons,
double[] prefs,
int start,
int num)
Refines a conflict consisting of a subset of constraints from an array. |
static void |
registerLicense(java.lang.String ilm_CPLEX_license,
int ilm_CPLEX_license_signature)
Passes memory-based information to the ILOG License Manager. |
void |
setBasisStatuses(IloNumVar[] var,
IloCplex.BasisStatus[] cstat,
IloRange[] con,
IloCplex.BasisStatus[] rstat)
Sets basis statuses for variables and constraints. |
void |
setBasisStatuses(IloNumVar[] var,
IloCplex.BasisStatus[] cstat,
int cstart,
int cnum,
IloConstraint[] con,
IloCplex.BasisStatus[] rstat,
int rstart,
int rnum)
Sets basis statuses for cnum consecutive
variables, starting from the index specified by var[start] ,
and rnum consecutive constraints, starting from the
index specified by con[start] . |
void |
setDefaults()
Resets all parameters to their default values. |
void |
setDeleteMode(IloCplex.DeleteMode mode)
Sets the delete mode. |
void |
setDirection(IloNumVar var,
IloCplex.BranchDirection dir)
Sets the branching direction for a variable. |
void |
setDirections(IloNumVar[] var,
IloCplex.BranchDirection[] brdir)
Sets branching directions for an array of variables. |
void |
setDirections(IloNumVar[] var,
IloCplex.BranchDirection[] brdir,
int start,
int num)
Sets branching directions for num consecutive
variables, starting from the index specified by start . |
void |
setModel(IloModel model)
Sets model as the active model. |
void |
setOut(java.io.OutputStream s)
Sets the default output stream of the invoking IloCplex
object. |
void |
setParam(IloCplex.BooleanParam which,
boolean val)
Sets a Boolean parameter to value val . |
void |
setParam(IloCplex.DoubleParam which,
double val)
Sets a double parameter to value val . |
void |
setParam(IloCplex.IntParam which,
int val)
Sets an integer parameter to value val . |
void |
setParam(IloCplex.StringParam which,
java.lang.String val)
Sets a string parameter to value val . |
void |
setParameterSet(IloCplex.ParameterSet set)
Sets the parameter state using a parameter set. |
void |
setPriorities(IloNumVar[] var,
int[] pri)
Sets branch priorities for an array of variables. |
void |
setPriorities(IloNumVar[] var,
int[] pri,
int start,
int num)
Sets branch priorities for num consecutive variables,
starting from the index specified by start . |
void |
setPriority(IloNumVar var,
int pri)
Sets the branch priority for the variable var . |
void |
setVectors(double[] x,
double[] dj,
IloNumVar[] var,
double[] slack,
double[] pi,
IloRange[] rng)
Specifies a starting point for the next invocation of the method solve . |
void |
setVectors(double[] x,
double[] dj,
IloNumVar[] var,
int vstart,
int vnum,
double[] slack,
double[] pi,
IloRange[] rng,
int rstart,
int rnum)
Specifies a partial starting point for the next invocation of the method solve . |
void |
setWarning(java.io.OutputStream s)
Sets the warning stream of the invoking IloCplex object. |
IloCplex.Goal |
solutionGoal(IloNumVar[] vars,
double[] vals)
Creates and returns a solution goal. |
boolean |
solve()
Solves the active model. |
boolean |
solve(IloCplex.Goal goal)
This method solves the active MIP model using the search strategy specified by goal . |
boolean |
solveFixed()
Solves the fixed active model. |
IloNumVarBound |
upperBound(IloNumVar var)
Creates and returns an object of type IloNumVarBound
to represent the upper bound of variable var . |
void |
use(IloCplex.Callback cb)
Installs a user-written callback. |
java.io.PrintStream |
warning()
Returns the warning output stream of the invoking IloCplex
object. |
void |
writeBasis(java.lang.String name)
Writes the current simplex basis to the file indicated by name . |
void |
writeConflict(java.lang.String name)
Writes a conflict file with the indicated name . |
void |
writeMIPStart(java.lang.String name)
Writes a starting solution for a MIP in SOL format to the file denoted by name . |
void |
writeOrder(java.lang.String name)
Writes a priority order file with the indicated name . |
void |
writeParam(java.lang.String name)
Writes the parameter name and its current setting into the file indicated by name for all the
CPLEX parameters that are not currently
set at their default. |
void |
writeSolution(java.lang.String name)
Writes solution information from an optimization in SOL format to the file indicated by name . |
void |
writeTextSolution(java.lang.String name)
Deprecated. |
void |
writeVectors(java.lang.String name)
Deprecated. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public IloCplex() throws IloException
IloCplex
with an empty active model.
Method Detail |
public void setModel(IloModel model) throws IloException
model
as the active model.
setModel
in interface IloMPModeler
setModel
in class IloCplexModeler
IloException
public IloConstraint addUserCut(IloConstraint cut) throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method adds cut
as a user cut to the
invoking IloCplex
object. Unlike regular constraints that are added to the model, user
cuts are by default left out of the optimization until they are violated.
It is only after a node solution violates a user cut that the cut is added
to the relaxation and will be used from then on. Unlike lazy
constraints, user cuts must not reduce the feasible region of the
problem; they can only strengthen the relaxation; otherwise,
incorrect solutions can result.
When columns are deleted from the active model, all user cuts are
deleted as well and need to be added again if they should be considered.
Use clearUserCuts
to remove all user cuts from
the invoking IloCplex
object.
If you do not know what type your cut is, use the method
addCut
rather than this method.
cut
- The user cut to be added. The cut must be linear.
IloException
public IloConstraint[] addUserCuts(IloConstraint[] cuts) throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method adds the constraints in cuts
as user cuts to the
the invoking IloCplex
object. The constraint
cut
is copied into the user cut pool; the object
cut
itself is not part of the pool, so changes
to it after it has been copied into the user cut pool will not
affect the user cut pool.
Unlike regular constraints that are added to the model, user cuts are by default left out of the optimization until they are violated. It is only after a node solution violates a user cut that the cut is added to the relaxation and will be used from then on. Unlike lazy constraints, user cuts must not reduce the feasible region of the problem; they can only strengthen the relaxation; otherwise, incorrect solutions can result.
When columns are deleted from the active model, all user cuts are
deleted as well and need to be added again if they should be considered.
Otherwise, use clearUserCuts
to remove all user cuts from
the invoking IloCplex
object.
If you do not know what type your cuts are, use the method
addCuts
rather than this method.
cuts
- An array of user cuts to be added. All cuts must be
linear.
IloException
public IloConstraint[] addUserCuts(IloConstraint[] cuts, int start, int num) throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method adds the constraints in cuts
as user cuts to the
the invoking IloCplex
object. The constraints in the array
cuts
are copied into the user cut pool; the objects in the
array cut
themselves are not part of the pool, so changes
to them after they have been copied into the user cut pool will not
affect the user cut pool.
Unlike regular constraints that are added to the model, user cuts are by default left out of the optimization until they are violated. It is only after a node solution violates a user cut that the cut is added to the relaxation and will be used from then on. Unlike lazy constraints, user cuts must not reduce the feasible region of the problem; they can only strengthen the relaxation; otherwise, incorrect solutions can result.
When columns are deleted from the active model, all user cuts are
deleted as well and need to be added again if they should be considered.
Otherwise, use clearUserCuts
to remove all user cuts from
the invoking IloCplex
object.
cuts
- An array of user cuts to be added. All cuts must be
linear.start
- The first element in cuts
to be added as
a user cut.num
- The number of consecutive elements
in cuts
to be added as a user cut.
cuts
containing the user cuts
that have been added.
IloException
public void clearUserCuts() throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method deletes user cuts. It
deletes all user cuts that have previously been
added to the invoking IloCplex
object with the methods
addUserCut
or addUserCuts
.
IloException
public IloConstraint addLazyConstraint(IloConstraint cut) throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method adds cut
as a lazy constraint to the invoking
IloCplex
object. The constraint cut
is copied
into the lazy constraint pool; the cut
itself is not part
of the pool, so changes to cut
after it has been copied into
the lazy constraint pool will not affect the lazy constraint pool.
Lazy constraints added with addLazyConstraint
are typically
constraints of the model that are not expected to be violated when left
out. The idea is that the LPs that are solved when
the MIP is being solved
can be kept smaller when these constraints are not included.
IloCplex
will, however, include a lazy constraint in the LP
as soon as the constraint is violated. In other words, the solution
computed by IloCplex
makes sure that all the lazy constraints
that have been added are satisfied.
By contrast, if the constraint does not change the feasible region of the
active model but only strengthens the formulation, it is referred to
as a user cut. User cuts can be added to
IloCplex
by addLazyConstraint
, but it is
generally preferable to do so with addUserCuts
. It is an
error, however, to add lazy constraints by means
of addUserCuts
.
When columns are deleted from the active model, all lazy constraints
are deleted as well and need to be recopied into the lazy constraint
pool. Otherwise, use clearLazyConstraints
to clear the
list of lazy constraints.
cut
- The constraint to be added as a lazy constraint. The
constraint must be linear.
IloException
public IloConstraint[] addLazyConstraints(IloConstraint[] cut) throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method adds the constraints given in cut
to the list of lazy constraints.
The constraints are copied into the lazy constraint pool; the constraints
themselves do not become part of the pool, so changes to them
after they have been copied into the lazy constraint pool will not affect
the lazy constraint pool.
Lazy constraints added with addLazyConstraints
are typically
constraints of the model that are not expected to be violated when left
out. The idea is that the LPs that are solved when
the MIP is being solved
can be kept smaller when these constraints are not included.
IloCplex
will, however, include a lazy constraint in the LP
as soon as the constraint is violated. In other words, the solution
computed by IloCplex
makes sure that all the lazy constraints
that have been added are satisfied.
By contrast, if the constraint does not change the feasible region of the
active model but only strengthens the formulation, it is referred to
as a user cut. User cuts can be added to
IloCplex
by addLazyConstraint
, but it is
generally preferable to do so with addUserCuts
. It is an
error, however, to add lazy constraints by means of
addUserCuts
.
When columns are deleted from the active model, all lazy constraints
are deleted as well and need to be recopied into the lazy constraint
pool. Otherwise, use clearLazyConstraints
to clear the
list of lazy constraints.
cut
- The array of constraints to be added as lazy constraints.
All constraints must be linear.
IloException
public IloConstraint[] addLazyConstraints(IloConstraint[] cut, int start, int num) throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method copies constraints into the lazy constraints pool.
num
constraints listed in array cut
are copied
into the lazy constraint pool, starting
with element start
.
The constraints themselves do not become part of the pool, so changes to
them after they have been copied into the lazy constraint pool will not
affect the lazy constraint pool.
Lazy constraints added with addLazyConstraints
are typically
constraints of the model that are not expected to be violated when left
out. The idea is that the LPs that are solved when
the MIP is being solved
can be kept smaller when these constraints are not included.
IloCplex
will, however, include a lazy constraint in the LP
as soon as the constraint is violated. In other words, the solution
computed by IloCplex
makes sure that all the lazy constraints
that have been added are satisfied.
By contrast, if the constraint does not change the feasible region of the
active model but only strengthens the formulation, it is referred to
as a user cut. User cuts can be added to
IloCplex
by addLazyConstraint
, but it is
generally preferable to do so with addUserCuts
. It is an
error, however, to add lazy constraints by means of
addUserCuts
.
When columns are deleted from the active model, all lazy constraints
are deleted as well and need to be recopied into the lazy constraint
pool. Otherwise, use clearLazyConstraints
to clear the
list of lazy constraints.
cut
- An array of constraints to be added as lazy
constraints. All constraints must be linear.start
- The index of the first element in cut
to
be added as a lazy constraint.num
- The number of consecutive constraints
in cut
to
be added as lazy constraints.
cut
.
IloException
public void clearLazyConstraints() throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method removes all lazy constraints
that have been added to the invoking
IloCplex
object with the methods
addLazyConstraint
and addLazyConstraints
.
IloException
public IloConstraint addCut(IloConstraint cut) throws IloException
cut
as a cut to the invoking
IloCplex
object.
The added cut does not become part of the model;
it is only copied when the method addCut
is invoked. Thus,
cut
may be deleted or modified after addCut
has
been called, and the change will not affect the invoking
IloCplex
object. You can and probably should call
cut.end
after addCut(cut)
. Unlike constraints
that are part of the model, this call of cut.end
will not remove the cut from the IloCplex
object.
Cuts are not part of the root problem; they are considered on an
as-needed basis. A solution computed by IloCplex
is
guaranteed to satisfy all cuts.
When columns are deleted from the active model, all cuts are
deleted as well and need to be added again if they should be considered.
Otherwise, use clearCuts
to clear all cuts that have been
added.
cut
- The constraint to add as a cut. It must be linear.
IloException
public IloConstraint[] addCuts(IloConstraint[] cut) throws IloException
cut
as cuts to the invoking
IloCplex
object.
The cuts do not become part of the model;
they are only copied when the method addCuts
is invoked. Thus,
the constraints may be deleted or modified after addCuts
has been called, and the change will not affect the invoking
IloCplex
object.
Cuts are not part of the root problem; they are considered on an
as-needed basis. A solution computed by IloCplex
is
guaranteed to satisfy all cuts.
When columns are deleted from the active model, all cuts are
deleted as well and need to be added again if they should be considered.
Otherwise, use clearCuts
to clear all cuts that have been
added.
cut
- An array of constraints to be added as a cut.
IloException
public IloConstraint[] addCuts(IloConstraint[] cut, int start, int num) throws IloException
num
constraints given in cut
as cuts to the invoking IloCplex
object, starting
with element cut[start]
. The cuts do not become part of the
model; they are only copied when the method addCuts
is invoked.
Thus, the constraints may be deleted or modified after
addCuts
has been called, and the change will not affect the
invoking IloCplex
object.
Cuts are not part of the root problem; they are considered on an
as-needed basis. A solution computed by IloCplex
is
guaranteed to satisfy all cuts.
When columns are deleted from the active model, all cuts are
deleted as well and need to be added again if they should be considered.
Otherwise, use clearCuts
to clear all cuts that have been
added.
cut
- An array of constraints to be added as cuts.
All constraints must be linear.start
- The index of the first constraint in cut
that is to be added as a cut.num
- The number of consecutive constraints in
cut
that are to be added as cuts.
cut
.
IloException
public void clearCuts() throws IloException
IloCplex
object
with the methods addCut
and addCuts
.
IloException
public void exportModel(java.lang.String name) throws IloException
filename
.
The file format is determined by the extension of the filename. The
following extensions are recognized on most platforms:
getName
returns null
for that
variable or range), IloCplex
uses a default name when
writing the model (or in the optimization log). Default names are of the
form IloXj for variables and IloCi, where i
and j are internal indices of IloCplex
.
name
- The name of the file to which the model is written.
The extension of the filename determines the format in
which to write the model file.
IloException
public void importModel(java.lang.String name) throws IloException
name
into the active model.
The format of the file is indicated by the extension of the
filename. The following extensions are recognized on most platforms:
IloObjective
object and one
IloLPMatrix
object are always added to the
active model. The IloLPMatrix
object will
contain all the constraints of the imported model. IloSOS1
and IloSOS2
objects are added as needed.
name
- The name of the file from which the model is read.
The extension of the filename determines the format in
which to read the model file.
IloException
public void clearModel() throws IloException
IloException
public int getNcols()
public int getNrows()
public int getNQCs()
public int getNSOS1()
SOS
s of type 1 in the active model.
SOS
s of type 1 in the active model.public int getNSOS2()
SOS
s of type 2 in the active model.
SOS
s of type 2 in the active model.public int getNSOSs()
SOS
s of both types, 1 and 2 in the
active model.
SOS
s in the active model.public int getNNZs()
public int getNintVars()
public int getNbinVars()
public int getNsemiContVars()
public int getNsemiIntVars()
public boolean isMIP()
true
if the active model is a MIP.
true
if the active model is a MIP.public boolean isQO()
true
if the active model has a quadratic objective
function.
true
if the active model has a quadratic objective
function.public boolean isQC()
true
if the active model has quadratic
constraints. See the topic QCP in the ILOG CPLEX User's
Manual for more detail about the characteristics of such
constraints with respect to their concavity and positive
semi-definiteness (PSD).
true
if the active model has quadratic
constraints.public IloCplex.Status getStatus() throws IloException
See also the topic Interpreting Solution Quality in the ILOG CPLEX User's Manual for more information about a status associated with infeasibility or unboundedness.
IloException
IloCplex.Status
public boolean isPrimalFeasible() throws IloException
true
if a primal feasible solution is available.
If false
is returned the solution may still be primal
feasible, but the algorithm has not determined the feasibility before
it terminated.
IloException
public boolean isDualFeasible() throws IloException
true
if a dual feasible solution is available. If
false
is returned the solution may still be dual feasible,
but the algorithm has not determined the feasibility before it
terminated.
IloException
public void setParam(IloCplex.IntParam which, int val) throws IloException
val
.
which
- The identifier of the parameter to set.val
- The new value for the integer parameter.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public int getParam(IloCplex.IntParam which) throws IloException
which
- The identifier of the integer parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public int getMin(IloCplex.IntParam which) throws IloException
which
- The identifier of the integer parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public int getMax(IloCplex.IntParam which) throws IloException
which
- The identifier of the integer parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public int getDefault(IloCplex.IntParam which) throws IloException
which
- The identifier of the integer parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public void setParam(IloCplex.BooleanParam which, boolean val) throws IloException
val
.
which
- The identifier of the Boolean parameter to be set.val
- The new value for the Boolean parameter.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public boolean getParam(IloCplex.BooleanParam which) throws IloException
which
- The identifier of the Boolean parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public boolean getDefault(IloCplex.BooleanParam which) throws IloException
which
- The identifier of the Boolean parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public void setParam(IloCplex.DoubleParam which, double val) throws IloException
val
.
which
- The identifier of the double parameter to be set.val
- The new value for the double parameter
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getParam(IloCplex.DoubleParam which) throws IloException
which
- The identifier of the double parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getMin(IloCplex.DoubleParam which) throws IloException
which
- The identifier of the double parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getMax(IloCplex.DoubleParam which) throws IloException
which
- The identifier of the double parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getDefault(IloCplex.DoubleParam which) throws IloException
which
- The identifier of the double parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public void setParam(IloCplex.StringParam which, java.lang.String val) throws IloException
val
.
which
- The identifier of the string parameter to set.val
- The new value for the string parameter.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public java.lang.String getParam(IloCplex.StringParam which) throws IloException
which
- The identifier of the string parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public java.lang.String getDefault(IloCplex.StringParam which) throws IloException
which
- The identifier of the string parameter to be queried.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public void setDefaults() throws IloException
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public IloCplex.ParameterSet getParameterSet() throws IloException
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public void setParameterSet(IloCplex.ParameterSet set) throws IloException
set
- The parameter set.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public java.lang.String getVersion() throws IloException
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public void setDeleteMode(IloCplex.DeleteMode mode)
IloCplex
object is set to
mode
.
mode
- The delete mode to be set,
IloCplex.DeleteMode.FixBasis
or
IloCplex.DeleteMode.LeaveBasis
.public IloCplex.DeleteMode getDeleteMode()
IloCplex
object.
IloCplex
object.public IloCplex.CplexStatus getCplexStatus() throws IloException
IloCplex
algorithm.
The status
of IloCplex.CplexStatus
provides
more information about the status of the optimizer.
See also the topic Interpreting Solution Quality in the ILOG CPLEX User's Manual for more information about a status associated with infeasibility or unboundedness.
IloCplex.CplexStatus
status.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public IloCplex.CplexStatus getCplexSubStatus() throws IloException
IloCplex.CplexStatus
status of the last node problem solved. This method is often useful
when the preceding invocation of
IloCplex.solve
terminates with an error during the solution of a MIP problem.
IloCplex.CplexStatus
status of the last node
that has been solved during the solution of a MIP.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public int getAlgorithm() throws IloException
IloException
public int getSubAlgorithm() throws IloException
IloException
public double getObjValue() throws IloException
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getBestObjValue() throws IloException
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getCutoff() throws IloException
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getValues(IloLPMatrix matrix) throws IloCplex.UnknownObjectException, IloException
matrix
- The LP matrix for which to query the solution values.
This LP matrix must be in the active model.
x
is the array returned by this method,
x[j]
will be the solution value for the variable
corresponding to column j
of
matrix
.
IloCplex.UnknownObjectException
- matrix
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getValues(IloLPMatrix matrix, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
columns of an LP matrix, starting at the index specified by
start
.
matrix
- The LP matrix for which to query the solution values.
This LP matrix must be in the active model.start
- The index of the first column whose solution value
is being queried.num
- The number of consecutive columns for which
to query the solution value.
x
is the array returned by this method,
x[j]
will be the solution value for the variable
corresponding to column j+start
of
matrix
.
IloCplex.UnknownObjectException
- matrix
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getValue(IloNumVar var) throws IloCplex.UnknownObjectException, IloException
var
- The variable whose value is being queried.
This variable must be in the active model.
var
.
IloCplex.UnknownObjectException
- var
is not in
the active model
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getValues(IloNumVar[] var) throws IloCplex.UnknownObjectException, IloException
var
- An array of
variables whose solution values are being queried.
All variables must be in the active model.
var
.
If x
is the array returned by this method,
x[j]
will be the solution value for the variable
var[j]
.
IloCplex.UnknownObjectException
- One of the variables
specified in var
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getValues(IloNumVar[] var, int start, int num) throws IloCplex.UnknownObjectException, IloException
var
- An array containing the variables whose solution values
are being queried. These variables must be in the
active model.start
- The index of the first variable in var
for
which to query the solution value.num
- The number of consecutive variables in
var
for which
to query the solution value.
x
is the array returned by this method,
x[j]
will be the solution value for the
variable var[j+start]
.
IloCplex.UnknownObjectException
- One of the variables
specified in var
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getReducedCosts(IloLPMatrix matrix) throws IloCplex.UnknownObjectException, IloException
matrix
- The LP matrix for which to query the reduced costs.
This LP matrix must be in the active model.
matrix
.
If dj
is the array returned by this method,
dj[j]
will be the reduced cost value for
the variable corresponding to column j
of
matrix
.
IloCplex.UnknownObjectException
- The LP matrix matrix
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getReducedCosts(IloLPMatrix matrix, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
columns of LP matrix, starting from the column specified by
start
.
matrix
- The LP matrix for which to query the reduced costs.
This LP matrix must be in the active model.start
- The index of the first column in matrix
for which to query the reduced cost.num
- The number of consecutive columns for which to query the
reduced cost.
dj
is the array returned by this method,
dj[j]
will be the reduced cost
for the variable corresponding to column j+start
of matrix
.
IloCplex.UnknownObjectException
- The LP matrix matrix
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getReducedCost(IloNumVar ivar) throws IloCplex.UnknownObjectException, IloException
ivar
- The variable whose reduced cost is being queried.
This variable must be in the active model.
var
.
IloCplex.UnknownObjectException
- The variable var
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getInfeasibility(IloNumVar ivar) throws IloCplex.UnknownObjectException, IloException
ivar
- The variable whose infeasibility is being queried.
This variable must be in the active model.
var
. The
infeasibility value returned is 0 (zero)
if the variable bounds
are satisfied. If the infeasibility value is negative, it
indicates the amount by which the lower bound of the variable
must be changed; if it is positive, it indicates the amount
by which the upper bound of the variable must be changed.
IloCplex.UnknownObjectException
- The variable var
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getReducedCosts(IloNumVar[] var) throws IloCplex.UnknownObjectException, IloException
var
- The array of variables whose reduced costs are being queried.
These variables must be in the active model.
var
. If dj
is the array returned
by this method, dj[j]
will be the reduced cost
for variable var[j]
.
IloCplex.UnknownObjectException
- One of the variables specified
in var
is not in the
active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getInfeasibilities(IloNumVar[] var) throws IloCplex.UnknownObjectException, IloException
var
- The array of variables whose infeasibilities are being queried.
These variables must be in the active model.
var
. If infeas
is the array
returned by this method, infeas[j]
will be the
infeasibility value for variable var[j]
. The
infeasibility value returned is 0 (zero)
if the variable bounds
are satisfied. If the infeasibility value is negative, it
indicates the amount by which the lower bound of the variable
must be changed; if it is positive, it indicates the amount
by which the upper bound of the variable must be changed.
IloCplex.UnknownObjectException
- One of the variables specified
in var
is not in the
active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getReducedCosts(IloNumVar[] var, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
consecutive variables,
starting from the index specified by start
.
var
- An array of variables whose reduced costs
are being queried. These variables must be in the
active model.start
- The index of the first variable in var
for
which to query the reduced cost.num
- The number of consecutive variables in
var
for which to
query the reduced cost.
dj
is the array returned by this method,
dj[j]
will be the reduced cost for variable
var[j+start]
.
IloCplex.UnknownObjectException
- One of the specified variables
in var
is not in the
active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getInfeasibilities(IloNumVar[] var, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
consecutive variables,
starting from the index specified by start
.
var
- An array of variables whose infeasibilities
are being queried. These variables must be in the
active model.start
- The index of the first variable in var
for
which to query the infeasibility.num
- The number of consecutive variables in
var
for which to query the infeasibility.
infeas
is the array returned by this method,
infeas[j]
will be the infeasibility value
for variable var[j+start]
.
IloCplex.UnknownObjectException
- One of the specified variables
in var
is not in the
active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getDuals(IloLPMatrix matrix) throws IloCplex.UnknownObjectException, IloException
matrix
- The LP matrix for the rows of which to query the dual
solution values. This LP matrix must be in the active
model.
pi
is the array returned by this method,
pi[i]
will be the dual solution value for the
constraint corresponding to row i
of
matrix
.
IloCplex.UnknownObjectException
- The LP matrix matrix
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getDuals(IloLPMatrix matrix, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
rows of an LP matrix.
matrix
- The LP matrix of the constraints for which the dual
solution values are being queried. This LP matrix must
be in the active model.start
- The index of the first row whose
dual solution value is being queried.num
- The number of consecutive rows for which to query the
dual solution value.
pi
is the array returned by this method,
pi[i]
will be the dual solution value for the
constraint corresponding to row i+start
of the
IloLPMatrix
matrix.
IloCplex.UnknownObjectException
- The LP matrix matrix
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getDual(IloRange rng) throws IloCplex.UnknownObjectException, IloException
rng
- The range constraint whose dual solution value is being
queried. This range constraint must be in the active model,
either directly or through an instance of
IloLPMatrix
.
IloCplex.UnknownObjectException
- The range constraint
rng
is not in the
active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getDuals(IloRange[] rng) throws IloCplex.UnknownObjectException, IloException
rng
- The array of constraints whose dual solution values are being
queried. These constraints must be in the active model, either
directly or through an instance of IloLPMatrix
.
rng
. If pi
is the
array returned by this method, pi[i]
will be the
dual solution value for constraint rng[i]
.
IloCplex.UnknownObjectException
- A constraint in rng
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getDuals(IloRange[] rng, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
consecutive range constraints, starting from
the index specified by start
.
rng
- An array containing the constraints whose dual solution
values are being queried. These constraints
must be in the active model, either added directly or
through an instance of IloLPMatrix
.start
- The index of the first constraint in rng
for
which to query the dual solution value.num
- The number of consecutive constraints in
rng
for which to
query the dual solution value.
pi
is the array
returned by this method, pi[i]
will be the
dual solution value for the range constraint
rng[i+start]
.
IloCplex.UnknownObjectException
- One of the specified constraints
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getSlacks(IloLPMatrix matrix) throws IloCplex.UnknownObjectException, IloException
matrix
- The LP matrix for the constraints of which to query the
slack values. This LP matrix must be in active model.
s
is the array returned by this method,
s[i]
will be the slack value for the range
constraint corresponding to row i
of
matrix
.
IloCplex.UnknownObjectException
- matrix
is not in
the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getInfeasibilities(IloLPMatrix matrix) throws IloCplex.UnknownObjectException, IloException
matrix
- The LP matrix for which to query the infeasibility.
This LP matrix must be in the active model.
matrix
.
If infeas
is the array returned by this method,
infeas[j]
will be the infeasibility value for
the constraint corresponding to row j
of
matrix
.
IloCplex.UnknownObjectException
- The LP matrix matrix
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getSlacks(IloLPMatrix matrix, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
consecutive rows,
starting from the index specified by start
, of an LP matrix.
matrix
- The LP matrix for rows which to query slack values.
This LP matrix must be in the active model.start
- The index of the first row whose slack value
is being queried.num
- The number of consecutive rows for which
to query the slack value.
s
is the array returned by this method,
s[i]
will be the slack value for the
constraint corresponding to row i+start
of
matrix
.
IloCplex.UnknownObjectException
- matrix
is not in
the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getInfeasibilities(IloLPMatrix matrix, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
rows of LP matrix, starting from the row specified by
start
.
matrix
- The LP matrix for which to query the infeasibility.
This LP matrix must be in the active model.start
- The index of the first row in matrix
for which to query the infeasibility.num
- The number of consecutive rows for which to query the
infeasibility.
infeas
is the array returned by this method,
infeas[j]
will be the infeasibility value
for the constraint corresponding to row j+start
of matrix
.
IloCplex.UnknownObjectException
- The LP matrix matrix
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getSlack(IloRange rng) throws IloCplex.UnknownObjectException, IloException
rng
- The range constraint whose slack value is being queried.
This range constraint must be in the active
model, either directly or through
an instance of IloLPMatrix
.
IloCplex.UnknownObjectException
- rng
is not in
the active model
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getInfeasibility(IloConstraint con) throws IloCplex.UnknownObjectException, IloException
con
- The constraint whose infeasibility value is being queried.
This constraint must be in the active
model, either directly or through
an instance of IloLPMatrix
.
IloOr
, IloAnd
,
IloSOS1
, or
IloSOS2
, the infeasibility value
returned is the maximal
absolute infeasibility value over all range constraints
and variables created by
the extraction of the queried constraint.
IloCplex.UnknownObjectException
- con
is not in
the active model
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getSlacks(IloRange[] rng) throws IloCplex.UnknownObjectException, IloException
rng
- An array of constraints whose slack values
are being queried. These range constraints must be in the
active model, either directly or through
an instance of IloLPMatrix
.
rng
. If s
is the array returned
by this method, s[i]
will be the slack value for
the range constraint rng[i]
.
IloCplex.UnknownObjectException
- A constraint in rng
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getInfeasibilities(IloConstraint[] con) throws IloCplex.UnknownObjectException, IloException
con
- An array of constraints whose infeasibility values
are being queried. These constraints must be in the
active model, either directly or through
an instance of IloLPMatrix
.
con
.
If infeas
is the array returned
by this method, infeas[i]
will be the
infeasibility value for
the constraint con[i]
.
IloCplex.UnknownObjectException
- A constraint in con
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getSlacks(IloRange[] rng, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
consecutive constraints,
starting from the index specified by start
, from
an array rng
.
rng
- An array containing the constraints whose slack values
are being queried. These constraints
must be in the active model, either added
directly or through an instance of IloLPMatrix
.start
- The index of the first constraint in rng
whose slack values are being queried.num
- The number of consecutive constraints in rng
for
which to query the slack values.
s
is the array returned by this
method, s[i]
will be the slack value for the
range constraint rng[i+start]
.
IloCplex.UnknownObjectException
- One of the specified constraints
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getInfeasibilities(IloConstraint[] con, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
consecutive constraints,
starting from the index specified by start
, from
an array con
of constraints.
con
- An array containing the constraints whose
infeasibility values
are being queried. These constraints
must be in the active model, either added
directly or through an instance of IloLPMatrix
.start
- The index of the first constraint in con
whose infeasibility value is being queried.num
- The number of consecutive constraints in con
for
which to query the infeasibility values.
infeas
is the array returned by this method,
infeas[i]
will be the infeasibility value
for the range constraint con[i+start]
.
IloCplex.UnknownObjectException
- One of the specified constraints
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getValue(IloNumExpr expr) throws IloException
expr
takes for the current solution.
expr
- The expression for which to evaluate the current solution.
expr
takes for the current solution.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getAX(IloLPMatrix matrix) throws IloCplex.UnknownObjectException, IloException
matrix
- The LP matrix for which to query the row activity values.
This LP matrix must be in the active model.
matrix
. If ax
is the array
returned by this method, ax[i]
will be the
row activity value for the constraint corresponding to row
i
of matrix
.
IloCplex.UnknownObjectException
- matrix
is unknown in
IloCplex
.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getAX(IloLPMatrix matrix, int start, int num) throws IloCplex.UnknownObjectException, IloException
num
consecutive rows, starting from the
index specified by start
, of an LP matrix.
matrix
- The LP matrix for which to query the row activity
values. This LP matrix must be in the active model.start
- The index of the first row for which to query the
row activity values.num
- The number of consecutive rows for which to query the
row activity values.
ax
is the
array returned by this method, ax[i]
will be the
row activity value for the constraint corresponding to row
i+start
of the IloLPMatrix
matrix.
IloCplex.UnknownObjectException
- matrix
is unknown in
IloCplex
.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double getAX(IloRange rng) throws IloCplex.UnknownObjectException, IloException
rng
- The range constraint whose row activity value is
being queried. This range constraint must be in the
active model, either directly or through an
IloLPMatrix
object.
rng
.
IloCplex.UnknownObjectException
- rng
is not in
the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getAX(IloRange[] rng) throws IloCplex.UnknownObjectException, IloException
rng
- An array of range constraints whose row activity values
are being queried. These range constraints must all be in
the active model, either directly or through an
IloLPMatrix
object.
rng
. If ax
is the array returned by
this method, ax[i]
will be the row activity value
for the range constraint rng[i]
.
IloCplex.UnknownObjectException
- A constraint in rng
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public double[] getAX(IloRange[] rng, int start, int num) throws IloCplex.UnknownObjectException, IloException
rng
- An array containing the range constraints whose row
activity values are being queried. These range constraints
must be in the active model, either directly or through an
IloLPMatrix
object.start
- The index of the first range constraint in rng
for which to query the row activity value.num
- The number of consecutive range constraints
in rng
for
which to query the row activity value.
ax
is the array returned by this method,
ax[i]
will be the row activity value for the
constraint rng[i+start]
.
IloCplex.UnknownObjectException
- One of the specified constraints
is not in the active model.
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.public IloCplex.BasisStatus getBasisStatus(IloNumVar var) throws IloException
var
.
This function
succeeds only if a basic solution is available in the invoking
IloCplex
optimizer.
var
- The variable whose basis status is being queried.
var
.
IloException
public IloCplex.BasisStatus[] getBasisStatuses(IloNumVar[] var) throws IloException
var
.
This function succeeds only if a basic solution is available in the
invoking IloCplex
optimizer.
var
- The array of variables whose basis statuses are being queried.
var
. If
b
is the returned array, b[j]
will be the basis status for variable var[j]
.
IloException
public IloCplex.BasisStatus[] getBasisStatuses(IloNumVar[] var, int start, int num) throws IloException
num
consecutive variables,
starting from the index specified by start
,
in the array var
.
This function succeeds only if a basic solution is available in the
invoking IloCplex
optimizer.
var
- An array containing the variables whose basis statuses
are being queried.start
- The index of the first variable in the array var
for which to return basis statuses.num
- The number of consecutive variables in
the array var
for
which to return basis statuses.
var
. If b
is the returned array,
b[j]
will be the basis status for variable
var[j+start]
.
IloException
public IloCplex.BasisStatus getBasisStatus(IloConstraint con) throws IloException
con
.
This function succeeds only if a basic solution is available
in the invoking IloCplex
optimizer.
con
- The constraint whose basis status is being queried.
rng
.
IloException
public IloCplex.BasisStatus[] getBasisStatuses(IloConstraint[] con) throws IloException
con
.
This function succeeds only if a basic solution is available in the
invoking IloCplex
optimizer.
con
- The array of constraints whose basis statuses are being
queried.
con
. If b
is the returned
array, b[i]
will be the basis status for
constraints con[i]
.
IloException
public IloCplex.BasisStatus[] getBasisStatuses(IloConstraint[] con, int start, int num) throws IloException
num
consecutive
constraints, starting from the index specified by
start
, in the array of constraints con
.
This function succeeds only if a basic solution is available in the
invoking IloCplex
optimizer.
con
- An array containing the constraints whose basis statuses
are being queried.start
- The index of the first constraint in
the array con
for which to return the basis status.num
- The number of consecutive constraints in
the array con
for
which to return the basis status.
con
. If b
is the returned array,
b[i]
will be the basis status for constraint
con[i+start]
.
IloException
public void setBasisStatuses(IloNumVar[] var, IloCplex.BasisStatus[] cstat, IloRange[] con, IloCplex.BasisStatus[] rstat) throws IloException
var
- An array of variables whose basis statuses are being set.cstat
- An array of basis statuses for variables in
var
. The basis status for variable
var[j]
will be set to cstat[j]
.con
- An array of constraints whose basis statuses are being set.rstat
- An array of basis statuses for the ranges in
con
. The basis status for constraint
con[i]
will be set to rstat[i]
.
IloException
public void setBasisStatuses(IloNumVar[] var, IloCplex.BasisStatus[] cstat, int cstart, int cnum, IloConstraint[] con, IloCplex.BasisStatus[] rstat, int rstart, int rnum) throws IloException
cnum
consecutive
variables, starting from the index specified by var[start]
,
and rnum
consecutive constraints, starting from the
index specified by con[start]
.
var
- An array of variables whose
basis statuses are being set.cstat
- An array containing the basis statuses for the
variables specified in var
.cstart
- The first element in var
and
cstat
to consider.cnum
- The number of variables in var
for which to
set the basis status.con
- An array of constraints whose
basis statuses are being set.rstat
- An array containing the basis statuses for the ranges
specified in con
.rstart
- The first element in con
and
rstat
to consider.rnum
- The number of constraints in con
for which
to set the basis status.
IloException
public void setVectors(double[] x, double[] dj, IloNumVar[] var, double[] slack, double[] pi, IloRange[] rng) throws IloException
solve
.
Starting point information is exploited at the next call of the method
solve
. In particular, if the active model
is an LP or QP, and the parameter IloCplex.IntParam.RootAlg
is IloCplex.Algorithm.Primal
or
IloCplex.Algorithm.Dual
, the starting point information
provided with this method is used to construct a starting basis for
the simplex algorithm.
If the active model is a MIP, only x
values can be used.
Values may be specified for any subset of the integer and
continuous variables
in the model, either through a single invocation of
setVectors
,
or incrementally through multiple calls.
When optimization commences or resumes, CPLEX will attempt to
find a feasible MIP solution that is compatible with the set of specified
x
values. When start values are not provided for all integer
variables, CPLEX tries to extend the partial solution to a
complete solution
by solving a MIP on the unspecified variables. The parameter
SubMIPNodeLim
controls the amount of effort CPLEX expends in
trying to solve this secondary MIP. If CPLEX finds a complete
feasible solution, that solution becomes the incumbent. If the
specified values are infeasible, they are retained for use in a subsequent
solution repair heuristic. The amount of effort spent in this heuristic
can be controlled by parameter RepairTries
.
The starting point information is provided in the parameters of this
method. null
can be passed for any of
the arrays. However, if x
or dj
are not
null
, var
must not be null
.
Similarly, if slack
or pi
are not
null
, rng
must not be null
.
For all variables given in var
, x[j]
specifies
the starting primal value for variable var[j]
. Similarly,
dj[j]
specifies the starting reduced cost for variable
var[j]
. For all ranges specified in rng
,
slack[i]
specifies the starting slack value for
rng[i]
. Similarly, pi[i]
specifies the starting
dual value for rng[i]
.
x
- The array of starting primal values for var
.dj
- The array of starting reduced costs for var
.var
- The array of variables for which to set starting point
information.slack
- The array of starting slack values for rng
.pi
- The array of starting dual values for rng
.rng
- The array of constraints for which to set starting point
information.
IloException
public void setVectors(double[] x, double[] dj, IloNumVar[] var, int vstart, int vnum, double[] slack, double[] pi, IloRange[] rng, int rstart, int rnum) throws IloException
solve
.
Starting point information is exploited at the next call of the method
solve
. In particular, if the active model
is an LP or QP, and the parameter IloCplex.IntParam.RootAlg
is IloCplex.Algorithm.Primal
or
IloCplex.Algorithm.Dual
, the starting point information
provided with this method is used to construct a starting basis for
the simplex algorithm.
If the active model is a MIP, only x
values can be used.
Values may be specified for any subset of the integer and
continuous variables
in the model, either through a single invocation of
setVectors
,
or incrementally through multiple calls.
When optimization commences or resumes, CPLEX will attempt to
find a feasible MIP solution that is compatible with the set of specified
x
values. When start values are not provided for all integer
variables, CPLEX tries to extend the partial solution to a
complete solution
by solving a MIP on the unspecified variables. The parameter
SubMIPNodeLim
controls the amount of effort CPLEX expends in
trying to solve this secondary MIP. If CPLEX finds a complete
feasible solution, that solution becomes the incumbent. If the
specified values are infeasible, they are retained for use in a subsequent
solution repair heuristic. The amount of effort spent in this heuristic
can be controlled by parameter RepairTries
.
The starting point information is provided in the parameters of this
method. null
can be passed for any of the arrays.
However, if x
or dj
are not null
,
var
must not be null
. Similarly, if
slack
or pi
are not null
,
rng
must not be null
. Also, if
vnum
is not 0, x
and dj
must
not both be null
, and if rnum
is not 0,
slack
and pi
must not both be
null
.
For the variables specified in var
, x[j]
is
the primal starting value for variable var[j]
. Similarly,
dj[j]
is the starting reduced cost for variable
var[j]
. For the constraints specified in rng
,
slack[i]
is the starting slack value for
rng[i]
. Similarly, pi[i]
is the starting
dual value for rng[i]
.
x
- An array of starting values for the variables
specified in var
.dj
- An array of starting reduced costs for the variables
specified in var
.var
- An array containing the variables for which to set starting
point information.vstart
- The index of the first element in the arrays
x
, dj
, or var
to be used.vnum
- The number of consecutive variables in the
array var
for which starting point information is to be set.slack
- An array of starting slack values for rng
.pi
- An array of starting dual values for rng
.rng
- An array containing the constraints for which to set
starting point information.rstart
- The index of the first element in slack
,
pi
, or rng
to be used.rnum
- The number of consecutive constraints in the
array rng
for which starting point information is to be set.
IloException
public boolean feasOpt(IloConstraint[] cts, double[] prefs) throws IloException
cts
.
On successful completion, the
method installs a solution vector that is feasible for the
minimum-cost relaxation.
This solution can be queried with conventional query methods, such as
IloCplex.getValue
.
The method feasOpt
provides several different
metrics for determining what constitutes a minimum-cost relaxation.
The metric is specified by the parameter FeasOptMode
.
The method feasOpt
can also optionally perform a second
optimization phase where the original objective is optimized,
subject to the constraint that the associated relaxation must
have the same cost as the minimum-cost relaxation computed in the first
phase. See
IloCplex.Relaxation
for further information.
The user may specify numeric values to express relative preferences
for relaxing bounds. A larger preference value indicates a
greater willingness
to relax the corresponding bound.
Internally, feasOpt
uses the
reciprocal of the preference value to weight the
relaxations of the associated
bounds in the phase one cost function.
A negative or 0 (zero) value indicates that the corresponding bound must
not be relaxed. If a preference is specified for a ranged constraint,
that preference is used for both, its upper and lower bound.
If enough constraints were allowed to be relaxed, the
function will return IloTrue
; otherwise, it returns
IloFalse
.
The active model is not changed by this method.
cts
- An array of constraints that can be relaxed.
Only constraints directly added to the model
can be specified in this array.
Groups of constraints can be combined and
specified by and
constraints.
Relaxation preference values can be specified in
the array prefs
.prefs
- An array of doubles indicating the preference value
for relaxing the constraints specified in
cts
. The element
prefs[i]
specifies the preference value
for relaxing the constraint cts[i]
.
IloException
public boolean feasOpt(IloRange[] rngs, double[] rnglb, double[] rngub, IloNumVar[] vars, double[] varlb, double[] varub) throws IloException
vars
and
by relaxing the bounds of the range constraints specified in
the array rngs
.
On successful completion, the
method installs a solution vector that is feasible for the
minimum-cost relaxation.
This solution can be queried with conventional query methods, such as
IloCplex.getValue
or
IloCplex.getInfeasibility
.
The method feasOpt
provides several different
metrics for determining what constitutes a minimum-cost relaxation.
The metric is chosen using parameter FeasOptMode
.
The feasOpt
method can also optionally perform a second
optimization phase where the original objective is optimized,
subject to the constraint that the associated relaxation must
have the same cost as the minimum-cost relaxation computed in the first
phase. See
IloCplex.Relaxation
for further information.
The user may specify numeric values to express relative preferences
for relaxing bounds. A larger preference value indicates
a greater willingness
to relax the corresponding bound.
Internally, feasOpt
uses the
reciprocal of the preference value to weight
the relaxations of the associated
bounds in the phase one cost function.
A negative or 0 (zero) value indicates that the corresponding bound must
not be relaxed. These preference values are entered in the arguments
rnglb
, rngub
, varlb
,
and varub
.
If enough variables or constraints were allowed to be relaxed, the
function will return IloTrue
; otherwise, it returns
IloFalse
.
The active model is not changed by this method.
rngs
- An array of ranged constraints. Relaxation preference
values for these ranges can be specified in arrays
rnglb
and rngub
. This array
may be null
, in which case no range
constraints may be relaxed.
Only constraints directly added to the model
can be specified.rnglb
- An array of doubles indicating the preference value
for relaxing the lower bound of the ranged constraints
specified in parameter rngs
. Element
rnglb[i]
specifies the preference value
for relaxing the lower bound of constraint
rngs[i]
. This array may be
null
, in which case no range lower bounds
are allowed to be relaxed.rngub
- An array of doubles indicating the preference value
for relaxing the upper bound of the ranged constraints
specified in parameter rngs
. Element
rngub[i]
specifies the preference
for relaxing the upper bound of constraint
rngs[i]
. This array may be
null
, in which case no range upper bounds
are allowed to be relaxed.vars
- An array of modeling variables. Relaxation preference
values for the variables can be specified in arrays
varlb
and varub
. This array
may be null
, in which case no variable
bounds are allowed to be relaxed.varlb
- An array of doubles indicating the preference value
for relaxing the lower bound of the modeling variables
specified in parameter vars
. Element
varlb[i]
specifies the preference value
for relaxing the lower bound of variable
vars[i]
. This array may be
null
,
in which case no variable lower bounds
are allowed to be relaxed.varub
- An array of doubles indicating the preference value
for relaxing the upper bound of the modeling variables
specified in parameter vars
. Element
varub[i]
specifies the preference value
for relaxing the upper bound of variable
vars[i]
. This array may be
null
,
in which case no variable upper bounds
are allowed to be relaxed.
IloException
public boolean feasOpt(IloNumVar[] vars, double[] varlb, double[] varub) throws IloException
vars
.
On successful completion, the
method installs a solution vector that is feasible for the
minimum-cost relaxation.
This solution can be queried with conventional query methods, such as
IloCplex.getValue
.
The method feasOpt
provides several different
metrics for determining what constitutes a minimum-cost relaxation.
The metric is chosen using parameter FeasOptMode
.
The feasOpt
method can also optionally perform a second
optimization phase where the original objective is optimized,
subject to the constraint that the associated relaxation must
have the same cost as the minimum-cost relaxation computed in the first
phase. See
IloCplex.Relaxation
for further information.
The user may specify numeric values to express relative preferences
for relaxing bounds. A larger preference value indicates
a greater willingness to relax the corresponding bound.
Internally, feasOpt
uses the
reciprocal of the preference value to weight the
relaxations of the associated bounds in the phase one cost function.
A negative or 0 (zero) value specifies that the corresponding bound must
not be relaxed. These preference values are input in
varlb
and varub
.
If enough variable bounds were allowed to be relaxed, the
function will return IloTrue
; otherwise, it returns
IloFalse
.
The active model is not changed by this method.
vars
- An array of modeling variables. Relaxation preference
values for these variables can be specified in arrays
varlb
and varub
. This array
may be null
, in which case no variable bounds
are allowed to be relaxed.varlb
- An array of doubles indicating the preference value
for relaxing the lower bound of the modeling variables
specified in parameter vars
. Element
varlb[i]
specifies the preference value
for relaxing the lower bound of variable
vars[i]
. This array may be
null
,
in which case no variable lower bounds
are allowed to be relaxed.varub
- An array of doubles indicating the preference value
for relaxing the upper bound of the modeling variables
specified in parameter vars
. Element
varub[i]
specifies the preference value
for relaxing the upper bound of variable
vars[i]
. This array may be
null
,
in which case no variable upper bounds
are allowed to be relaxed.
IloException
public boolean feasOpt(IloRange[] rngs, double[] rnglb, double[] rngub) throws IloException
rngs
.
On successful completion, the
method installs a solution vector that is feasible for the
minimum-cost relaxation.
This solution can be queried with conventional query methods, such as
IloCplex.getValue
.
The method feasOpt
provides several different
metrics for determining what constitutes a minimum-cost relaxation.
The metric is specified by the parameter FeasOptMode
.
The method feasOpt
can also optionally perform a second
optimization phase where the original objective is optimized,
subject to the constraint that the associated relaxation must
have the same cost as the minimum-cost relaxation computed in the first
phase. See
IloCplex.Relaxation
for further information.
The user may specify numeric values to express relative preferences
for relaxing bounds. A larger preference value
indicates a greater willingness to relax the corresponding bound.
Internally, feasOpt
uses the
reciprocal of the preference value to weight the
relaxations of the associated
bounds in the phase one cost function.
A negative or 0 (zero) value indicates that the corresponding bound must
not be relaxed.
These preference values are entered in the arguments
rnglb
and rngub
.
If enough constraints were allowed to be relaxed, the
function will return IloTrue
; otherwise, it returns
IloFalse
.
The active model is not changed by this method.
rngs
- An array of ranged constraints. Relaxation preference
values for these ranges can be specified in arrays
rnglb
and rngub
. This array
may be null
, in which case no range bounds
are allowed to be relaxed.
Only constraints directly added to the model can be
specified.rnglb
- An array of doubles indicating the preference value
for relaxing the lower bound of the ranged constraints
specified in parameter rngs
. Element
rnglb[i]
specifies the preference value
for relaxing the lower bound of constraint
rngs[i]
. This array may be
null
, in which case no range lower bounds
are allowed to be relaxed.rngub
- An array of doubles indicating the preference value
for relaxing the upper bound of the ranged constraints
specified in parameter rngs
. Element
rngub[i]
specifies the preference value
for relaxing the upper bound of constraint
rngs[i]
. This array may be
null
, in which case no range upper bounds
are allowed to be relaxed.
IloException
public IloNumVarBound bound(IloNumVar var, IloNumVarBoundType type)
IloNumVarBound
to represent the specified bound of the variable var
.
public IloNumVarBound lowerBound(IloNumVar var)
IloNumVarBound
to represent the lower bound of the variable var
.
public IloNumVarBound upperBound(IloNumVar var)
IloNumVarBound
to represent the upper bound of variable var
.
public boolean refineConflict(IloConstraint[] cons, double[] prefs) throws IloException
The method IloCplex.refineConflict
tries to compute a
minimal conflict for the infeasibility of the current model or for
a subset of the constraints of the current model.
If this computation is successful, (that is, it runs to completion;
it is not interrupted by the user's application nor limited
by a user-specified restriction of time or other resources)
the conflict can be accessed
by means of the method getConflict
as a minimal set of
constraints that are still infeasible.
Removal of any of these constraints
will remove that particular cause for infeasibility. However, if
other infeasible sets still exist in the model, then that removal
from the model of any of the constraints in the returned set
does not guarantee feasibility of the remaining model.
Constraints may be considered in groups
organized by IloAnd
constructed
with ilog.concert.IloMPModeler.and
.
If any constraint in a group
participates in the conflict, the entire group is determined to do so.
No further detail about the constraints within that group is returned.
A group or constraint may be assigned a preference. A constraint with a higher preference is more likely to be included in the conflict. However, no guarantee is made when a conflict is returned that other infeasible sets containing groups or constraints with a higher preference may exist.
cons
- An array of constraints. They may be IloRange
or IloAnd
constructs on a set of ranges.
Only constraints directly added to the model can be
specified.
If a constraint does not appear in this array, the constraint
is assigned a default preference value of 0 (zero).
As a consequence, such constraints
are included in the conflict without any analysis.
prefs
- An array of integers containing the preferences for the
groups or constraints. prefs[i]
specifies the
preference for the group or constraint i
. A
negative value indicates that the corresponding group or
constraint should not be considered for
finding a conflict. In other words,
such groups are considered not to be part of the
model. Groups with a preference of 0 (zero) are always
considered to be part of the conflict. No further
checking is performed on such groups.
IloException
public boolean refineConflict(IloConstraint[] cons, double[] prefs, int start, int num) throws IloException
This method resembles
IloCplex.refineConflict(ilog.concert.IloConstraint[], double[])
but considers only
num
constraints, starting at the index indicated by
start
.
IloException
public IloCplex.ConflictStatus[] getConflict(IloConstraint[] cts) throws IloException
refineConflict
and returns the status of the constraints
in the array cts
.
The constraints passed in cts
must be among the same
ones that have previously been passed to refineConflict
.
cts
.
IloException
public IloCplex.ConflictStatus getConflict(IloConstraint ct) throws IloException
refineConflict
and returns the conflict status for the
constraint ct
.
The possible status is one of the following values:
IloCplex.Excluded
the constraint has been
proven not to participate in the conflict.
IloCplex.ConflictMember
the constraint has been
proven to participate in the conflict.
IloCplex.ConflictPossibleMember
the constraint
not been proven not to participate in the conflict;
that is, it might participate, it might not.
The constraint ct
must be one that has
previously been passed to refineConflict
.
IloException
public IloCplex.ConflictStatus[] getConflict(IloConstraint[] cts, int start, int num) throws IloException
refineConflict
and returns the conflict status
of num
consecutive constraints in the
array cts
.
The constraints passed in cts
must be among the same
constraints that have previously been passed to
refineConflict
.
cts
- The array of constraints in the conflict.start
- The index of the first constraint.num
- The number of consecutive elements in
the array, starting from the element specified
by start
.
IloException
public void getBoundSA(double[] lblower, double[] lbupper, double[] ublower, double[] ubupper, IloLPMatrix matrix) throws IloException
lblower
- lblower[j]
will contain the lowest value
that the lower bound of the variable corresponding to
column j
of matrix
can be set to without affecting the optimality of the
basis. If this information is not required,
null
may be passed. Otherwise, the length
of the array must be at least the number of columns in
the matrix.lbupper
- lbupper[j]
will contain the highest value
that the lower bound of the variable corresponding to
column j
of matrix
can be set
to without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the length of the array must
be at least the number of columns in the matrix.ublower
- ublower[j]
will contain the lowest value
that the upper bound of the variable corresponding to
column j
of matrix
can be set
to without affecting the optimality of the basis. If
this information is not required null
may
be passed. Otherwise, the length of the array must be
at least the number of columns in the matrix.ubupper
- ubupper[j]
will contain the highest value
that the upper bound of the variable corresponding to
column j
of matrix
can be set
to without affecting the optimality of the basis. If
this information is not required null
may
be passed. Otherwise, the length of the array must be
at least the number of columns in the matrix.matrix
- The LP matrix for the columns for which the bound
sensitivity analysis is to be computed.
IloException
public void getBoundSA(double[] lblower, double[] lbupper, double[] ublower, double[] ubupper, IloLPMatrix matrix, int start, int num) throws IloException
num
consecutive variables, starting from
the index specified by start
,
in the specified LP matrix.
lblower
- lblower[j]
will contain the lowest
value that the lower bound of the variable corresponding
to column j+start
of matrix
can be set to without affecting the optimality of the
basis. If this information is not required,
null
may be passed. Otherwise, the length
of the array must be at least num
.lbupper
- lbupper[j]
will contain the highest
value that the lower bound of the variable corresponding
to column j+start
of matrix
can
be set to without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the length of the array must
be at least num
.ublower
- ublower[j]
will contain the lowest
value that the upper bound of the variable corresponding
to column j+start
of
matrix
can
be set to without affecting the optimality of the basis.
If this information is not required,
null
may
be passed. Otherwise, the length of the array must be
at least num
.ubupper
- ubupper[j]
will contain the highest
value that the upper bound of the variable corresponding
to column j+start
of
matrix
can
be set to without affecting the optimality of the basis.
If this information is not required,
null
may
be passed. Otherwise, the length of the array must be
at least num
.matrix
- The LP matrix for the columns for which the bound
sensitivity analysis is to be computed.start
- The index of the first column of the matrix for which
bound sensitivity analysis is returned.num
- The number of consecutive columns in matrix
for which to return
bound sensitivity analysis.
IloException
public void getBoundSA(double[] lblower, double[] lbupper, double[] ublower, double[] ubupper, IloNumVar[] var) throws IloException
vars
.
lblower
- lblower[j]
will contain the lowest value
the lower bound of variable var[j]
can
be set to without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
the same length as var
.lbupper
- lbupper[j]
will contain the highest value
the lower bound of variable var[j]
can be
set to without affecting the optimality of the basis.
If
this information is not required, null
may
be passed. Otherwise, the array must have at least the
same length as var
.ublower
- ublower[j]
will contain the lowest value
the upper bound of variable var[j]
can
be set to without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
the same length as var
.ubupper
- ubupper[j]
will contain the highest value
the upper bound of variable var[j]
can
be set to without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
the same length as var
.var
- An array containing the variables for which to return
bound sensitivity analysis.
IloException
public void getBoundSA(double[] lblower, double[] lbupper, double[] ublower, double[] ubupper, IloNumVar[] var, int start, int num) throws IloException
num
consecutive variables, starting from the index
specified by start
, in the array var
.
lblower
- lblower[j]
will contain the lowest value
the lower bound of variable
var[j+start]
can
be set to without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.lbupper
- lbupper[j]
will contain the highest value
to which the lower bound of variable
var[j+start]
can be set
without affecting the optimality of the basis.
If this information is not required,
null
may
be passed. Otherwise, the array must have at least
length num
.ublower
- ublower[j]
will contain the lowest value
to which the upper bound of the variable
var[j+start]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.ubupper
- ubupper[j]
will contain the highest value
to which the upper bound of variable
var[j+start]
can
be set to without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.var
- An array containing the variables for which to return
bound sensitivity analysis.start
- The index of first variable in var
for
which to return bound sensitivity analysis.num
- The number of consecutive variables
in var
for which
to return bound sensitivity analysis.
IloException
public void getObjSA(double[] lower, double[] upper, IloLPMatrix matrix) throws IloException
lower
- lower[j]
is the lowest value to which the
objective coefficient for the variable corresponding to
column j
of matrix
can be set
without affecting the optimality of the basis. If this
information is not required null
may be
passed. Otherwise, the array must have a length at least
equal to the number of columns in the
matrix
.upper
- upper[j]
is the highest value to which the
objective coefficient of the variable corresponding to
of column j
of matrix
that
can be set without affecting the optimality of the
basis. If this information is not required,
null
may be passed. Otherwise, the array
must have a length at least equal to the number of
columns in the matrix
.matrix
- The LP matrix which contains the column for which
objective sensitivity analysis will be
returned.
IloException
public void getObjSA(double[] lower, double[] upper, IloLPMatrix matrix, int start, int num) throws IloException
num
consecutive columns of the specified LP matrix.
lower
- lower[j]
will contain the lowest value to
which the objective coefficient of the variable
corresponding to column j+start
of
matrix
that can be set, without affecting
the optimality of the basis. If this information is not
required, null
may be passed.
Otherwise, the
array must have at least length num
.upper
- upper[j]
will contain the highest value to
which the objective coefficient of the variable
corresponding to column j+start
of
matrix
that can be set, without affecting
the optimality of the basis. If this information is not
required, null
may be passed. Otherwise,
the array must have at least length num
.matrix
- The LP matrix which contains the column for which
objective sensitivity analysis is to be
returned.start
- The index of the first column of matrix
for
which to return objective sensitivity analysis
information.num
- The number of consecutive
columns of matrix
for which
to return objective sensitivity analysis.
IloException
public void getObjSA(double[] lower, double[] upper, IloNumVar[] var) throws IloException
lower
- lower[j]
will contain the lowest value to
which the objective coefficient of the variable
var[j]
can be set without affecting the
optimality of the basis. If this information is not
required, null
may be passed. Otherwise, the
array must have a length at least equal to the length
of the array var
.upper
- upper[j]
will contain the highest value to
which the objective coefficient of the variable
var[j]
can be set without affecting the
optimality of the basis. If this information is not
required, null
may be passed. Otherwise,
the array must have a length at least equal to the length
of the array var
.var
- An array containing the variables for which objective
sensitivity analysis will be returned.
IloException
public void getObjSA(double[] lower, double[] upper, IloNumVar[] var, int start, int num) throws IloException
num
consecutive variables, starting
at the index specified by start
.
lower
- lower[j]
will contain the lowest value to
which the objective coefficient of the variable
var[j+start]
can be set without affecting
the optimality of the basis. If this information is not
required, null
may be passed. Otherwise,
the array must have at least length num
.upper
- upper[j]
will contain the highest value to
which the objective coefficient of the variable
var[j+start]
can be set without affecting
the optimality of the basis. If this information is not
required, null
may be passed. Otherwise,
the array must have at least length num
.var
- An array containing the variables for which objective
sensitivity analysis will be returned.start
- The index of first variable in var
for
which objective sensitivity analysis will
be returned.num
- The number of consecutive variables
in var
for which
objective sensitivity analysis will be
returned.
IloException
public void getRangeSA(double[] lblower, double[] lbupper, double[] ublower, double[] ubupper, IloRange[] rng) throws IloException
rng
.
lblower
- lblower[i]
will contain the lowest value to
which the lower bound of range rng[i]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
the same length as rng
.lbupper
- lbupper[i]
will contain the highest value to
which the lower bound of range rng[i]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
the same length as rng
.ublower
- ublower[i]
will contain the lowest value to
which the upper bound of range rng[i]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
the same length as rng
.ubupper
- ubupper[i]
will contain the highest value to
which the upper bound of range rng[i]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
the same length as rng
.rng
- An array containing the constraints for which the
sensitivity information is requested.
IloException
public void getRangeSA(double[] lblower, double[] lbupper, double[] ublower, double[] ubupper, IloRange[] rng, int start, int num) throws IloException
num
consecutive range constraints in the array
rng
, starting with the index specified by
rng[start]
.
lblower
- lblower[i]
will contain the lowest value to
which the lower bound of range
rng[i+start]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.lbupper
- lbupper[i]
will contain the highest value to
which the lower bound of range
rng[i+start]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.ublower
- ublower[i]
will contain the lowest value to
which the upper bound of range
rng[i+start]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.ubupper
- ubupper[i]
will contain the highest value to
which the upper bound of range
rng[i+start]
can
be set to without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.rng
- An array containing the constraints for which the
sensitivity information is requested.start
- The index of the first constraints in rng
for which the sensitivity information is requested.num
- The number of consecutive constraints
in rng
for which
the sensitivity information is requested.
IloException
public void getRangeSA(double[] lblower, double[] lbupper, double[] ublower, double[] ubupper, IloLPMatrix matrix, int start, int num) throws IloException
num
rows of the LP matrix
matrix
starting with row start
.
lblower
- lblower[i]
will contain the lowest value to
which the lower bound of the constraint corresponding
to row i+start
of matrix
can be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.lbupper
- lbupper[i]
will contain the highest value to
which the lower bound of the constraint corresponding
to row i+start
of matrix
can be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.ublower
- ublower[i]
will contain the lowest value to
which the upper bound of the constraint corresponding
to row i+start
of matrix
can be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.ubupper
- ubupper[i]
will contain the highest value to
which the upper bound of the constraint corresponding
to row i+start
of matrix
can be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.matrix
- The LP matrix for rows of which sensitivity analysis
information is to be computed.start
- The first row of matrix
for which
sensitivity analysis is to be computed.num
- The number of consecutive rows
of matrix
for which
sensitivity analysis is to be computed.
IloException
public void getRangeSA(double[] lblower, double[] lbupper, double[] ublower, double[] ubupper, IloLPMatrix matrix) throws IloException
matrix
.
lblower
- lblower[i]
will contain the lowest value to
which the lower bound of the constraint corresponding
to row i
of matrix
can be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the length of the array must
be at least equal to the number of rows in
matrix
.lbupper
- lbupper[i]
will contain the highest value to
which the lower bound of the constraint corresponding
to row i
of matrix
can be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the length of the array must
be at least equal to the number of rows in
matrix
.ublower
- ublower[i]
will contain the lowest value to
which the upper bound of the constraint corresponding
to row i
of matrix
can be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the length of the array must
be at least equal to the number of rows in
matrix
.ubupper
- ubupper[i]
will contain the highest value to
which the upper bound of the constraint corresponding
to row i
of matrix
can be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length equal to the number of rows in
matrix
.matrix
- The LP matrix for rows of which sensitivity analysis
information is to be computed.
IloException
public void getRHSSA(double[] lower, double[] upper, IloRange[] rng) throws IloException
The returned bounds represent the interval in which both
bounds can simultaneously be moved without affecting the solution. This
is useful for equality constraints, that is, ranged constraints where the
upper and lower bound match. In this case the returned bounds indicate
within which interval the value b for a constraint in the form a'x = b
can be moved. It is not possible to obtain this information from
getRangeSA
, since both bounds are moved independently.
lower
- lower[i]
will contain the lowest value to
which the lower bound of range rng[i]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
the same length as rng
.upper
- upper[i]
will contain the highest value to
which the lower bound of range rng[i]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed.
Otherwise, the array must have at least the same length
as rng
.rng
- An array containing the constraints for which the
sensitivity analysis is requested.
IloException
public void getRHSSA(double[] lower, double[] upper, IloRange[] rng, int start, int num) throws IloException
num
constraints, starting from the index specified by start
.
The returned bounds represent the interval in which both
bounds can simultaneously be moved without affecting the solution. This
is useful for equality constraints, that is, ranged constraints where the
upper and lower bound match. In this case the returned bounds indicate
within which interval the value b for a constraint in the form a'x = b
can be moved. It is not possible to obtain this information from
getRangeSA
, since both bounds are moved independently.
lower
- lower[i]
will contain the lowest value to
which the lower bound of rng[i+start]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
num
.upper
- upper[i]
will contain the highest value to
which the lower bound of rng[i+start]
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.rng
- An array containing the constraints for which the
sensitivity analysis is requested.start
- The first element in rng
for which the
sensitivity analysis is requestednum
- The number of consecutive elements
in rng
for which
the sensitivity analysis is requested.
IloException
public void getRHSSA(double[] lower, double[] upper, IloLPMatrix matrix) throws IloException
The returned bounds represent the interval in which both
bounds can simultaneously be moved without affecting the solution. This
is useful for equality constraints, that is, ranged constraints where the
upper and lower bound match. In this case the returned bounds indicate
within which interval the value b for a constraint in the form a'x = b
can be moved. It is not possible to obtain this information using
getRangeSA
, since both bounds are moved independently.
lower
- lower[i]
will contain the lowest value to
which the lower bound of the constraint corresponding
to row i
of matrix
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
a length equal to the number of rows in
matrix
.upper
- upper[i]
will contain the highest value to
which the lower bound of the constraint corresponding
to row i
of matrix
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed.
a length equal to the number of rows in
matrix
.matrix
- The matrix for the rows of which
the sensitivity analysis is requested.
IloException
public void getRHSSA(double[] lower, double[] upper, IloLPMatrix matrix, int start, int num) throws IloException
num
constraints, corresponding to a range of rows of an LP matrix,
starting from the index specified by start
.
The returned bounds represent the interval in which both
bounds can simultaneously be moved without affecting the solution. This
is useful for equality constraints, that is, ranged constraints where the
upper and lower bound match. In this case the returned bounds indicate
within which interval the value b for a constraint in the form a'x = b
can be moved. It is not possible to obtain this information using
getRangeSA
, since both bounds are moved independently.
lower
- lower[i]
will contain the lowest value to
which the lower bound of the constraint corresponding
to row i+start
of matrix
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.upper
- upper[i]
will contain the highest value to
which the lower bound of the constraint corresponding
to row i+start
of matrix
can
be set without affecting the optimality of the basis.
If this information is not required, null
may be passed. Otherwise, the array must have at least
length num
.matrix
- The matrix for the rows of which
the sensitivity analysis is requested.start
- The first row of matrix
for which the
sensitivity analysis is requested.num
- The number of consecutive rows
of matrix
for which to
sensitivity analysis is requested.
IloException
public IloCplex.Quality getQuality(IloCplex.QualityType which) throws IloException
IloCplex.Quality
that contains
the requested quality measure.
which
- The IloCplex.QualityType
which should be
computed.
IloCplex.Quality
for the requested quality measure.
IloException
IloCplex.Quality
,
IloCplex.QualityType
public java.io.PrintStream output()
IloCplex
object.
This stream is used by IloCplex
for printing logging
information. It can be set with the method
setOut
.
IloCplex
object.IloCplex.setOut(java.io.OutputStream)
public java.io.PrintStream warning()
IloCplex
object. This stream is used by IloCplex
for printing
warnings. It can be set with the method
setWarning
.
IloCplex
object.IloCplex.setWarning(java.io.OutputStream)
public void setOut(java.io.OutputStream s)
IloCplex
object.
After this call, all logging output will be output via the new
stream. Passing null
as the new output stream will turn off
all logging output.
s
- The new default output stream.public void setWarning(java.io.OutputStream s)
IloCplex
object.
After this call, all warnings will be output via the new stream.
Passing
null
as the new output stream will turn off all warnings.
s
- The new warning output stream.public boolean solve() throws IloException
false
is returned, a feasible solution may still be present, but
IloCplex
has not been able to prove its feasibility.
IloException
public boolean solveFixed() throws IloException
false
is returned a feasible solution may still be present, but
IloCplex has not been able to prove its feasibility.
IloException
public int getNiterations()
public int getNphaseOneIterations()
public int getNbarrierIterations()
public int getNsiftingIterations()
public int getNsiftingPhaseOneIterations()
public int getNcrossDExch()
public int getNcrossDPush()
public int getNcrossPExch()
public int getNcrossPPush()
public int getNdualSuperbasics()
public int getNprimalSuperbasics()
public int getNcliques()
public int getNcovers()
public int getNnodes()
public int getNnodesLeft()
public int getIncumbentNode()
public void setPriority(IloNumVar var, int pri) throws IloException
var
.
During branching, integer
variables with higher priorities are given preference over integer
variables with lower priorities. Further, variables that have priority
assigned to them are given preference over variables that do not.
Branching priorities must be nonnegative integers. By default,
the priority of a variable without a user-assigned priority is 0 (zero).
To remove a user-assigned priority from a variable, use the method
IloCplex.delPriority
.
The parameter MIPOrdInd
by default indicates that
user-assigned priority orders should be taken into account.
When MIPOrdInd
is reset to its nondefault value
0 (zero), CPLEX ignores user-assigned priorities.
For more detail about how
priorities are applied, see the topic Issuing Priority Orders
in the ILOG CPLEX User's Manual.
var
- The variable whose priority value is being set.pri
- The priority value to set for variable var
.
IloException
public void setPriorities(IloNumVar[] var, int[] pri) throws IloException
During branching, integer
variables with higher priorities are given preference over integer
variables with lower priorities. Further, variables that have priority
assigned to them are given preference over variables that do not.
Branching priorities must be nonnegative integers. By default,
the priority of a variable without a user-assigned priority is 0 (zero).
To remove a user-assigned priority from a variable, use the method
IloCplex.delPriorities
.
The parameter MIPOrdInd
by default indicates that
user-assigned priority orders should be taken into account.
When MIPOrdInd
is reset to its nondefault value
0 (zero), CPLEX ignores user-assigned priorities.
For more detail about how
priorities are applied, see the topic Issuing Priority Orders
in the ILOG CPLEX User's Manual.
var
- An array of variables whose priority values are being set.pri
- The array of priority values to use. The priority for
variable var[j]
will be set to
pri[j]
.
IloException
public void setPriorities(IloNumVar[] var, int[] pri, int start, int num) throws IloException
num
consecutive variables,
starting from the index specified by start
.
During branching, integer
variables with higher priorities are given preference over integer
variables with lower priorities. Further, variables that have priority
assigned to them are given preference over variables that do not.
Branching priorities must be nonnegative integers. By default,
the priority of a variable without a user-assigned priority is 0 (zero).
To remove a user-assigned priority from a variable, use the method
IloCplex.delPriorities
.
The parameter MIPOrdInd
by default indicates that
user-assigned priority orders should be taken into account.
When MIPOrdInd
is reset to its nondefault value
0 (zero), CPLEX ignores user-assigned priorities.
For more detail about how
priorities are applied, see the topic Issuing Priority Orders
in the ILOG CPLEX User's Manual.
var
- An array containing the variables whose priority
values are being set.pri
- An array containing the priority value to use. The
priority for variable var[j]
will be set to
pri[j]
, for
j = start, ..., start+num-1
.start
- The index of the first element in var
and
pri
to consider.num
- The number of consecutive elements
in var
and
pri
to consider.
IloException
public void setDirection(IloNumVar var, IloCplex.BranchDirection dir) throws IloException
var
- The variable whose branching direction is being set.dir
- The branching direction to set for variable
var
.
IloException
IloCplex.BranchDirection
public void setDirections(IloNumVar[] var, IloCplex.BranchDirection[] brdir) throws IloException
var
- The array of variables whose branching directions are
being set.brdir
- The array of branching directions to use. The branching
direction of variable var[j]
will be set
to brdir[j]
.
IloException
IloCplex.BranchDirection
public void setDirections(IloNumVar[] var, IloCplex.BranchDirection[] brdir, int start, int num) throws IloException
num
consecutive
variables, starting from the index specified by start
.
var
- An array containing the variables whose
branching directions are being set.brdir
- An array containing the branching directions to use.
The branching direction of variable
var[j]
will be set to brdir[j]
for
j = start, ..., start+num-1
.start
- The first elements in var
and
brdir
to consider.num
- The number of elements in var
and
brdir
to consider.
IloException
IloCplex.BranchDirection
public void delPriority(IloNumVar var) throws IloException
var
.
var
- The variable whose branch priority assignment is being
removed.
IloException
public void delPriorities(IloNumVar[] var) throws IloException
var
.
var
- The array of variables whose branch priority assignments
are being removed.
IloException
public void delPriorities(IloNumVar[] var, int start, int num) throws IloException
num
consecutive variables in the array var
,
starting with the variable var[start]
.
var
- An array containing the variables whose branch priority
assignments are to be removed.start
- The index of the first variable in var
from
which the priority order assignment is to be removed.num
- The number of consecutive variables
in var
from which the
priority order assignments are to be removed.
IloException
public void delDirection(IloNumVar var) throws IloException
var
.
var
- The variable whose branching direction
assignment is being removed.
IloException
public void delDirections(IloNumVar[] var) throws IloException
var
.
var
- An array of variables whose branching direction
assignments are being removed.
IloException
public void delDirections(IloNumVar[] var, int start, int num) throws IloException
num
consecutive variables in the array var
,
starting with the variable var[start]
.
var
- And array containing the variables from which the branching
direction assignments are to be removed.start
- The index of the first variable in var
from
which the branching direction assignments are to be removed.num
- The number of consecutive variables
in var
from which the
branching direction assignments are to be removed.
IloException
public int getPriority(IloNumVar var) throws IloException
var
- The variable whose branch priority is being queried.
var
. A value of
0
indicates the IloCplex
default.
IloException
public int[] getPriorities(IloNumVar[] var) throws IloException
var
- The array of variables whose branch priorities are being
queried.
var
.
If pri
is the array returned by this method,
pri[j]
is the branch priority of variable
var[j]
. A value of 0
indicates the IloCplex
default.
IloException
public int[] getPriorities(IloNumVar[] var, int start, int num) throws IloException
num
consecutive variables,
starting from the index specified by start
.
var
- An array containing the variables whose branch priorities
are being queried.start
- The index of the first variable in var
for
which to query the branch priority.num
- The number of consecutive variables
in var
for which to
query the branch priorities.
pri
is the array returned by this method,
pri[j]
is the branch priority of variable
var[j+start]
. A value of 0
indicates the IloCplex
default.
IloException
public IloCplex.BranchDirection getDirection(IloNumVar var) throws IloException
This method returns
the branch direction assigned to the variable var
by the method
IloCplex.setDirection
.
If no branch direction has been assigned to the variable,
IloCplex.BranchDirection.Global
is returned.
var
- The variable whose branch direction is being queried.
var
.
IloException
public IloCplex.BranchDirection[] getDirections(IloNumVar[] var) throws IloException
This method returns
the branch direction assigned
by the method
IloCplex.setDirections
to each variable in the array.
If no branch direction has been assigned to a variable,
IloCplex.BranchDirection.Global
is returned.
var
- An array of variables whose branch directions
are being queried.
var
.
If dir
is the array returned by this method,
dir[j]
is the branch direction of variable
var[j]
.
IloException
public IloCplex.BranchDirection[] getDirections(IloNumVar[] var, int start, int num) throws IloException
num
consecutive
variables, starting from the index specified by var[start]
.
If no branch direction has been assigned to a variable,
IloCplex.BranchDirection.Global
will be returned for it.
var
- The array containing the variables whose
branch directions are being queried.start
- The index of the first variable in var
for
which to query the branch directions.num
- The number of consecutive variables
in var
for which to
query the branch directions.
dir
is the array returned by this method,
dir[j]
is the branch direction of variable
var[j+start]
.
IloException
public void writeOrder(java.lang.String name) throws IloException
name
.
A priority order file contains the branching direction and branch
priority settings for the variables in the active model.
By convention, the file extension is .ord
.
The ORD file format is documented in the reference manual
ILOG CPLEX File Formats.
name
- The name of the file to which the priority order is written.
IloException
IloCplex.readOrder(java.lang.String)
public void writeConflict(java.lang.String name) throws IloException
name
.
name
- The name of the file to which the conflict is written.
IloException
public void writeParam(java.lang.String name) throws IloException
name
for all the
CPLEX parameters that are not currently
set at their default.
By convention, the file extension is .prm
.
The PRM file format is documented in the reference manual
ILOG CPLEX File Formats.
name
- The name of the file to write.
IloException
IloCplex.readParam(java.lang.String)
public void writeBasis(java.lang.String name) throws IloException
name
.
By convention, the file extension is .bas
.
The BAS file format is documented in the reference manual
ILOG CPLEX File Formats.
name
- The name of the file to write.
IloException
IloCplex.readBasis(java.lang.String)
public void writeSolution(java.lang.String name) throws IloException
name
.
A SOL file can later be read back into CPLEX with the method
readSolution
.
By convention, the file extension is .sol
.
The SOL file format is documented in the reference manual
ILOG CPLEX File Formats and in the
stylesheet solution.xsl
and schema
solution.xsd
in the include
directory of the product. Samples of its use appear in the
examples distributed with the product and in the
ILOG CPLEX User's Manual.
name
- The name of the file to write.
IloException
IloCplex.readSolution(java.lang.String)
public void writeVectors(java.lang.String name) throws IloException
IloException
public void writeTextSolution(java.lang.String name) throws IloException
IloException
public void writeMIPStart(java.lang.String name) throws IloException
name
.
By convention, the file extension is .sol
.
The SOL file format is documented in the reference manual
ILOG CPLEX File Formats and in the
stylesheet solution.xsl
and schema
solution.xsd
in the include
directory of the product. Samples of its use appear in the
examples distributed with the product and in the
ILOG CPLEX User's Manual.
name
- The name of the file to write.
IloException
IloCplex.readMIPStart(java.lang.String)
public void readOrder(java.lang.String name) throws IloException
name
and copies the priority order information
into the invoking CPLEX problem object.
The parameter MipOrdInd
must be on (its default setting) for the priority order
to be used to start a subsequent optimization.
The names in the ORD file must match names in the active model.
By convention, the file extension is .ord
.
The ORD file format is documented in the reference manual
ILOG CPLEX File Formats.
name
- The name of the file to read.
IloException
IloCplex.writeOrder(java.lang.String)
public void readParam(java.lang.String name) throws IloException
name
and applies them to the invoking object.
All parameter settings corresponding to those read from the file and that were previously active are overridden.
By convention, the file extension is .prm
.
The PRM file format is documented in the reference manual
ILOG CPLEX File Formats.
name
- The name of the file to read.
IloException
IloCplex.writeParam(java.lang.String)
public void readBasis(java.lang.String name) throws IloException
name
,
and copies that basis into the invoking object.
The parameter
AdvInd
must not be 0 (zero) for the basis to be used to start
a subsequent optimization.
By convention, the file extension is .bas
.
The BAS file format is documented in the reference manual
ILOG CPLEX File Formats.
name
- The name of the file to read.
IloException
IloCplex.writeBasis(java.lang.String)
public void readSolution(java.lang.String name) throws IloException
name
and copies this information into the invoking object.
This routine is used to initiate a crossover from a
barrier solution, to restart the simplex method with an advanced
basis, or to specify all the variable values for a MIP start.
The parameter AdvInd
must
not be 0 (zero) in order for the solution file to take effect.
For example, its default value, 1 (one) is an appropriate setting.
By convention, the file extension is .sol
.
The SOL file format is documented in the reference manual
ILOG CPLEX File Formats and in the
stylesheet solution.xsl
and schema
solution.xsd
in the include
directory of the product. Samples of its use appear in the
examples distributed with the product and in the
ILOG CPLEX User's Manual.
name
- The name of the file to read.
IloException
IloCplex.writeSolution(java.lang.String)
public void readVectors(java.lang.String name) throws IloException
IloException
public void readMIPStart(java.lang.String name) throws IloException
name
and
copies the MIP start information into the invoking object.
The parameter AdvInd
must not be 0 (zero)
in order for the MIP start information to be used to start
a subsequent optimization.
For example, its default value, 1 (one) is an appropriate setting.
By convention, the file extension is .sol
.
The SOL file format is documented in the reference manual
ILOG CPLEX File Formats and in the
stylesheet solution.xsl
and schema
solution.xsd
in the include
directory of the product. Samples of its use appear in the
examples distributed with the product and in the
ILOG CPLEX User's Manual.
name
- The name of the file to read.
IloException
IloCplex.writeMIPStart(java.lang.String)
public void use(IloCplex.Callback cb) throws IloException
Callbacks are objects with a user-written method main
that are called regularly during the optimization of the active
model. This object must be implemented as a class derived from a
subclass of IloCplex.Callback
class, and the abstract
method main
must be implemented for this class.
There are several places where the IloCplex
algorithms call
a callback. IloCplex
provides several different types of
callbacks, and each is implemented as a specific subclass of
IloCplex.Callback
.
IloCplex
can use only one callback of a given type at a
time. Thus, when calling method use
several times with
callbacks of the same type, only the callback passed at the last call of
method use
will be executed during the optimization.
However, callbacks of different types can be used simultaneously.
cb
- The callback to be used from now on. The type of the callback
object being passed determines which callback is being installed.
If a callback of the same type has previously been installed,
the new callback will replace the old one.
IloException
IloCplex.Callback
public void clearCallbacks() throws IloException
IloCplex
object.
IloException
public IloLinearNumExpr getRay() throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method
returns a linear expression representing an unbounded direction for the
active model if it has been proven unbounded by one of the simplex
methods. If a*x + b*y
is the returned by this method, it
represents an unbounded direction vector with an x
coordinate of a
and y
coordinate of
b
.
IloException
public IloCopyable getDiverging() throws IloException
IloNumVar
or an instance of
IloConstraint
extracted to the invoking
IloCplex
optimizer.
It is of type IloNumVar
if the
diverging column corresponds to a variable, or of type
IloConstraint
if the diverging column corresponds to the
slack variable of a constraint.
IloException
public double dualFarkas(IloConstraint[] rng, double[] y) throws IloException
Important:
Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.
This method
returns a Farkas proof of infeasibility for the active LP model after
it has been proven to be infeasible by one of the simplex optimizers.
For every constraint i
of the active LP this method computes
a value y[i]
such that y'A >= y'b
, where
A
denotes the constraint matrix.
For more detailed information about the Farkas proof of infeasibility,
see the C function CPXdualfarkas
, documented
in the reference manual of the Callable Library.
rng
- Array of length getNrows
where constraints
corresponding to the values in y
are returned.y
- array of length getNrows
.
y'b - y'A z
for vector
z
defined such that z[j] = ub[j]
if
y'A[j] > 0
and z[j] = lb[j]
if
y'A[j] < 0
for all variables j
.
IloException
public void qpIndefCertificate(IloNumVar[] var, double[] x) throws IloException
x'Q x < 0
in matrix terms) to prove the
indefiniteness.
var
- An array of length getNcols
where the variables
of the active model are returned.x
- An array of length getNcols
.
By setting var[j]
to x[j]
for all variables, the quadratic term of
the objective function evaluates to a negative value.
IloException
public void end()
IloCplex
license held by the invoking object,
and all the memory allocated by it.
When you no longer use an instance of IloCplex
and any Concert model
created with it, you should call the method end
to
release the license. After a call of the method end
,
the invoking IloCplex
object and
all objects that have been created with it (such as variables and
constraints) may no longer be used. Attempting to use
them subsequently will cause the
exception IloCplex.CplexEndedException
to be thrown.
public static void registerLicense(java.lang.String ilm_CPLEX_license, int ilm_CPLEX_license_signature) throws IloException
The registerLicense
method passes memory-based information
to the ILOG License Manager embedded inside the class
IloCplex
.
ilm_CPLEX_license
- A string containing the RUNTIME key, which is obtained
from ILOG.ilm_CPLEX_license_signature
- An integer associated with the RUNTIME key, obtained from
ILOG with the key.
IloException
- if there is
invalid information in the license key passed into the routine.
IloException
public static void putenv(java.lang.String envstr) throws IloException
ILOG_LICENSE_FILE
environment variable
used by CPLEX.
This function sets the ILOG_LICENSE_FILE
environment variable to specify the path to the file containing the
ILOG license key. It must not be used to set any other environment
variable.
envstr
- String of the form ILOG_LICENSE_FILE=...
,
where ... is the setting of the environment
variable ILOG_LICENSE_FILE
.
IloException
- if the environment
variable could not be set.
IloException
public final IloCplex.Goal and(IloCplex.Goal goal1, IloCplex.Goal goal2)
and
goal from two arguments.
This goal pushes the parameter goals onto the goal stack in reverse order. When the goals are subsequently popped from the goal stack, they will be executed in the order in which they were listed as parameters.
goal1
- A goal to be pushed on the goal stack.goal2
- A goal to be pushed on the goal stack.
and
goal composed from the goals
passed as parameters.public final IloCplex.Goal and(IloCplex.Goal goal1, IloCplex.Goal goal2, IloCplex.Goal goal3)
and
goal from three arguments.
This goal pushes the parameter goals onto the goal stack in reverse order. When the goals are subsequently popped from the goal stack, they will be executed in the order in which they were listed as parameters.
goal1
- A goal to be pushed on the goal stack.goal2
- A goal to be pushed on the goal stack.goal3
- A goal to be pushed on the goal stack.
and
goal composed from the goals
passed as parameters.public final IloCplex.Goal and(IloCplex.Goal goal1, IloCplex.Goal goal2, IloCplex.Goal goal3, IloCplex.Goal goal4)
and
goal from four arguments.
This goal pushes the parameter goals onto the goal stack in reverse order. When the goals are subsequently popped from the goal stack, they will be executed in the order in which they were listed as parameters.
goal1
- A goal to be pushed on the goal stack.goal2
- A goal to be pushed on the goal stack.goal3
- A goal to be pushed on the goal stack.goal4
- A goal to be pushed on the goal stack.
and
goal composed from the goals
passed as parameters.public final IloCplex.Goal and(IloCplex.Goal goal1, IloCplex.Goal goal2, IloCplex.Goal goal3, IloCplex.Goal goal4, IloCplex.Goal goal5)
and
goal from five arguments.
This goal pushes the parameter goals onto the goal stack in reverse order. When the goals are subsequently popped from the goal stack, they will be executed in the order in which they were listed as parameters.
goal1
- A goal to be pushed on the goal stack.goal2
- A goal to be pushed on the goal stack.goal3
- A goal to be pushed on the goal stack.goal4
- A goal to be pushed on the goal stack.goal5
- A goal to be pushed on the goal stack.
and
goal composed from the goals
passed as parameters.public final IloCplex.Goal and(IloCplex.Goal goal1, IloCplex.Goal goal2, IloCplex.Goal goal3, IloCplex.Goal goal4, IloCplex.Goal goal5, IloCplex.Goal goal6)
and
goal from six arguments.
This goal pushes the parameter goals onto the goal stack in reverse order. When the goals are subsequently popped from the goal stack they will be executed in the order in which they were listed as parameters.
goal1
- A goal to be pushed on the goal stack.goal2
- A goal to be pushed on the goal stack.goal3
- A goal to be pushed on the goal stack.goal4
- A goal to be pushed on the goal stack.goal5
- A goal to be pushed on the goal stack.goal6
- A goal to be pushed on the goal stack.
and
goal composed from the goals
passed as parameters.public final IloCplex.Goal or(IloCplex.Goal goal1, IloCplex.Goal goal2)
or
goal from two arguments.
This goal creates one child node for each argument. For each child,
it copies the goal stack of the current node to the child, and then it
pushes the appropriate goal from the argument list onto that
goal stack.
The goal then deactivates the current node, which will cause
IloCplex
to pick a new active node from the branch-and-cut
tree to process next.
goal1
- A goal to be used for a child node.goal2
- A goal to be used for a child node.
or
goal composed from the goals
passed as parameters.public final IloCplex.Goal or(IloCplex.Goal goal1, IloCplex.Goal goal2, IloCplex.Goal goal3)
or
goal from three arguments.
This goal creates one child node for each argument. For each child,
it copies the goal stack of the current node to the child, and then it
pushes the appropriate goal from the argument list onto that
goal stack.
The goal then deactivates the current node, which will cause
IloCplex
to pick a new active node from the branch-and-cut
tree to process next.
goal1
- A goal to be used for a child node.goal2
- A goal to be used for a child node.goal3
- A goal to be used for a child node.
or
goal composed from the goals
passed as parameters.public final IloCplex.Goal or(IloCplex.Goal goal1, IloCplex.Goal goal2, IloCplex.Goal goal3, IloCplex.Goal goal4)
or
goal from four arguments.
This goal creates one child node for each argument. For each child,
it copies the goal stack of the current node to the child, and then it
pushes the appropriate goal from the argument list onto that
goal stack.
The goal then deactivates the current node, which will cause
IloCplex
to pick a new active node from the branch-and-cut
tree to process next.
goal1
- A goal to be used for a child node.goal2
- A goal to be used for a child node.goal3
- A goal to be used for a child node.goal4
- A goal to be used for a child node.
or
goal composed from the goals
passed as parameters.public final IloCplex.Goal or(IloCplex.Goal goal1, IloCplex.Goal goal2, IloCplex.Goal goal3, IloCplex.Goal goal4, IloCplex.Goal goal5)
or
goal from five arguments.
This goal creates one child node for each argument. For each child,
it copies the goal stack of the current node to the child, and then it
pushes the appropriate goal from the argument list onto that
goal stack.
The goal then deactivates the current node, which will cause
IloCplex
to pick a new active node from the branch-and-cut
tree to process next.
goal1
- A goal to be used for a child node.goal2
- A goal to be used for a child node.goal3
- A goal to be used for a child node.goal4
- A goal to be used for a child node.goal5
- A goal to be used for a child node.
or
goal composed from the goals
passed as parameters.public final IloCplex.Goal or(IloCplex.Goal goal1, IloCplex.Goal goal2, IloCplex.Goal goal3, IloCplex.Goal goal4, IloCplex.Goal goal5, IloCplex.Goal goal6)
or
goal from six arguments.
This goal creates one child node for each argument. For each child,
it copies the goal stack of the current node to the child, and then it
pushes the appropriate goal from the argument list onto that
goal stack.
The goal then deactivates the current node, which will cause
IloCplex
to pick a new active node from the branch-and-cut
tree to process next.
goal1
- A goal to be used for a child node.goal2
- A goal to be used for a child node.goal3
- A goal to be used for a child node.goal4
- A goal to be used for a child node.goal5
- A goal to be used for a child node.goal6
- A goal to be used for a child node.
or
goal composed from the goals
passed as parameters.public final IloCplex.Goal branchAsCplex()
IloCplex
would in the absence of any goal at the current node.
This
goal allows you to proceed with the built-in search
strategy while retaining the option to intervene at any node.
For example, a goal whose execute
method starts with
if (!isIntegerFeasible()) return cplex.and(cplex.branchAsCplex(), this);
would do something different from the built-in IloCplex
search procedure only when an integer feasible solution is found.
public final IloCplex.Goal apply(IloCplex.Goal goal, IloCplex.NodeEvaluator evaluator)
evaluator
to
the search tree defined by the goal
. In doing so, it
changes the order of processing of the active nodes of the search tree
defined by goal
according to evaluator
evaluator
to the search tree defined by
goal
.public final IloCplex.Goal limitSearch(IloCplex.Goal goal, IloCplex.SearchLimit limit)
goal
, as specified by
limit
. All nodes in a subtree that have not
yet been explored when the limit for that subtree is reached
will be discarded.
goal
to
search limit limit
.public final boolean solve(IloCplex.Goal goal) throws IloException
goal
. This is done by pushing
goal
onto the goal stack of the root node of the
branch-and-cut search tree before starting the search.
goal
- The goal that controls the branch-and-cut search to be
performed.
IloException
IloCplex.Goal
public final IloCplex.Goal failGoal()
public final IloCplex.Goal constraintGoal(IloConstraint cut) throws IloException
cut
. When this goal is executed, the constraint
will be added to the current node and its descendents as a local cut.
Thus, this constraint will be active only in the subtree rooted
at the node where the goal was executed.
cut
- The constraint to added to the node and its descendents.
cut
.
IloException
public final IloCplex.Goal constraintGoal(IloConstraint[] cut) throws IloException
cut
. When this goal is executed, the
constraints will be added to the current node and its descendents as a
local cut.
Thus, these constraints will be active only in the subtree rooted
at the node where the goal was executed.
cut
- The constraints to added to the current subtree.
cut
.
IloException
public final IloCplex.Goal globalCutGoal(IloConstraint cut) throws IloException
cut
. When this goal is executed, the
constraint will be added to the active model as a global cut. This
constraint will be respected at every node explored from that
point on, not just those in the current subtree.
cut
- The constraint to added as a global cut.
cut
as a global cut.
IloException
public final IloCplex.Goal globalCutGoal(IloConstraint[] cut) throws IloException
cut
. When this goal is executed, the
constraints will be added to the active model as global cuts. These
constraints will be respected at every node explored from that
point on, not just those in the current subtree.
cut
- The constraints to added as global cuts.
cut
as global cuts.
IloException
public final IloCplex.Goal solutionGoal(IloNumVar[] vars, double[] vals) throws IloException
When the solution goal
is executed, it attempts to inject the solution specified by
setting the variables listed in vars
to the corresponding
values listed in val
as a new incumbent.
IloCplex
will not blindly accept such a solution. Instead,
it will make sure that this solution is compatible with both the
model and the goals. When checking feasibility with goals, it will
check feasibility with
both goals that have already been executed and goals that are still on the
goal stack. Thus, in particular, IloCplex
will reject any
solution that is not compatible with the branching that has been done so
far. It then continues by checking compatibility with the goals still
remaining on the goal stack, including those that may get created by them.
Only if the proposed solution remains feasible and has a better objective
value than the current incumbent will it be used to replace the current
incumbent.
vars
- An array of variables for which solution values are
specified.vals
- The array of solution values for the variables in
vars
. Value vals[j]
is the
proposed solution value for variable vars[j]
.
IloException
public IloCplex.Goal eqGoal(IloNumExpr expr, double rhs) throws IloException
expr == rhs
. When this goal is executed, the constraint
will be added to the current node and all its descendents as a local cut.
Thus, the constraint will be active only in the subtree rooted at the
node where the goal was executed.
expr
- The lefthand side expression of the constraint.rhs
- The righthand side value of the constraint.
IloException
public IloCplex.Goal eqGoal(IloNumExpr expr1, IloNumExpr expr2) throws IloException
expr1 == expr2
. When this goal is executed, the constraint
will be added to the current node and all its descendents as a local cut.
Thus, the constraint will be active only in the subtree rooted at
the node where the goal was executed.
expr1
- The lefthand side expression of the constraint.expr2
- The righthand side expression of the constraint.
IloException
public IloCplex.Goal eqGoal(double lhs, IloNumExpr expr) throws IloException
lhs == expr
. When this goal is executed, the constraint
will be added to the current node and all its descendents as a local cut.
Thus, the constraint will be active only in the subtree rooted at
the node where the goal was executed.
lhs
- The lefthand side value of the constraint.expr
- The righthand side expression of the constraint.
IloException
public IloCplex.Goal geGoal(IloNumExpr expr, double rhs) throws IloException
expr >= rhs
. When this goal is executed, the constraint
will be added to the current node and all its descendents as a local cut.
Thus, the constraint will be active only in the subtree rooted at
the node where the goal was executed.
expr
- The lefthand side expression of the constraint.rhs
- The righthand side value of the constraint.
IloException
public IloCplex.Goal geGoal(IloNumExpr expr1, IloNumExpr expr2) throws IloException
expr1 >= expr2
. When this goal is executed, the constraint
will be added to the current node and all its descendents as a local cut.
Thus, the constraint will be active only in the subtree rooted at
the node where the goal was executed.
expr1
- The lefthand side expression of the constraint.expr2
- The righthand side expression of the constraint.
IloException
public IloCplex.Goal geGoal(double lhs, IloNumExpr expr) throws IloException
lhs >= expr
. When this goal is executed, the constraint
will be added to the current node and all its descendents as a local cut.
Thus, the constraint will be active only in the subtree rooted at
the node where the goal was executed.
lhs
- The lefthand side value of the constraint.expr
- The righthand side expression of the constraint.
IloException
public IloCplex.Goal leGoal(IloNumExpr expr, double rhs) throws IloException
expr <= rhs
. When this goal is executed, the constraint
will be added to the current node and all its descendents as a local cut.
Thus, the constraint will be active only in the subtree rooted at
the node where the goal was executed.
expr
- The lefthand side expression of the constraint.rhs
- The righthand side value of the constraint.
IloException
public IloCplex.Goal leGoal(IloNumExpr expr1, IloNumExpr expr2) throws IloException
expr1 <= expr2
. When this goal is executed, the constraint
will be added to the current node and all its descendents as a local cut.
Thus, the constraint will be active only in the subtree rooted at
the node where the goal was executed.
expr1
- The lefthand side expression of the constraint.expr2
- The righthand side expression of the constraint.
IloException
public IloCplex.Goal leGoal(double lhs, IloNumExpr expr) throws IloException
lhs >= expr
. When this goal is executed, the constraint
will be added to the current node and all its descendents as a local cut.
Thus, the constraint will be active only in the subtree rooted at
the node where the goal was executed.
lhs
- The lefthand side value of the constraint.expr
- The righthand side expression of the constraint.
IloException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |