IloObject | +--IloCplex
Uses CPLEX parameter names as property names to change their value. For example, the following code line:
cplex.tilim = 13;changes the time limit.
dvar int x[1..20] in 0..40; maximize sum(i in 1..20) x[i]; subject to { x[1]==0; forall(i in 1..19) x[i+1]-x[i]<=2; } execute { writeln(cplex.getObjValue()); }
Constructor Attributes | Constructor Name and Description |
---|---|
IloCplex()
|
Field Attributes | Field Name and Description |
---|---|
flow control |
The number of solutions currently in the solution pool.
|
flow control |
Status of the last method invoked on this object.
|
Method Attributes | Method Name and Description |
---|---|
all |
addCut(ct)
Adds the constraint
ct as a cut to the invoking IloCplex object. |
all |
addCuts(cts)
Adds the constraints in the array
cts as cuts to the invoking IloCplex object. |
all |
addDiversityFilter(lb, ub, dvars, weights, refs, name)
Creates and installs a named diversity filter, for the designated decision variables,
with the specified lower and upper cutoff values, reference values, and weights.
|
all |
Adds
ct as a lazy constraint to the invoking IloCplex object. |
all |
addLazyConstraints(cts)
Adds
cts as an array of lazy constraints to the invoking IloCplex object. |
flow control |
addMIPStart(dvars, values, effort, name)
Adds a named MIP start, with the specified level of effort
defined by the specified variables, and their corresponding values,
to the current problem.
|
all |
addRangeFilter(lb, ub, dvars, vals, name)
Creates a named range filter, using the specified lower bound, upper bound, decision variables, and weights.
|
all |
addUserCut(ct)
Adds a constraint
ct as a user cut to the invoking IloCplex object. |
all |
addUserCuts(cts)
Adds an array of constraints
cts as user cuts to the invoking IloCplex object. |
all |
basicPresolve(dvars, lbs, ubs, ranges, redundants)
Computes tighter bounds for the variables of a model and detects
redundant constraints in the model extracted to the invoking
IloCplex object. |
flow control |
changeMIPStart(mipstartindex, dvars, values, effort)
Changes the MIP start, designated by its index, by
assigning corresponding values to the designated variables,
and by associating the specified level of effort.
|
postprocessing flow control |
Deletes all cuts that were previously added to the invoking
IloCplex object
with the methods addCut and addCuts . |
flow control |
Deletes all lazy constraints added to the invoking
IloCplex object
with the methods addLazyConstraint and addLazyConstraints . |
flow control |
Resets CPLEX to accept another CPLEX model.
|
flow control |
Deletes all user cuts that were previously added to the invoking
IloCplex object
with the methods addUserCut and addUserCuts . |
postprocessing flow control |
conversion(dvar, type, name)
Creates an
IloConversion object,
with the specified name, for converting the
type of a variable in a model. |
all |
copyVMConfig(xml)
Copy a CPLEX VM Config file.
|
all |
delDirection(dvar)
Removes any existing branching direction assignment from the variable
dvar . |
all |
delDirections(dvars)
Removes any existing branching direction assignments from all variables in the array
dvars . |
flow control |
deleteMIPStarts(first, nb)
Deletes the designated number of MIP starts, starting
from the MIP start specified by its index.
|
flow control |
delLongAnnotation(name)
Deletes the specified annotation.
|
flow control |
delNumAnnotation(name)
Deletes the specified annotation.
|
all |
delPriorities(dvars)
Removes any existing priority order assignments from all variables in the array
dvars . |
all |
delPriority(dvar)
Removes any existing priority order assignment from the variable
dvar . |
all |
delSolnPoolSoln(begin, end)
Deletes the specified solution from the solution pool
and renumbers the indices of the remaining solutions in the pool.
|
all |
delSolnPoolSolns(first, end)
Deletes a range of solutions from the solution pool and renumbers
the indices of the remaining solutions in the pool.
|
all |
Deletes a CPLEX VM Config file.
|
all |
dualFarkas(cts, values)
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.
|
flow control |
exportModel(path)
Exports the CPLEX model to a file.
|
all |
This method frees the presolved problem.
|
all |
getAX(range)
Computes A times X, where A is the corresponding LP constraint matrix.
|
postprocessing flow control |
Accesses the currently best known bound on the optimal solution value of the problem.
|
flow control |
getCoef(ct, dvar)
returns the coefficient of the variable in the constraint; returns 0 if not mentioned.
|
flow control postprocessing |
Returns the IBM ILOG CPLEX status.
|
postprocessing flow control |
Returns a time stamp.
|
flow control |
Returns the MIP cutoff value being used during the MIP optimization.
|
postprocessing flow control |
Returns a deterministic time stamp in ticks.
|
all |
getDirection(dvar)
Gets the branching direction of a decision variable.
|
flow control |
Returns the node number where the current incumbent was found.
|
all |
getInfeasibility(dvar)
Returns the infeasibility of the decision variable
dvar in the current solution. |
all |
getLb(range)
Queries the lower bound of the ranged constraints.
|
flow control |
getLongAnnotation(name, extr)
Queries the annotation value assigned to the variable or constraint
by the specified annotation.
|
flow control |
getLongAnnotations(name, arr)
Queries the annotation value assigned to the variables or constraints
by the specified annotation.
|
postprocessing flow control |
Accesses the relative objective gap for a MIP optimization
For more information, see the class
IloCplex in the CPLEX C++ Reference Manual. |
postprocessing flow control |
getMIPStart(mipstartindex, dvars, values, isset)
Returns the level of effort associated with the MIP start
identified by
mipstartindex and defined by the arrays
dvars and vals . |
postprocessing flow control |
getMIPStartIndex(name)
Returns the index of the MIP start designated by its name.
|
postprocessing flow control |
getMIPStartName(mipstartindex)
Returns the name of the MIP start identified by its index.
|
postprocessing flow control |
getMultiObjInfo(info, num)
return the requested solution info of a sub-problem of a multi-objective problem.
|
postprocessing flow control |
return the number of sub-problems that where successfully
solved during the last optimization of a multi-objective problem.
|
flow control |
Returns the number of barrier iterations from the last solve.
|
postprocessing flow control |
Returns the number of binary variables in the matrix representation of
the active model in the invoking
IloCplex object. |
postprocessing flow control |
getNcols()
Accesses the number of columns extracted for the invoking algorithm.
|
flow control |
Returns the number of dual exchange operations in the crossover of the last call
to the
solve method, if barrier with crossover was used for solving an LP or QP. |
flow control |
Returns the number of dual push operations in the crossover of the last call to
the
solve method, if barrier with crossover was used for solving an LP or QP. |
flow control |
Returns the number of primal exchange operations in the crossover of the last call of
the
solve method, if barrier with crossover was used for solving an LP or QP. |
flow control |
Returns the number of primal push operations in the crossover of the last call of
the
solve method, if barrier with crossover was used for solving an LP or QP. |
flow control |
Returns the number of dual superbasic variables in the current solution of
the invoking
IloCplex object. |
postprocessing flow control |
Returns the number of filters currently associated with the solution pool.
|
postprocessing flow control |
Returns the number of integer variables in the matrix representation of
the active model in the invoking
IloCplex object. |
postprocessing flow control |
Accesses the total number of iterations executed so far during the current optimization
to solve the node relaxations.
|
postprocessing flow control |
Returns the number of MIP starts associated with the current problem.
|
postprocessing flow control |
Accesses the number of nodes already processed in the current optimization.
|
postprocessing flow control |
Accesses the number of branch-and-cut nodes that remain to be processed in the current solution.
|
postprocessing flow control |
getNNZs()
Accesses the number of nonzeros extracted to the constraint matrix A of the invoking algorithm.
|
flow control |
If a simplex method was used for solving a continuous model,
this method returns the number of iterations in phase one of the last call to the
solve method. |
flow control |
Returns the number of primal superbasic variables in the current solution
of the invoking
IloCplex object. |
postprocessing flow control |
getNQCs()
Returns the number of quadratic constraints
extracted from the active model for the invoking algorithm.
|
postprocessing flow control |
getNrows()
Accesses the number of rows extracted for the invoking algorithm.
|
flow control |
Returns the number of semicontinuous variables in the matrix representation
of the active model in the invoking
IloCplex object. |
flow control |
Returns the number of semi-integer variables in the matrix representation
of the active model in the invoking
IloCplex object. |
flow control |
Returns the number of sifting iterations performed for solving the last LP with algorithm type
Sifting , or, equivalently, the number of work LPs that have been solved for it. |
flow control |
Returns the number of sifting iterations performed for solving the last LP with algorithm type
Sifting in order to achieve primal feasibility. |
postprocessing flow control |
getNSOSs()
Returns the number of SOSs extracted for the invoking algorithm.
|
flow control |
getNumAnnotation(name, extr)
Queries the annotation value assigned to the variable or constraint
by the specified annotation.
|
flow control |
getNumAnnotations(name, arr)
Queries the annotation value assigned to the variables or constraints
by the specified annotation.
|
flow control |
Returns the number of logical cores on the platform where CPLEX is currently running.
|
flow control |
getObjCoef(dvar)
Returns the coefficient of a decision variable in the objective expression.
|
postprocessing flow control |
getObjValue(i)
Accesses the objective value of the current solution or the solution identifier from the solution pool.
|
all |
getPriorities(priorities, dvars)
Returns query branch priorities previously assigned to variables listed in
dvars
with the method setPriority or setPriorities . |
all |
getPriority(dvar)
Accesses the priority level of a decision variable.
|
flow control |
Computes the mean of the objective values of the solutions currently in the solution pool.
|
flow control |
Accesses the number of solutions that have been replaced
according to the solution pool replacement strategy.
|
flow control |
Accesses the number of solutions currently in the solution pool.
|
postprocessing flow control |
Returns the time it took to solve.
|
all |
getUb(range)
Queries the upper bound of the ranged constraints.
|
flow control |
This method returns a string specifying the version of
CPLEX.
|
flow control |
Queries whether an IloInt-valued annotation of the
specified name is available in the IloCplex object.
|
flow control |
Queries whether an IloNum-valued annotation of the
specified name is available in the IloCplex object.
|
all |
Returns if the CPLEX has a VM Config file.
|
flow control |
importModel(path)
Imports the CPLEX model from a file.
|
flow control |
Returns
true if a dual feasible solution is recorded in the
invoking IloCplex object and can be queried. |
postprocessing flow control |
isMIP()
This method returns
true if the invoking algorithm
has extracted a model that is a MIP
(mixed-integer programming problem) and false otherwise. |
flow control |
Returns
true if a primal feasible solution is recorded in the
invoking IloCplex object and can be queried. |
flow control |
isQC()
Returns
true if the invoking algorithm has extracted a model
that is quadratically constrained. |
flow control |
isQO()
Returns
true if the invoking algorithm has extracted a model
that has quadratic objective function terms. |
flow control |
newLongAnnotation(name, value)
Creates a new annotation of type IloInt for the
specified name and assigns the specified default value to
all modeling objects in the current IloCplex object.
|
flow control |
newNumAnnotation(name, value)
Creates a new annotation of type IloNum for the
specified name and assigns the specified default value to
all modeling objects in the current IloCplex object.
|
flow control |
Queries the number of annotations of type IloInt.
|
flow control |
Queries the number of annotations of type IloNum.
|
flow control |
populate()
Populates the solution pool.
|
all |
protectVariables(dvars)
Specifies an array of decision variables that should not be substituted out of the problem.
|
all |
qpIndefCertificate(dvars, vals)
Computes assignments (returned in array vals) to all variables (returned in array dvars)
such that the quadratic term of the objective function evaluates to
a negative value to prove the indefiniteness.
|
flow control |
readAnnotations(path)
Reads annotations from the file with the specified name
and installs them in the
IloCplex object. |
flow control |
readBasis(file)
Reads the CPLEX basis from a file.
|
postprocessing flow control |
readMIPStarts(name)
Reads the MST file denoted by
name and
copies the MIP start information into the invoking IloCplex
object. |
postprocessing flow control |
readOrder(name)
Reads a priority order from a file in ORD format into
the invoking
IloCplex object. |
all |
readVMConfig(file)
Reads a CPLEX VM Config file.
|
all |
setArrayBounds(cts, lbs, ubs)
Sets the bounds of an array of constraints
|
flow control |
setArrayCoefs(ct, dvars, coefs)
Sets the coefficients for an array of decision variables in a constraint.
|
all |
setArrayLbs(cts, lbs)
Sets the lower bounds of an array of constraints.
|
all |
setArrayUbs(cts, ubs)
Sets the upper bounds of an array of constraints.
|
all |
setBounds(ranges, lbs, ubs)
Sets the lower and upper bounds of the ranged constraints.
|
flow control |
setCoef(ct, dvar, coef)
Sets the coefficient of a decision variable in the constraint.
|
all |
setDirection(dvar, direction)
Defines the branching direction of a decision variable.
|
all |
setLb(range, lb)
Sets the lower bound of the ranged constraints.
|
flow control |
setLongAnnotation(name, extr, value)
Assigns value as the value of the annotation
of the variable or constraint for the specified annotation.
|
flow control |
setLongAnnotations(name, extrs, value)
Assigns values as the values of the annotation
of the variables or constraints for the specified annotation.
|
flow control |
setNumAnnotation(name, extr, value)
Assigns value as the value of the annotation
of the variable or constraint for the specified annotation.
|
flow control |
setNumAnnotations(name, extrs, value)
Assigns values as the values of the annotation
of the variables or constraints for the specified annotation.
|
flow control |
setObjCoef(dvar, coef)
Sets the coefficient of a decision variable in the objective expression.
|
all |
setPriorities(dvars, priorities)
Sets the priority order for all variables in the array
dvars
to the corresponding value in the array priorities . |
all |
setPriority(dvar, priority)
Sets the priority order of a decision variable.
|
all |
setUb(range, ub)
Sets the upper bound of the ranged constraints.
|
flow control |
solve()
Solves the model currently extracted to the invoking
IloCplex object. |
flow control |
solveFixed(optional)
Solves the fixed active model using a solution from the solution pool.
|
flow control |
writeAnnotations(path)
Writes all annotations of the
IloCplex object to the file with
the specified name. |
flow control |
writeBasis(file)
Writes the current CPLEX basis to the specified file.
|
flow control |
writeBendersAnnotation(path)
Writes the annotation that CPLEX would generate automatically for Benders
decomposition to a file with the specified name.
|
postprocessing flow control |
writeMIPStarts(name, first, nb)
Writes MIP start information to the file denoted by
|
end |
IloCplex
in the CPLEX C++ Reference Manual.
ct
as a cut to the invoking IloCplex
object.
The cut is not extracted in the same way as the regular constraints in a model,
but is only copied when the method addCut
is invoked.
Thus, ct
may be deleted or modified after addCut
has been called
and notification of the change will not be sent to the invoking IloCplex
object.
When columns are deleted from the extracted model, all cuts are deleted as well
and need to be re-extracted if they should be considered.
Cuts are not part of the root problem, but are considered on an as-needed basis.
A solution computed by IloCplex
is guaranteed to satisfy all cuts added with this method.
cts
as cuts to the invoking IloCplex
object.
Everything said for addCut
applies equally to each of the cuts given in the array cts
.
addDiversityFilter
,
see the class IloCplex
in the CPLEX C++ Reference Manual.
ct
as a lazy constraint to the invoking IloCplex
object.
For more information on addLazyConstraint
,
see the class IloCplex
in the CPLEX C++ Reference Manual.
cts
as an array of lazy constraints to the invoking IloCplex
object.
For more information on addLazyConstraints
,
see the class IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
in the CPLEX C++ Reference Manual.
ct
as a user cut to the invoking IloCplex
object.
The constraint ct
is copied into the user cut pool; the ct
itself
is not part of the pool, so changes to ct
after it has been copied into the
user cut pool will not affect the user cut pool.
For more information, see the class IloCplex
in the CPLEX C++ Reference Manual.
cts
as user cuts to the invoking IloCplex
object.
Everything said for addUserCut
applies to each of the user cuts given in the array cts
.
For more information, see the class IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
object.
For more information, see the class IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
object
with the methods addCut
and addCuts
.
IloCplex
object
with the methods addLazyConstraint
and addLazyConstraints
.
This method is equivalent to clearCuts
.
For more information, see the class IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
object
with the methods addUserCut
and addUserCuts
.
For more information, see the class IloCplex
in the CPLEX C++ Reference Manual.
IloConversion
object,
with the specified name, for converting the
type of a variable in a model.
The type is one of "ILOINT", "ILOFLOAT", "ILOBOOL"
.
For more information, see the class IloCplex
in the CPLEX C++ Reference Manual.
dvar
.
IloConversion
object.
dvar
.
dvars
.
dvars
.
dvar
.
IloCplex
in the CPLEX C++ Reference Manual..
IloCplex
in the CPLEX C++ Reference Manual.
Reduce
, the presolved problem
is freed when an optimal solution is found; however,
it is not freed if Reduce
has been set to 1 (primal reductions) or to 2 (dual reductions).
In these instances, the function freePresolve
can be used when necessary to free it manually.
IloCplex
object. The range must be part of the extracted model.
IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
object is an LP or QP,
this method returns +IloInfinity
or -IloInfinity
, depending on the optimization sense.
To measure elapsed deterministic time in ticks between a starting point and ending point of an operation, take the deterministic time stamp at the starting point; take the deterministic time stamp at the ending point; subtract the starting deterministic time stamp from the ending deterministic time stamp.
The absolute value of the deterministic time stamp is not meaningful.
"BranchDown", "BranchGlobal", "BranchUp"
.IloCplex
object is an LP or a QP, this method returns 0 (zero).
dvar
in the current solution.
The infeasibility value returned is 0 (zero) if the variable bounds are satisfied.
If the infeasibility value is negative, it specifies the amount by which the lower bound of the variable
must be changed; if the value is positive, it specifies the amount by which the upper bound of the variable
must be changed. This method does not check for integer infeasibility.
IloCplex
in the CPLEX C++ Reference Manual.
mipstartindex
and defined by the arrays
dvars
and vals
. The argument isset
designates which members of dvars
and which corresponding
values of values
participate in the MIP start - one of:
"MIPStartAuto", "MIPStartCheckFeas", "MIPStartSolveFixed", "MIPStartSolveMIP", "MIPStartRepair"
.
For more information, see the class IloCplex
in the CPLEX C++ Reference Manual.
dvars
and which corresponding
values of values
participate in the MIP start
IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
in the CPLEX C++ Reference Manual.
"MultiObjTime", "MultiObjDetTime", "MultiObjObjValue", "MultiObjBestObjValue",
"MultiObjError", "MultiObjStatus", "MultiObjMethod", "MultiObjPriority",
"MultiObjNbarierIterations", "MultiObjNsiftingIterations", "MultiObjNsiftingPhase1Iterations",
"MultiObjNdegenerateIterations", "MultiObjNiterations", "MultiObjNphase1Iterations",
"MultiObjNprimalPushes", "MultiObjNprimalExchanges", "MultiObjNdualPushes",
"MultiObjNdualExchanges", "MultiObjNnodes", "MultiObjNnodesLeft"
.
For more information, see the class IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
object.
IloCplex
in the CPLEX C++ Reference Manual.
solve
method, if barrier with crossover was used for solving an LP or QP.
solve
method, if barrier with crossover was used for solving an LP or QP.
solve
method, if barrier with crossover was used for solving an LP or QP.
solve
method, if barrier with crossover was used for solving an LP or QP.
IloCplex
object.
IloCplex
object.
solve
method.
IloCplex
object.
IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
object.
IloCplex
object.
Sifting
, or, equivalently, the number of work LPs that have been solved for it.
Sifting
in order to achieve primal feasibility.
dvars
with the method setPriority
or setPriorities
. When the function returns,
priorities[i]
will contain the priority value assigned for variable dvars[i]
.
If no priority has been assigned to dvars[i]
, priorities[i]
will contain 0 (zero).
IloCplex::getCplexTime
in the CPLEX C++ Reference Manual.
IloCplex
in the CPLEX C++ Reference Manual.
true
if a dual feasible solution is recorded in the
invoking IloCplex
object and can be queried.
true
if the invoking algorithm
has extracted a model that is a MIP
(mixed-integer programming problem) and false
otherwise.
Methods for accessing duals and reduced cost basis work only if the model is not a MIP.
true
if it is a MIP model.true
if a primal feasible solution is recorded in the
invoking IloCplex
object and can be queried.
true
if the invoking algorithm has extracted a model
that is quadratically constrained. Otherwise, it returns false
.
For an explanation of quadratically constrained see the document:
User's Manual for CPLEX > Continuous optimization > Solving problems with quadratic constraints (QCP) >
Identifying a quadratically constrained program (QCP) > Characteristics of a quadratically constrained program
true
if the invoking algorithm has extracted a model
that has quadratic objective function terms. Otherwise, it returns false
.
For more information, see the document:
User's Manual for CPLEX > Continuous optimization > Solving problems with a quadratic objective (QP)
populate
, see the class IloCplex
in the
CPLEX C++ Reference Manual.
true
if the populate has been successful.IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
object.
This method is experimental.
name
and
copies the MIP start information into the invoking IloCplex
object. The parameter AdvInd
must be turned on
(its default is 1 (one))
in order for the MIP start information to be used with
a subsequent MIP optimization.
By convention, the file extension is .mst
.
The MST file format is documented in the reference manual
CPLEX File Formats and in
the stylesheet solution.xsl
and schema
solution.xsd
in the include
directory
of the product. Examples of its use appear in the examples
distributed with the product and in the
CPLEX User's Manual.
IloCplex
object. The names in the ORD file
must match the names in the active model. The priority order will
be associated with the model. The parameter MipOrdInd
must be nonzero for the next invocation of the method
IloCplex.solve
to take
the order into account.
By convention, the file extension is .ord
.
The ORD file format is documented in the reference manual
CPLEX File Formats.
"BranchDown", "BranchGlobal", "BranchUp"
.
dvars
to the corresponding value in the array priorities
.
For more information, see the class IloCplex
in the CPLEX C++ Reference Manual.
IloCplex
object.
The method returns true
if it finds a solution (not necessarily an optimal one).
true
if the solve has been successful.true
if the solve has been successful.IloCplex
object to the file with
the specified name.
This method is experimental.
.bas
.
The BAS file format is documented in the reference manual CPLEX File Formats.
Writes MIP start information to the file denoted by
name
. The designated MIP starts
begin with the one designated by the index
first
and continue to the specified number
nb
of members.
All MIP starts will be written if the
first
and nb
arguments are
omitted. The single MIP start designated by first
will be written if the num
argument is
omitted.
By convention, the file extension is .mst
.