NO FRAMES

Class IloNumToNumSegmentFunctionCursor

Definition file: ilconcert/ilosegfunc.h
Cursor over segments of a piecewise linear function.

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

Note
The structure of the piecewise linear function cannot be changed while a cursor is being used to inspect it. Therefore, functions that change the structure of the piecewise linear function, such as IloNumToNumStepFunction::setValue, should not be called while the cursor is being used.

See Also:

Constructor and Destructor Summary
public IloNumToNumSegmentFunctionCursor(const IloNumToNumSegmentFunction, IloNum x)
public IloNumToNumSegmentFunctionCursor(const IloNumToNumSegmentFunctionCursor &)
Method Summary
public IloNumgetSegmentMax() const
public IloNumgetSegmentMin() const
public IloNumgetValue(IloNum t) const
public IloNumgetValueLeft() const
public IloNumgetValueRight() const
public IloBoolok() const
public voidoperator++()
public voidoperator--()
public voidseek(IloNum)
Constructor and Destructor Detail

IloNumToNumSegmentFunctionCursor

public IloNumToNumSegmentFunctionCursor(const IloNumToNumSegmentFunction, IloNum 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 specifies the segment of the function that contains x.

Note that if n is the number of steps of the function given as argument, the worst-case complexity of this constructor is O(log(n)).


IloNumToNumSegmentFunctionCursor

public IloNumToNumSegmentFunctionCursor(const IloNumToNumSegmentFunctionCursor &)

This constructor creates a new cursor that is a copy of the argument cursor. The new cursor initially specifies the same segment and the same function as the argument cursor.


Method Detail

getSegmentMax

public IloNum getSegmentMax() const

This member function returns the right-most point of the segment currently specified by the cursor.


getSegmentMin

public IloNum getSegmentMin() const

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


getValue

public IloNum getValue(IloNum t) const

This member function returns the value of the piecewise linear function at time t. t must be between the left-most and the right-most point of the segment currently specified by the cursor.


getValueLeft

public IloNum getValueLeft() const

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


getValueRight

public IloNum getValueRight() const

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


ok

public IloBool ok() const

This member function returns IloFalse if the cursor does not currently specify a segment included in the definition interval of the piecewise linear function. Otherwise, it returns IloTrue.


operator++

public void operator++()

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


operator--

public void operator--()

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


seek

public void seek(IloNum)

This member function sets the cursor to specify the segment of the function that contains x. An IloException is thrown if x does not belong to the definition interval of the piecewise linear function associated with the invoking cursor.