ILOG CPLEX 11.0 User's Manual > Discrete Optimization > Using Piecewise Linear Functions in Optimization: a Transport Example > Piecewise Linearity in ILOG CPLEX > Discontinuous Piecewise Linear Functions

Thus far, you have seen a piecewise linear function where the segments are continuous. Intuitively, in a continuous piecewise linear function, the endpoint of one segment has the same coordinates as the initial point of the next segment, as in Figure 18.1.

There are piecewise linear functions, however, where the endpoint of one segment and the initial point of the next segment 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. Figure 18.2 shows a discontinuous piecewise linear function with two steps.

Syntactically, a step is represented in this way:

By convention, a breakpoint belongs in both segments associated with the step. For example, in Figure 18.2, at the breakpoint x=3, the points (3,1) and (3,3) are both admissible. Similarly, when x = 5, the points (5,4) and (5,5) are both admissible.

However, isolated points, as explained in Isolated Points in Piecewise Linear Functions, are not allowed, neither in continuous nor in discontinuous piecewise linear functions. In fact, only one step is allowed at a given point.

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 example, the function in Figure 18.2 is declared in this way:

IloPiecewiseLinear(x, 
                   IloNumArray(env, 4, 3. ,3. ,5. ,5.),
                   IloNumArray(env, 5, 0., 2., 0.5, 1., -1.),
                   0, 1);

images/usingPiecewiseLina2.gif

Figure 18.2 A discontinuous piecewise linear function with steps

Reminder
It may help to understand the signature of the function in this example to recall that in Cartesian coordinates, the slope of a horizontal line (that is, a line or segment parallel to the x-axis) is 0 (zero), and the slope of a vertical line (that is, a line or segment parallel to the y-axis) is undefined in the conventional representation:

y = ax + b

In the signature of the function, the undefined slope of the vertical segment at the point of discontinuity is represented as the height of the step.