This constructor creates a piecewise linear function defined everywhere whose segments are defined by the two argument arrays x and v.

Namespace: ILOG.CP
Assembly: oplall (in oplall.dll)

Syntax

C#
public INumToNumSegmentFunction NumToNumSegmentFunction(
	double[] x,
	double[] v
)

Parameters

x
Type: array<System..::..Double>[]()[][]
v
Type: array<System..::..Double>[]()[][]

Remarks

More precisely, the size n of array x must be equal to the size of array v and, if the created function is defined on the interval [xmin,xmax), its values will be:

  • v[0] for t < x[0],
  • v[i] + (t-x[i])*(v[i+1]-v[i])/(x[i+1]-x[i]) for t in [x[i], x[i+1]) for all i in [0, n-2] such that x[i-1] <> x[i], and
  • v[n-1] for x[n+1] <= t.

See Also