Overview | Group | Tree | Graph | Index | Concepts |
Enumeration Summary |
---|
IloCplex::PWLFormulation |
Piecewise Linearity in ILOG CPLEX
Some problems are most naturally represented by constraints over functions that are not purely linear but consist of linear segments. Such functions are sometimes known as piecewise linear.
How to Define a Piecewise Linear Function
To define a piecewise linear function in Concert Technology, you need these components:
In other words, for a piecewise linear function of
n breakpoints, you need to know n+1 slopes.
Typically, the breakpoints of a piecewise linear function
are specified as an array of numeric values.
The slopes of its segments are indicated as an
array of numeric values as well.
The geometric coordinates of at least one point of the function
must also be specified.
Then in Concert Technology, those details are brought together
in an instance of the class IloPiecewiseLinear
.
Another way to specify a piecewise linear function is to give the slope of the first segment, two arrays for the coordinates of the breakpoints, and the slope of the last segment.
For examples of these ways of defining a piecewise linear function, see this topic in the ILOG CPLEX User's Manual.
Discontinuous Piecewise Linear Functions
Intuitively, in a continuous piecewise linear function, the endpoint of one segment has the same coordinates as the initial point of the next segment. There are piecewise linear functions, however, where two consecutive breakpoints may have the same x coordinate but differ in the value of f(x). Such a difference is known as a step in the piecewise linear function, and such a function is known as discontinuous.
Syntactically, a step is represented in this way:
By convention, a breakpoint belongs to the segment that starts at that breakpoint.
In Concert Technology, a discontinuous piecewise linear function
is represented as an instance of the class
IloPiecewiseLinear
(the same class as used for continuous piecewise linear functions).
For examples of discontinuous piecewise linear functions, see this topic in the ILOG CPLEX User's Manual.
Using IloPiecewiseLinear
Whether it represents a continuous or a discontinuous
piecewise linear function, an instance of
IloPiecewiseLinear
behaves like a
floating-point expression. That is, you may use it in a
term of a linear expression or
in a constraint added to a model (an instance of
IloModel
).