FRAMES NO FRAMES

Class IlcIntToFloatSegmentFunction

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

An instance of IlcIntToFloatSegmentFunction represents a continuous or discontinuous piecewise linear function over integers on an interval [xmin, xmax). The member functions of the class IlcIntToFloatSegmentFunction are not reversible.

See Also:

Constructor Summary
public IlcIntToFloatSegmentFunction()
public IlcIntToFloatSegmentFunction(IlcSegmentedFunctionI * impl)
public IlcIntToFloatSegmentFunction(IlcManager m, IlcInt xmin=IloIntMin, IlcInt xmax=IloIntMax, IlcFloat dval=0.)
public IlcIntToFloatSegmentFunction(IlcManager m, IlcIntArray x, IlcFloatArray v, IlcInt xmin=IloIntMin, IlcInt xmax=IloIntMax)
public IlcIntToFloatSegmentFunction(const IlcIntToIntStepFunction & f)
Method Summary
public voidaddValue(IlcInt x1, IlcInt x2, IlcFloat v)
public voiddilate(IlcInt k)
public IlcFloatgetArea(IlcInt x1, IlcInt x2) const
public IlcIntgetDefinitionIntervalMax() const
public IlcIntgetDefinitionIntervalMin() const
public IlcSegmentedFunctionI *getImpl() const
public IlcFloatgetMax(IlcInt x1, IlcInt x2) const
public IlcFloatgetMin(IlcInt x1, IlcInt x2) const
public const char *getName() const
public IlcAnygetObject() const
public IloSolvergetSolver() const
public IloSolverI *getSolverI() const
public IlcFloatgetValue(IlcInt x) const
public voidoperator*=(IlcFloat k)
public voidoperator+=(const IlcIntToFloatSegmentFunction & fct)
public voidoperator-=(const IlcIntToFloatSegmentFunction & fct)
public voidoperator=(const IlcIntToFloatSegmentFunction & h)
public voidsetName(const char * name) const
public voidsetObject(IlcAny object) const
public voidsetPeriodic(const IlcIntToFloatSegmentFunction & f, IlcInt x0, IlcInt n=IlcIntMax, IlcFloat dval=0)
public voidsetPoints(IlcIntArray x, IlcFloatArray v)
public voidsetValue(IlcInt x1, IlcFloat v1, IlcInt x2, IlcFloat v2)
public voidsetValue(IlcInt x1, IlcInt x2, IlcFloat v)
public voidshift(IlcInt dx, IlcFloat dval=0)
Constructor Detail

IlcIntToFloatSegmentFunction

public IlcIntToFloatSegmentFunction()
This constructor creates an empty handle. You must initialize it before you use it.

IlcIntToFloatSegmentFunction

public IlcIntToFloatSegmentFunction(IlcSegmentedFunctionI * impl)
This constructor creates a handle object from a pointer to an implementation object.

IlcIntToFloatSegmentFunction

public IlcIntToFloatSegmentFunction(IlcManager m, IlcInt xmin=IloIntMin, IlcInt xmax=IloIntMax, IlcFloat dval=0.)

This constructor creates an integer piecewise linear function defined everywhere on the interval [xmin,xmax) with the same value dval.


IlcIntToFloatSegmentFunction

public IlcIntToFloatSegmentFunction(IlcManager m, IlcIntArray x, IlcFloatArray v, IlcInt xmin=IloIntMin, IlcInt xmax=IloIntMax)

This constructor creates an integer piecewise linear function defined everywhere on the interval [xmin,xmax); its steps are defined by the two arrays of parameters, x and v. 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:


IlcIntToFloatSegmentFunction

public IlcIntToFloatSegmentFunction(const IlcIntToIntStepFunction & f)

This copy constructor creates a new piecewise linear function. This new piecewise linear function is a copy of the integer step function f. They point to different implementation objects.


Method Detail

addValue

public void addValue(IlcInt x1, IlcInt x2, IlcFloat v)

This member function increases the value of the invoking piecewise linear function by v everywhere on the interval [x1,x2).


dilate

public void dilate(IlcInt k)

This member function multiplies the scale of x by k for the invoking piecewise linear function. The parameter k must be a positive integer.

More precisely, if the invoking function was defined over an interval [xmin,xmax), it will be redefined over the interval [k*xmin,k*xmax) and the value at x will be the former value at x/k.


getArea

public IlcFloat getArea(IlcInt x1, IlcInt x2) const

This member function returns the area of the invoking piecewise linear function over the interval [x1,x2). If the interval [x1,x2) is not included in the interval of definition of the invoking function, an error will be raised.


getDefinitionIntervalMax

public IlcInt getDefinitionIntervalMax() const

This member function returns the right-most point of the interval of definition of the invoking piecewise linear function.


getDefinitionIntervalMin

public IlcInt getDefinitionIntervalMin() const

This member function returns the left-most point of the interval of definition of the invoking piecewise linear function.


getImpl

public IlcSegmentedFunctionI * getImpl() const
This constructor creates an object by copying another one. This constructor creates an object by copying another one. This member function returns a pointer to the implementation object of the invoking handle.

getMax

public IlcFloat getMax(IlcInt x1, IlcInt x2) const

This member function returns the maximal value of the invoking piecewise linear function on the interval [x1,x2). If the interval [x1,x2) is not included in the definition interval of the invoking function, an error will be raised.


getMin

public IlcFloat getMin(IlcInt x1, IlcInt x2) const

This member function returns the minimal value of the invoking piecewise linear function on the interval [x1,x2). If the interval [x1,x2) is not included in the definition interval of the invoking function, an error will be raised.


getName

public const char * getName() const
This member function returns the name of the invoking object.

getObject

public IlcAny getObject() const
This member function returns a pointer to the external object associated with the invoking object, if there is such an association. It returns 0 (zero) otherwise.

getSolver

public IloSolver getSolver() const

This member function returns an instance of IloSolver associated with the invoking object.


getSolverI

public IloSolverI * getSolverI() const

This member function returns a pointer to the implementation object of the solver where the invoking object was extracted.


getValue

public IlcFloat getValue(IlcInt x) const

This member function returns the value of the invoking piecewise linear function at x. If x does not belong to the definition interval of the invoking function, an error will be raised.


operator*=

public void operator*=(IlcFloat k)

This operator multiplies the value of the invoking integer step function by a factor k everywhere on the interval of definition.


operator+=

public void operator+=(const IlcIntToFloatSegmentFunction & fct)

This operator adds the parameter function fct to the invoking piecewise linear function.


operator-=

public void operator-=(const IlcIntToFloatSegmentFunction & fct)

This operator subtracts the parameter function fct from the invoking piecewise linear function.


operator=

public void operator=(const IlcIntToFloatSegmentFunction & h)
This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the provided argument.

setName

public void setName(const char * name) const
This member function sets the name of the invoking object to a copy of name. This assignment is a reversible action.

setObject

public void setObject(IlcAny object) const
This member function establishes a link between the invoking object and an external object of which the invoking object might be a data member.

setPeriodic

public void setPeriodic(const IlcIntToFloatSegmentFunction & f, IlcInt x0, IlcInt n=IlcIntMax, IlcFloat dval=0)

This member function initializes the invoking function as a piecewise linear function that repeats the piecewise linear function f, n times after x0.

More precisely, if f is defined on [xfmin,xfmax) and if the invoking function is defined on [xmin,xmax), the value of the invoking function will be:


setPoints

public void setPoints(IlcIntArray x, IlcFloatArray v)

This member function initializes the invoking function as a piecewise linear function whose segments are defined by the two parameter arrays x and v.

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:


setValue

public void setValue(IlcInt x1, IlcInt x2, IlcFloat v)
public void setValue(IlcInt x1, IlcFloat v1, IlcInt x2, IlcFloat v2)

This member function sets the value of the invoking piecewise linear function to be v on the interval [x1,x2).


shift

public void shift(IlcInt dx, IlcFloat dval=0)

This member function shifts the invoking function from dx to the right if dx > 0 or from -dx to the left if dx < 0. It has no effect if dx = 0.

More precisely, if the invoking function is defined on [xmin,xmax) and dx > 0, the new value of the invoking function is:

If dx < 0, the new value of the invoking function is: