FRAMES NO FRAMES

Class IlcIntToFloatSegmentFunctionCursor

Definition file: ilsched/segfunc.h
Include file: <ilsched/ilsched.h>

An instance of the class IlcIntToFloatSegmentFunctionCursor allows you to inspect the contents of a piecewise linear function. A segment of an instance of IlcIntToFloatSegmentFunction is defined as an interval [x1, x2) over which the function is linear. Cursors iterate forward or backward over the segments of a piecewise linear function.

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

See Also:

Constructor and Destructor Summary
public IlcIntToFloatSegmentFunctionCursor(const IlcIntToFloatSegmentFunction &, IlcInt x)
Method Summary
public IlcIntgetSegmentMax() const
public IlcIntgetSegmentMin() const
public IlcFloatgetValue(IlcInt t) const
public IlcFloatgetValueLeft() const
public IlcFloatgetValueRight() const
public IlcBoolok() const
public voidoperator++()
public voidoperator--()
Constructor and Destructor Detail

IlcIntToFloatSegmentFunctionCursor

public IlcIntToFloatSegmentFunctionCursor(const IlcIntToFloatSegmentFunction &, IlcInt x)

This constructor creates a cursor to inspect the piecewise linear 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 right-most point of the segment currently indicated by the cursor.


getSegmentMin

public IlcInt getSegmentMin() const

This member function returns the left-most point of the segment currently indicated by the cursor.


getValue

public IlcFloat getValue(IlcInt t) const

This member function returns the value of the function at time t. t must be inside the segment currently indicated by the cursor, that is in time interval [getSegmentMin(), getSegmentMax()). An instance of IloSolver::SolverErrorException is thrown otherwise.


getValueLeft

public IlcFloat getValueLeft() const

This member function returns the value of the function at the left-most point of the segment currently indicated by the cursor.


getValueRight

public IlcFloat getValueRight() const

This member function returns the value of the function at the right-most point 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 piecewise linear 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).