[gecode-users] Intersection

Mikael Zayenz Lagerkvist zayenz at gmail.com
Thu Dec 11 15:03:17 CET 2008


Hi,

You can also use the functions for testing relations between integer views [1].

Cheers,
Mikael

[1] http://www.gecode.org/gecode-doc-latest/group__TaskActorIntTest.html

On Thu, Dec 11, 2008 at 1:56 PM, David Rijsman
<David.Rijsman at quintiq.com> wrote:
> Hi,
>
> what is the easiest way to check if the intersection of two views (of IntVar) is empty in Gecode? My guess would be to use the range iterators for computing intersection something like this:
>
> bool intersects(IntVar& x0, IntVar& x1)
> {
> IntView view0(x0);
> IntView view1(x1);
>
> IntVarRanges vr0(view0);
> IntVarRanges vr1(view1);
>
> Iter::Ranges::Inter<IntVarRanges,IntVarRanges>  i1(vr0,vr1);
>
> return i1();
> }
>
> or is their a pre-defined helper function?
>
> thanks,
>
> David
>
>
>
>
> This message contains information that may be privileged or confidential and is the property of Quintiq. It is only intended for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute or use this message or any part thereof. If you have received this message in error, please notify the sender immediately and delete all copies of this message. Please note that e-mails are susceptible to change, therefore they are not binding.
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>



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




More information about the gecode-users mailing list