Overview | Group | Tree | Graph | Index | Concepts |
An instance of this class offers a convenient way to represent a set of integer values as a constrained variable in Concert Technology.
A constrained variable representing a set of integer values (that is, an instance
of IloIntSetVar
) is defined in terms of two other sets:
its required elements and its possible elements. Its required elements are those that
must be in the set. Its possible elements are those that may be in the set. This class
offers member functions for accessing the required and possible elements of a set of
integer values.
The function IloCard
offers you a way to constrain
the number of elements in a set variable. That is, IloCard
constrains
the cardinality of a set variable.
See Also:
IloCard, IloEqIntersection, IloEqUnion, IloExtractable, IloMember, IloModel, IloNotMember, IloNullIntersect, IloIntSetVarArray, IloSubset, IloSubsetEq
Constructor Summary | |
---|---|
public | IloIntSet(const IloEnv env, const IloIntArray array, IloBool withIndex=IloFalse) |
public | IloIntSet(const IloEnv env, const IloNumArray array, IloBool withIndex=IloFalse) |
public | IloIntSet(const IloEnv env, IloBool withIndex=IloFalse) |
public | IloIntSet(IloIntSetI * impl=0) |
Method Summary | |
---|---|
public void | add(IloIntSet set) |
public void | add(IloInt elt) |
public IloBool | contains(IloIntSet set) const |
public IloBool | contains(IloInt elt) const |
public void | empty() |
public IloIntSetI * | getImpl() const |
public IloInt | getNext(IloInt value, IloInt n=1) const |
public IloInt | getNextC(IloInt value, IloInt n=1) const |
public IloInt | getPrevious(IloInt value, IloInt n=1) const |
public IloInt | getPreviousC(IloInt value, IloInt n=1) const |
public IloInt | getSize() const |
public IloBool | intersects(IloIntSet set) const |
public void | remove(IloIntSet set) |
public void | remove(IloInt elt) |
public void | setIntersection(IloIntSet set) |
public void | setIntersection(IloInt elt) |
Inner Class | |
---|---|
IloIntSet::Iterator | This class is an iterator that traverses the elements of a finite set of numeric values. |
Constructor Detail |
---|
This constructor creates a set of integer values in the environment
env
from the elements in array
.
This constructor creates a set of numeric values in the environment
env
from the elements in array
.
This constructor creates an empty set (no elements) in the environment
env
. You must use the member function IloIntSet::add
to fill this set with elements.
This constructor creates a handle to a set of integer values from its implementation object.
Method Detail |
---|
This member function adds set
to the invoking set. Here,
"adds" means that the invoking set becomes the union of its former elements and the
elements of set
.
To calculate the arithmetic sum of values in an array, use the function
IloSum
.
This member function adds elt
to the invoking set. Here, "adds"
means that the invoking set becomes the union of its former elements and
the new elt
.
This member function returns a Boolean value (zero or one) that indicates
whether set
contains the invoking set. The value one indicates
that the invoking set contains all the elements of set, and that the
intersection of the invoking set with set
is precisely
set
. The value zero indicates that the intersection of the
invoking set and set
is not precisely set
.
This member function returns a Boolean value (zero or one) that indicates
whether elt
is an element of the invoking set. The value one
indicates that the invoking set contains elt
; the value zero
indicates that the invoking set does not contain elt
.
This member function removes the elements from the invoking set. In other words, the invoking set becomes the empty set.
This member function returns a pointer to the implementation object of the invoking set.
This method returns the value next to the given argument in the set.
If the given value does not exist, it throws an exception
If no value follows (that is, you are at the end of the set), it throws an exception.
See also getNextC, getPreviousC for circular search.
This method returns the value next to the given argument in the set.
If the given value does not exist, it throws an exception.
If no value follows (that is, you are at the end of the set), it will give you the first value (circular search).
See also getNext, getPrevious.
This method returns the value previous to the given argument in the set.
If the given value does not exist, it throws an exception
If no value is previous (that is, you are at the beginning of the set), it throws an exception.
See also getNextC, getPreviousC for circular search.
This method returns the value previous to the given argument in the set.
If the given value does not exist, it throws an exception.
If no value is previous (that is, you are at the beginning of the set), it will give you the last value (circular search).
See also getNext, getPrevious.
This member function returns an integer indicating the size of the invoking set (that is, how many elements it contains).
This member function returns a Boolean value (zero or one) that indicates
whether set
intersects the invoking set. The value one
indicates that the intersection of set
and the invoking set is
not empty (at least one element in common); the value zero indicates that
the intersection of set
and the invoking set is empty (no
elements in common).
This member function removes all the elements of set
from
the invoking set.
This member function removes elt
from the invoking set.
This member function changes the invoking set so that it includes only
the elements of set
. In other words, the invoking set becomes
the intersection of its former elements with the elements of
set
.
This member function changes the invoking set so that it includes only
the element indicated by elt
. In other words, the invoking set
becomes the intersection of its former elements with elt
.