ILOG CPLEX .NET Reference Manual

IMPModeler.PiecewiseLinear Method (INumExpr, Double[], Int32, Int32, Double[], Int32, Double, Double)

Creates an expression node to represent a continuous or discontinuous piecewise linear function.

INumExpr PiecewiseLinear(
   INumExpr expr,
   double[] points,
   int startPoints,
   int num,
   double[] slopes,
   int startSlopes,
   double a,
   double fa
);

Parameters

expr
An expression indicating where to evaluate the piecewise linear function.
points
An array containing breakpoints that define the piecewise linear function.
startPoints
An integer indicating the first element in array points to use for the definition of the breakpoints of the piecewise linear function.
num
The number of breakpoints to use from the array points. Thus num+1 elements of array slopes are used.
slopes
An array containing the slopes that define the piecewise linear function.
startSlopes
The first element in array slopes to use for the definition of the slopes of the piecewise linear function.
a
The first coordinate of the anchor point of the piecewise linear function.
fa
The second coordinate of the anchor point of the piecewise linear function.

Return Value

A piecewise linear function of expr.

Remarks

The piecewise linear function is evaluated at expr and is defined by the remaining arguments. The array points contains breakpoints such that points[i-1] is less than or equal to points[i]. Only num elements starting with element startPoints are considered. The array slopes contains the slope for each piece defined by the breakpoints. Only num+1 elements starting with element startSlopes are considered. The element slopes[startSlopes] specifies the slope of the piecewise linear function for values less than points[startPoints], and slopes[startSlopes+num] specifies the slope of the piecewise linear function for values greater than points[startPoints+num-1]. For elements in between, slopes[startSlopes+i] specifies the slope between points[startPoints+i-1] and points[startPoints+i].

By selecting points[startPoints+i-1] == points[startPoints+i], you can represent a discontinuous piecewise linear function. At points[startPoints+i], it will make a step of size slope[startSlopes+i-1].

The values a and fa define the x and y coordinates of one point of the piecewise linear function. This point is referred to as the anchor point.

See Also

IMPModeler Interface | ILOG.Concert Namespace | IMPModeler.PiecewiseLinear Overload List