NO FRAMES

Class IloNumToAnySetStepFunction

Definition file: ilconcert/ilosetfunc.h
Represents a step function that associates sets with intervals.

An instance of IloNumToAnySetStepFunction represents a step function that associates sets with intervals. It is defined everywhere on an interval [xMin,xMax). Each interval [x1,x2) on which the function has the same set is called a step.

Note that if n is the number of steps of the function, the random access to a given step (see the member functions IloNumToAnySetStepFunction::add, IloNumToAnySetStepFunction::alwaysIntersects, IloNumToAnySetStepFunction::contains, IloNumToAnySetStepFunction::empty, IloNumToAnySetStepFunction::everContains, IloNumToAnySetStepFunction::everIntersects, IloNumToAnySetStepFunction::fill, IloNumToAnySetStepFunction::getComplementSet, IloNumToAnySetStepFunction::getSet, IloNumToAnySetStepFunction::intersects, IloNumToAnySetStepFunction::isEmpty, IloNumToAnySetStepFunction::isFull, IloNumToAnySetStepFunction::remove, IloNumToAnySetStepFunction::set, and IloNumToAnySetStepFunction::setIntersection) has a worst-case complexity of O(log(n)).

Complementary Representation of Values

IloNumToAnySetStepFunction allows the implicit representation of infinite sets through the representation of the complement of the actual set value. This, for example, allows you to completely fill a set (using the IloNumToAnySetStepFunction::fill member function) and then specify the elements that are not in the set. Under normal circumstances, it is not necessary to know if the value of the step function at a particular point is represented by the set or its complement: all the member functions that manipulate the step function value will correctly adapt to either representation. The only case where it is necessary to know the internal representation is if you want to directly access the set that represents a value (using the IloNumToAnySetStepFunction::getSet or IloNumToAnySetStepFunction::getComplementSet member functions). In that circumstance only, it is necessary to use the IloNumToAnySetStepFunction::usesComplementaryRepresentation member function to determine the internal representation, and then use either IloNumToAnySetStepFunction::getSet or IloNumToAnySetStepFunction::getComplementSet depending on the return value of IloNumToAnySetStepFunction::usesComplementaryRepresentation. Note that IloNumToAnySetStepFunction::getSet will raise an error if it is used to access a set that is represented as a complement set. IloNumToAnySetStepFunction::getComplementSet will raise an error if it is used to access a set that is directly represented.

See Also:

Constructor Summary
public IloNumToAnySetStepFunction(const IloEnv env, IloNum xmin=-IloInfinity, IloNum xmax=IloInfinity, const char * name=0)
public IloNumToAnySetStepFunction(const IloEnv env, IloNum xmin, IloNum xmax, const IloAnySet dval, const char * name=0)
Method Summary
public voidadd(const IloNumToAnySetStepFunction f) const
public voidadd(IloNum xMin, IloNum xMax, IloAny elt) const
public voidadd(IloNum xMin, IloNum xMax, const IloAnySet elts, IloBool complt=IloFalse) const
public IloBoolalwaysContains(const IloNumToAnySetStepFunction f) const
public IloBoolalwaysContains(IloNum xMin, IloNum xMax, const IloAnySet elts) const
public IloBoolalwaysContains(IloNum xMin, IloNum xMax, IloAny elt) const
public IloBoolalwaysIntersects(const IloNumToAnySetStepFunction f) const
public IloBoolalwaysIntersects(IloNum xMin, IloNum xMax, const IloAnySet elts) const
public IloBoolcontains(IloNum x, const IloAnySet elts) const
public IloBoolcontains(IloNum x, IloAny elt) const
public IloNumToAnySetStepFunctioncopy() const
public voiddilate(IloNum k) const
public voidempty(IloNum xMin, IloNum xMax) const
public IloBooleverContains(const IloNumToAnySetStepFunction f) const
public IloBooleverContains(IloNum xMin, IloNum xMax, const IloAnySet elts) const
public IloBooleverContains(IloNum xMin, IloNum xMax, IloAny elt) const
public IloBooleverIntersects(const IloNumToAnySetStepFunction f) const
public IloBooleverIntersects(IloNum xMin, IloNum xMax, const IloAnySet elts) const
public voidfill(IloNum xMin, IloNum xMax) const
public IloAnySetgetComplementSet(IloNum x) const
public IloNumgetDefinitionIntervalMax() const
public IloNumgetDefinitionIntervalMin() const
public IloAnySetgetSet(IloNum x) const
public IloBoolintersects(IloNum x, const IloAnySet elts) const
public IloBoolisEmpty(IloNum x) const
public IloBoolisFull(IloNum x) const
public voidremove(const IloNumToAnySetStepFunction f) const
public voidremove(IloNum xMin, IloNum xMax, IloAny elt) const
public voidremove(IloNum xMin, IloNum xMax, const IloAnySet elts, IloBool complt=IloFalse) const
public voidset(IloNum xMin, IloNum xMax, IloAny elt) const
public voidset(IloNum xMin, IloNum xMax, const IloAnySet elts, IloBool complt=IloFalse) const
public voidsetIntersection(const IloNumToAnySetStepFunction f) const
public voidsetIntersection(IloNum xMin, IloNum xMax, IloAny elt) const
public voidsetIntersection(IloNum xMin, IloNum xMax, const IloAnySet elts, IloBool complt=IloFalse) const
public voidsetPeriodic(const IloNumToAnySetStepFunction f, IloNum x0, IloNum n, const IloAnySet dval) const
public voidshift(IloNum dx, const IloAnySet dval) const
public IloBoolusesComplementaryRepresentation(IloNum x) const
Constructor Detail

IloNumToAnySetStepFunction

public IloNumToAnySetStepFunction(const IloEnv env, IloNum xmin=-IloInfinity, IloNum xmax=IloInfinity, const char * name=0)

This constructor creates a step function defined everywhere on the interval [xMin, xMax) with empty set as the value.


IloNumToAnySetStepFunction

public IloNumToAnySetStepFunction(const IloEnv env, IloNum xmin, IloNum xmax, const IloAnySet dval, const char * name=0)

This constructor creates a step function defined everywhere on the interval [xMin, xMax) with the same set dval.


Method Detail

add

public void add(const IloNumToAnySetStepFunction f) const

This member function adds the value of f at point x to the value of the invoking step function at point x, for all points x in the definition interval of the invoking step function. An instance of IloException is thrown if the definition interval of f is not equal to the definition interval of the invoking step function.


add

public void add(IloNum xMin, IloNum xMax, IloAny elt) const

This member function adds elt to the value of the invoking step function on the interval [xMin, xMax).


add

public void add(IloNum xMin, IloNum xMax, const IloAnySet elts, IloBool complt=IloFalse) const

This member function adds the elements of elts to the value of the invoking step function on the interval [xMin, xMax).


alwaysContains

public IloBool alwaysContains(const IloNumToAnySetStepFunction f) const

This member function returns IloTrue if for all points x on the definition interval of the invoking step function, the value of f at point x is a subset of the value of the invoking step function at point x. An instance of IloException is thrown if the definition interval of f is not equal to the definition interval of the invoking step function.


alwaysContains

public IloBool alwaysContains(IloNum xMin, IloNum xMax, const IloAnySet elts) const

This member function returns IloTrue if elts is a subset of the value of the invoking step function at all points on the interval [xMin, xMax).


alwaysContains

public IloBool alwaysContains(IloNum xMin, IloNum xMax, IloAny elt) const

This member function returns IloTrue if at all points on the interval [xMin, xMax) the value of the invoking step function contains elt.


alwaysIntersects

public IloBool alwaysIntersects(const IloNumToAnySetStepFunction f) const

This member function returns IloTrue if for all points x in the definition interval of the invoking step function, the intersection of f and the invoking step function is not empty. An instance of IloException is thrown if the definition interval of f is not equal to the definition interval of the invoking step function.


alwaysIntersects

public IloBool alwaysIntersects(IloNum xMin, IloNum xMax, const IloAnySet elts) const

This member function returns IloTrue if for all x on the interval [xMin, xMax) the intersection of elts and the value of the invoking step function at point x is not empty.


contains

public IloBool contains(IloNum x, const IloAnySet elts) const

This member function returns IloTrue if elts is a subset of the value of the invoking step function at point x.


contains

public IloBool contains(IloNum x, IloAny elt) const

This member function returns IloTrue if the invoking step function contains element elt at point x.


copy

public IloNumToAnySetStepFunction copy() const

This member function creates and returns a new function that is a copy of the invoking function.


dilate

public void dilate(IloNum k) const

This member function multiplies by k the scale of x for the invoking step function. k must be a nonnegative numeric value. More precisely, if the invoking step 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.


empty

public void empty(IloNum xMin, IloNum xMax) const

This member function sets the value of the invoking step function on the interval [xMin, xMax) to be the empty set.


everContains

public IloBool everContains(const IloNumToAnySetStepFunction f) const

This member function returns IloTrue if at any point x in the definition interval of the invoking step function, f at point x is a subset of the invoking step function at point x. An instance of IloException is thrown if the definition interval of f is not equal to the definition interval of the invoking step function.


everContains

public IloBool everContains(IloNum xMin, IloNum xMax, const IloAnySet elts) const

This member function returns IloTrue if at any point on the interval [xMin, xMax)elts is a subset of the value of the invoking step function.


everContains

public IloBool everContains(IloNum xMin, IloNum xMax, IloAny elt) const

This member function returns IloTrue if at any point on the interval [xMin, xMax) the value of the invoking step function contains elt.


everIntersects

public IloBool everIntersects(const IloNumToAnySetStepFunction f) const

This member function returns IloTrue if at some point x in the definition interval of the invoking step function, the intersection of f and the invoking step function is not empty. An instance of IloException is thrown if the definition interval of f is not equal to the definition interval of the invoking step function.


everIntersects

public IloBool everIntersects(IloNum xMin, IloNum xMax, const IloAnySet elts) const

This member function returns IloTrue if at any point x on the interval [xMin, xMax) the intersection of elts and the value of the invoking step function at point x is not empty.


fill

public void fill(IloNum xMin, IloNum xMax) const

This member function sets the value of the invoking step function on the interval [xMin, xMax) to be the full set.


getComplementSet

public IloAnySet getComplementSet(IloNum x) const

This member function returns the complement of the value of the invoking step function at point x. An instance of IloException is thrown if the invoking step function at point x does not use the complementary representation. See Complementary Representation of Values for more information.


getDefinitionIntervalMax

public IloNum getDefinitionIntervalMax() const

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


getDefinitionIntervalMin

public IloNum getDefinitionIntervalMin() const

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


getSet

public IloAnySet getSet(IloNum x) const

This member function returns the value of the invoking step function at point x. An instance of IloException is thrown if the invoking step function at point x uses the complementary representation. See Complementary Representation of Values for more information.


intersects

public IloBool intersects(IloNum x, const IloAnySet elts) const

This member function returns IloTrue if the intersection of elts and the value of the invoking step function at point x is not empty.


isEmpty

public IloBool isEmpty(IloNum x) const

This member function returns IloTrue if the function is empty at point x. In other words, a return of IloTrue means that the member function IloNumToAnySetStepFunction::empty has been applied to point x and no elements have been subsequently added to the value of the invoking step function at point x.


isFull

public IloBool isFull(IloNum x) const

This member function returns IloTrue if the function is full at point x. In other words, a return of IloTrue means that the member function IloNumToAnySetStepFunction::fill has been applied to point x and no elements have been subsequently removed from the value of the invoking step function at point x.


remove

public void remove(const IloNumToAnySetStepFunction f) const

This member function removes the value of f from the value of the invoking step function at all points on the definition interval of the invoking step function. An instance of IloException is thrown if the definition interval of f is not equal to the definition interval of the invoking step function.


remove

public void remove(IloNum xMin, IloNum xMax, IloAny elt) const

This member function removes elt from the value of the invoking step function on the interval [xMin, xMax).


remove

public void remove(IloNum xMin, IloNum xMax, const IloAnySet elts, IloBool complt=IloFalse) const

This member function removes all the elements in elts from the value of the invoking step function on the interval [xMin, xMax).


set

public void set(IloNum xMin, IloNum xMax, IloAny elt) const

This member function sets the value of the invoking step function to be elt on the interval [xMin, xMax).


set

public void set(IloNum xMin, IloNum xMax, const IloAnySet elts, IloBool complt=IloFalse) const

This member function sets the value of the invoking step function to be elts on the interval [xMin, xMax).


setIntersection

public void setIntersection(const IloNumToAnySetStepFunction f) const

This member function assigns the value of the invoking step function at all points x on the definition interval of the invoking step function to be the intersection of the value of f at point x and the value of the invoking step function at point x. An instance of IloException is thrown if the definition interval of f is not equal to the definition interval of the invoking step function.


setIntersection

public void setIntersection(IloNum xMin, IloNum xMax, IloAny elt) const

This member function assigns the value of the invoking step function at all points x on the interval [xMin, xMax) to be the intersection of the set containing elt and the value of the invoking set function at point x.


setIntersection

public void setIntersection(IloNum xMin, IloNum xMax, const IloAnySet elts, IloBool complt=IloFalse) const

This member function assigns the value of the invoking step function at all points x on the interval [xMin, xMax) to be the intersection of elts and the value of the invoking set function at point x.


setPeriodic

public void setPeriodic(const IloNumToAnySetStepFunction f, IloNum x0, IloNum n, const IloAnySet dval) const

This member function initializes the invoking step function as a function that repeats the step function f, n times after x0. More precisely, if f is defined on [xfpMin,xfpMax) and if the invoking step function is defined on [xMin,xMax), the value of the invoking step function will be:


shift

public void shift(IloNum dx, const IloAnySet dval) const

This member function shifts the invoking step 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 step function is defined on [xMin,xMax) and dx > 0, the new value of the invoking step function is:

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


usesComplementaryRepresentation

public IloBool usesComplementaryRepresentation(IloNum x) const

This member function returns IloTrue if the value of the invoking function at point x is represented by a complementary set, rather than by directly representing the value as a set itself. See Complementary Representation of Values for more information.