NO FRAMES

Class IloIntSet

Definition file: ilconcert/iloset.h

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:

Constructor Summary
public IloIntSet(const IloEnv, const IloIntArray)
public IloIntSet(const IloEnv, const IloNumArray)
public IloIntSet(const IloEnv)
public IloIntSet(IloIntSetI *)
Method Summary
public voidadd(IloIntSet)
public voidadd(IloInt)
public IloBoolcontains(IloIntSet)
public IloBoolcontains(IloInt)
public voidempty()
public voidend()
public IloEnvgetEnv()
public IloIntSetI *getImpl()
public IloIntgetSize()
public IloBoolintersects(IloIntSet)
public voidremove(IloIntSet)
public voidremove(IloInt)
public voidsetIntersection(IloIntSet)
public voidsetIntersection(IloInt)
Inner Class
IloIntSet::Iterator
Constructor Detail

IloIntSet

public IloIntSet(const IloEnv env, const IloIntArray array)

This constructor creates a set of integer values in the environment env from the elements in array.


IloIntSet

public IloIntSet(const IloEnv env, const IloNumArray array)

This constructor creates a set of numeric values in the environment env from the elements in array.


IloIntSet

public IloIntSet(const IloEnv env)

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.


IloIntSet

public IloIntSet(IloIntSetI * impl)

This constructor creates a handle to a set of numeric values from its implementation object.


Method Detail

add

public void add(IloIntSet set)

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.


add

public void add(IloInt elt)

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.


contains

public IloBool contains(IloIntSet set)

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.


contains

public IloBool contains(IloInt elt)

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.


empty

public void empty()

This member function removes the elements from the invoking set. In other words, the invoking set becomes the empty set.


end

public void end()

This member function deletes an IloIntSet object. This function should be called when the IloIntSet object is no longer needed.


getEnv

public IloEnv getEnv()

This member function returns the environment to which the invoking set belongs.


getImpl

public IloIntSetI * getImpl()

This member function returns a pointer to the implementation object of the invoking set.


getSize

public IloInt getSize()

This member function returns an integer indicating the size of the invoking set (that is, how many elements it contains).


intersects

public IloBool intersects(IloIntSet set)

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).


remove

public void remove(IloIntSet set)

This member function removes all the elements of set from the invoking set.


remove

public void remove(IloInt elt)

This member function removes elt from the invoking set.


setIntersection

public void setIntersection(IloIntSet 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.


setIntersection

public void setIntersection(IloInt elt)

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.