[gecode-users] Creating an empty IntSet?

Mikael Zayenz Lagerkvist zayenz at gmail.com
Mon Nov 5 04:57:19 CET 2007


On 11/5/07, Malcolm Ryan <malcolmr at cse.unsw.edu.au> wrote:
> How do I create an empty IntSet, eg for the initial lower bound of a
> SetVar?
>
> Eg, if I want 'set' to be a a subset of {1,2,3}:
>
>         IntSet empty = ???;
>         IntSet max = new IntSet(1,3);
>          SetVar set = new SetVar(space, empty, max);
>
> How do I create 'empty'?

In C++ there is a constructor for creating the empty InSet, as well as
a static member representing the empty set. Since we did not include
either in Gecode/ (an oversight), you can use the fact that, IIRC,
IntSet(1, 0) will create an empty IntSet.

Cheers,
Mikael


-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list