NO FRAMES

IloPiecewiseLinear

public IloNumExprArg IloPiecewiseLinear(const IloNumExprArg node, const IloNumArray point, const IloNumArray slope, IloNum a, IloNum fa)
public IloNumExprArg IloPiecewiseLinear(const IloNumExprArg node, IloNum firstSlope, const IloNumArray point, const IloNumArray value, IloNum lastSlope)
Definition file: ilconcert/iloexpression.h
Represents a continuous or discontinuous piecewise linear function.

The function IloPiecewiseLinear creates an expression node to represent a continuous or discontinuous piecewise linear function f of the variable x. The array point contains the n breakpoints of the function such that point [i-1] <= point [i] for i = 1, . . ., n-1. The array slope contains the n+1 slopes of the n+1 segments of the function. The values a and fa must be coordinates of a point such that fa = f(a).

When point[i-1] = point[i], there is a step at the x-coordinate point[i-1] and its height is slope[i] to reach the y-coordinate of point[i].

Example
   IloPiecewiseLinear(x, IloNumArray(env, 2, 10., 20.),
                      IloNumArray(env, 3, 0.3, 1., 2.),
                      0, 0);
 

That expression defines a piecewise linear function f having two breakpoints at x = 10 and x = 20, and three segments; their slopes are 0.3, 1, and 2. The first segment has infinite length and ends at the point (x = 10, f(x) = 3) since f(0) = 0. The second segment starts at the point (x = 10, f(x) = 3) and ends at the point (x = 20, f(x) = 13), where the third segment starts.