FRAMES NO FRAMES

Class IlcAnySet

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

Finite sets of pointers are instances of the handle class IlcAnySet. These sets are used by Solver to represent the domains of enumerated constrained variables and to represent the values of constrained set variables. Solver provides an efficient, optimized implementation of finite sets as bit vectors. These finite sets are known formally as instances of the handle classes IlcAnySet or IlcIntSet, depending on whether their elements are pointers or integers.

The elements of finite sets of type IlcAnySet are pointers of type IlcAny. In other words, finite sets of pointers are really sets of pointers to objects of any C++ class.

This class is likely to evolve in future releases of Solver in order to comply with the Standard Template Library adopted by the C++ standard committee.

See Also:

Constructor Summary
public IlcAnySet()
public IlcAnySet(IlcIntSetI * impl)
public IlcAnySet(IloSolver solver, const IlcAnyArray array, IlcBool fullSet=IlcTrue)
Method Summary
public IlcBooladd(IlcAny elt)
public IlcAnySetcopy() const
public IlcIntSetI *getImpl() const
public IlcIntgetSize() const
public IloSolvergetSolver() const
public IlcBoolisIn(IlcAny elt) const
public voidoperator=(const IlcAnySet & h)
public IlcBoolremove(IlcAny elt)
Constructor Detail

IlcAnySet

public IlcAnySet()

This constructor creates an empty handle. You must initialize it before you use it.


IlcAnySet

public IlcAnySet(IlcIntSetI * impl)

This constructor creates a handle object from a pointer to an implementation object.


IlcAnySet

public IlcAnySet(IloSolver solver, const IlcAnyArray array, IlcBool fullSet=IlcTrue)

This constructor creates a finite set of pointers containing the elements of array. If array contains multiple copies of a given value, that value will appear only once in the newly created finite set. If the argument fullset is equal to IlcTrue, the default value, the finite set will initially contain all its possible values. Otherwise, the finite set will initially be empty. In any case, the possible elements of the finite set are exactly those elements in array.


Method Detail

add

public IlcBool add(IlcAny elt)

This member function adds elt to the invoking finite set if elt is a possible member of that set and if elt is not already in that set. When both conditions are met, this member function returns IlcTrue. Otherwise, it returns IlcFalse. The effects of this member function are reversible.


copy

public IlcAnySet copy() const

This member function creates and returns a finite set that contains the same elements as the invoking finite set.


getImpl

public IlcIntSetI * getImpl() const
This constructor creates an object by copying another one.

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


getSize

public IlcInt getSize() const

This member function returns the size of a finite set. Clearly, this member function is useful for testing whether the invoking finite set is empty or not.


getSolver

public IloSolver getSolver() const

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


isIn

public IlcBool isIn(IlcAny elt) const

This member function is a predicate that indicates whether or not elt is in the invoking finite set. It returns IlcTrue if elt is in the set; otherwise, it returns IlcFalse.


operator=

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


remove

public IlcBool remove(IlcAny elt)

This member function removes elt from the invoking finite set. This member function returns IlcFalse if elt was not in that invoking set. Otherwise, it returns IlcTrue. The effects of this member function are reversible.