Overview
Introduces the C++ class IloCplex.
CPLEX generally does not need to be involved while you
create your model. However, after the model is set up, it is time
to create your cplex object, that is, an
instance of the class IloCplex, to be used
to solve the model. IloCplex is
a class derived from IloAlgorithm. There
are other Concert Technology algorithm classes, also derived from IloAlgorithm, as documented in the CPLEX
C++ API Reference Manual. Some models might also be solved by
using other algorithms, such as the class IloCP
for constraint programming, or by using a hybrid algorithm consisting
of both CP Optimizer and CPLEX. Some models, on the other hand, cannot
be solved with CPLEX.
IloCplex objects,
a model may only consist of modeling objects of the classes listed
in Table 1. Instances of IloConstraint extracted
by CPLEX can be created in a variety of ways. Most often, they can
be generated by means of overloaded C++ operators, such as == , <= , or >= , in the form expression1 operator expression2 .
Instances of both IloConstraint and IloRange generated in that way may be built from
either linear or quadratic expressions. Constraints and ranges may
also include piecewise linear terms. (Other sections of this manual,
not specific to C++, show you how to use quadratic expressions: Solving problems with a quadratic objective (QP) and Solving problems with quadratic constraints (QCP). Likewise, Using piecewise linear functions in optimization: a transport example shows you how to
apply piecewise linear terms in a C++ application.)
For more detail about solving problems with IloCplex ,
see the following sections of this manual.
| To model: | Use: |
|---|---|
| numeric variables | objects of the class IloNumVar ,
as long as they are not constructed with a list of feasible values |
| semi-continuous variables | objects of the class IloSemiContVar
|
| linear objective function | an object of the class IloObjective
with linear or piecewise linear expressions |
| quadratic objective function | an object of the class IloObjective
with quadratic expressions |
| linear constraints |
objects of the class (lower bound <= expression <= upper bound) or objects of the class (expr1 relation expr2) involving strictly linear or piecewise linear expressions |
| quadratic constraints | objects of the class IloConstraint
that contain quadratic expressions as well as linear expressions or
piecewise linear expressions |
| logical constraints | objects of the class IloConstraint
or generated ranges with linear or piecewise linear expressions |
| variable type-conversions | objects of the class IloConversion
|
| special ordered sets of type 1 | objects of the class IloSOS1
|
| special ordered sets of type 2 | objects of class IloSOS2
|
For an explanation of quadratic constraints, see Solving problems with quadratic constraints (QCP).
For more information about quadratic objective functions, see Solving problems with a quadratic objective (QP).
For examples of piecewise linear constraints, see Using piecewise linear functions in optimization: a transport example.
For more about logical constraints, see Logical constraints in optimization. This topic introduces the idea of generated ranges.
For a description of special ordered sets, see Using special ordered sets (SOS).