Hi Kish,

Be warned! That's inefficient (well, the int sets are okay efficiencywise).
The very point in Gecode is to not use explicit data structures for sets but
iterators that iterate over them. For pretty much everything that works just
fine and is very very fast!

Chapter 24 in MPG goes crazy about why that's cool!

Christian

--
Christian Schulte, web.ict.kth.se/~cschulte/


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Guido Tack
Sent: Tuesday, July 27, 2010 7:16 PM
To: Kish Shen
Cc: [email protected]
Subject: Re: [gecode-users] obtaining IntVar's domain as IntSet?

Kish Shen wrote:

> Hi,
> 
> Is there anyway to obtain the domain of an IntVar as an independent
object, preferably an IntSet? I looked at the documentation, and can't
figure out how to do this.

Yes, using an IntVarRanges iterator.  If you have an IntVar x, use the
following:

IntSet s(IntVarRanges(x));

Cheers,
        Guido

-- 
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/




_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users


_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to