FRAMES NO FRAMES

Class IlcIntToIntStepFunction

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

An instance of IlcIntToIntStepFunction represents a step function over integers which is defined everywhere on an interval [xmin,xmax). Each interval [x1,x2) over which the function has the same value is called a step. The member functions of the class IlcIntToIntStepFunction are not reversible.

See Also:

Constructor Summary
public IlcIntToIntStepFunction()
public IlcIntToIntStepFunction(IlcSegmentedFunctionI * impl)
public IlcIntToIntStepFunction(IloSolver solver, IlcInt xmin=IlcIntMin, IlcInt xmax=IlcIntMax, IlcInt dval=0)
public IlcIntToIntStepFunction(IloSolver solver, IlcIntArray x, IlcIntArray v, IlcInt xmin=IlcIntMin, IlcInt xmax=IlcIntMax)
Method Summary
public voidaddValue(IlcInt x1, IlcInt x2, IlcInt v)
public voiddilate(IlcInt k)
public IlcIntgetArea(IlcInt x1, IlcInt x2) const
public IlcIntgetDefinitionIntervalMax() const
public IlcIntgetDefinitionIntervalMin() const
public IlcSegmentedFunctionI *getImpl() const
public IlcIntgetMax(IlcInt x1, IlcInt x2) const
public IlcIntgetMin(IlcInt x1, IlcInt x2) const
public const char *getName() const
public IlcAnygetObject() const
public IloSolvergetSolver() const
public IloSolverI *getSolverI() const
public IlcIntgetValue(IlcInt x) const
public voidoperator*=(IlcInt k)
public voidoperator+=(const IlcIntToIntStepFunction & fct)
public voidoperator-=(const IlcIntToIntStepFunction & fct)
public voidoperator=(const IlcIntToIntStepFunction & h)
public voidsetMax(const IlcIntToIntStepFunction & fct)
public voidsetMax(IlcInt x1, IlcInt x2, IlcInt v)
public voidsetMin(const IlcIntToIntStepFunction & fct)
public voidsetMin(IlcInt x1, IlcInt x2, IlcInt v)
public voidsetName(const char * name) const
public voidsetObject(IlcAny object) const
public voidsetPeriodic(const IlcIntToIntStepFunction & fp, IlcInt x0, IlcInt n=IlcIntMax, IlcInt dval=0)
public voidsetSteps(IlcIntArray x, IlcIntArray v)
public voidsetValue(IlcInt x1, IlcInt x2, IlcInt v)
public voidshift(IlcInt dx, IlcInt dval=0)
Constructor Detail

IlcIntToIntStepFunction

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

IlcIntToIntStepFunction

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

IlcIntToIntStepFunction

public IlcIntToIntStepFunction(IloSolver solver, IlcInt xmin=IlcIntMin, IlcInt xmax=IlcIntMax, IlcInt dval=0)

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


IlcIntToIntStepFunction

public IlcIntToIntStepFunction(IloSolver solver, IlcIntArray x, IlcIntArray v, IlcInt xmin=IlcIntMin, IlcInt xmax=IlcIntMax)

This constructor creates an integer step function defined everywhere on the interval [xmin,xmax); its steps are defined by the two arrays of parameters, x and v.

More precisely, if n is the size of array x, the size of array v must be n+1 and, if the created function is defined on the interval [xmin,xmax), its values will be:


Method Detail

addValue

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

This member function increases the value of the invoking integer step 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 integer step 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 IlcInt getArea(IlcInt x1, IlcInt x2) const

This member function returns the sum of the invoking integer step function over the interval [x1,x2).

If the interval [x1,x2) is not included in the interval of definition of the invoking function, Solver will throw an exception (an instance of IloSolver::SolverErrorException).


getDefinitionIntervalMax

public IlcInt getDefinitionIntervalMax() const

This member function returns the rightmost point of the interval of definition of the invoking step function.


getDefinitionIntervalMin

public IlcInt getDefinitionIntervalMin() const

This member function returns the leftmost point of the interval of definition of the invoking step 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 IlcInt getMax(IlcInt x1, IlcInt x2) const

This member function returns the maximal value of the invoking integer step function on the interval [x1,x2). If the interval [x1,x2) is not included in the interval of definition of the invoking function, Solver will throw an exception (an instance of IloSolver::SolverErrorException).


getMin

public IlcInt getMin(IlcInt x1, IlcInt x2) const

This member function returns the minimal value of the invoking integer step function on the interval [x1,x2). If the interval [x1,x2) is not included in the interval of definition of the invoking function, Solver will throw an exception (an instance of IloSolver::SolverErrorException).


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 IlcInt getValue(IlcInt x) const

This member function returns the value of the invoking integer step function at x. If x does not belong to the interval of definition of the invoking function, Solver will throw an exception (an instance of IloSolver::SolverErrorException).


operator*=

public void operator*=(IlcInt 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 IlcIntToIntStepFunction & fct)

This operator adds the parameter function fct to the invoking integer step function.


operator-=

public void operator-=(const IlcIntToIntStepFunction & fct)

This operator subtracts the parameter function fct from the invoking integer step function.


operator=

public void operator=(const IlcIntToIntStepFunction & 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.

setMax

public void setMax(const IlcIntToIntStepFunction & fct)

This member function sets the value of the invoking integer step function to be the maximum between the current value and the value of fct everywhere on the interval of definition of the invoking function. The interval of definition of fct must be the same as that of the invoking step function.


setMax

public void setMax(IlcInt x1, IlcInt x2, IlcInt v)

This member function sets the value of the invoking integer step function to be the maximum between the current value and v everywhere on the interval [x1,x2).


setMin

public void setMin(const IlcIntToIntStepFunction & fct)

This member function sets the value of the invoking integer step function to be the minimum between the current value and the value of fct everywhere on the interval of definition of the invoking function. The interval of definition of fct must be the same as the one of the invoking step function.


setMin

public void setMin(IlcInt x1, IlcInt x2, IlcInt v)

This member function sets the value of the invoking integer step function to be the minimum between the current value and v everywhere on the interval [x1,x2).


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 IlcIntToIntStepFunction & fp, IlcInt x0, IlcInt n=IlcIntMax, IlcInt dval=0)

This member function initializes the invoking function as an integer step function that repeats the step function fp, n times after x0.

More precisely, if fp is defined on [xfpmin,xfpmax) and if the invoking function is defined on [xmin,xmax), the value of the invoking function will be:


setSteps

public void setSteps(IlcIntArray x, IlcIntArray v)

This member function initializes the invoking function as an integer step function whose steps are defined by the two parameters arrays x and v.

More precisely, if n is the size of array x, size of array v must be n+1 and, if the invoking function is defined on the interval [xmin,xmax), its values will be:


setValue

public void setValue(IlcInt x1, IlcInt x2, IlcInt v)

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


shift

public void shift(IlcInt dx, IlcInt 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: