FRAMES NO FRAMES

Class IlcIntToIntStepFunctionCursor

Definition file: ilsolver/segfunc.h
Include file: <ilsolver/ilosolver.h>

An instance of the class IlcIntToIntStepFunctionCursor allows you to inspect the contents of an integer step function. A segment of an integer step function is defined as an interval [x1, x2) over which the value of the function is the same. Cursors iterate forward or backward over the segments of an integer step function.

Note
The structure of the integer step function must not be changed while a cursor is inspecting it. Therefore functions that change the structure of the step function, such as IlcIntToIntStepFunction::setValue should not be called while a cursor is in use.

See Also:

Constructor and Destructor Summary
public IlcIntToIntStepFunctionCursor(const IlcIntToIntStepFunction &, IlcInt x)
Method Summary
public IlcIntgetSegmentMax() const
public IlcIntgetSegmentMin() const
public IlcIntgetValue() const
public IlcBoolok() const
public voidoperator++()
public voidoperator--()
Constructor and Destructor Detail

IlcIntToIntStepFunctionCursor

public IlcIntToIntStepFunctionCursor(const IlcIntToIntStepFunction &, IlcInt x)

This constructor creates a cursor to inspect the integer step function argument. This cursor lets you iterate forward or backward over the segments of the function. The cursor initially indicates the segment of the function that contains x.


Method Detail

getSegmentMax

public IlcInt getSegmentMax() const

This member function returns the rightmost point of the segment currently indicated by the cursor.


getSegmentMin

public IlcInt getSegmentMin() const

This member function returns the leftmost point of the segment currently indicated by the cursor.


getValue

public IlcInt getValue() const

This member function returns the value of the segment currently indicated by the cursor.


ok

public IlcBool ok() const

This member function returns IlcFalse if the cursor does not currently indicate a segment included in the interval of definition of the integer step function. Otherwise, it returns IlcTrue.

An attempt to use the cursor after ok() returns IlcFalse leads to undefined behavior.


operator++

public void operator++()

This operator moves the cursor to the segment adjacent to the current segment (forward move).


operator--

public void operator--()

This operator moves the cursor to the segment adjacent to the current segment (backward move).