NO FRAMES

IloCard

public IloIntVar IloCard(IloAnySetVar vars)
Definition file: ilconcert/iloanyset.h

This function creates and returns a constrained numeric variable that represents the number of elements in vars. In other words, it constrains the cardinality of a set variable.

For example, to constrain mySet to contain four or more elements, you can use IloCard in the following way:

 model.add (IloCard (mySet) >= 4);