This method assumes that the cumul function expression f is fixed. It returns the number of segments of the cumul function expression f.

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

Syntax

C#
public int GetNumberOfSegments(
	ICumulFunctionExpr f
)

Remarks

A segment is an interval [start, end) on which the value of f is constant. An exception is thrown if the cumul function expression f is not fixed.

This method can be used to print the content of a cumul function expression as illustrated by the following code sample.

Examples

for (int i = 0; i < cp.GetNumberOfSegments(f); ++i) Console.WriteLine("[{0},{1}):{2}", cp.GetSegmentStart(f, i), cp.GetSegmentEnd(f, i), cp.GetSegmentValue(f, i));

For more information on cumul function expressions see the concept Cumul Function Expressions in the C++ Reference Manual.

See Also