Generated on Wed Nov 1 15:04:47 2006 for Gecode by doxygen 1.4.5

disjoint.icc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Guido Tack <tack@gecode.org>
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Guido Tack, 2004
00008  *     Christian Schulte, 2004
00009  *
00010  *  Last modified:
00011  *     $Date: 2005-11-24 18:03:01 +0100 (Thu, 24 Nov 2005) $ by $Author: tack $
00012  *     $Revision: 2639 $
00013  *
00014  *  This file is part of Gecode, the generic constraint
00015  *  development environment:
00016  *     http://www.gecode.org
00017  *
00018  *  See the file "LICENSE" for information on usage and
00019  *  redistribution of this file, and for a
00020  *     DISCLAIMER OF ALL WARRANTIES.
00021  *
00022  */
00023 
00024 namespace Gecode { namespace Set { namespace Select {
00025 
00026   forceinline
00027   SelectDisjoint::SelectDisjoint(Space* home,
00028                                  IdxViewArray<SetView>& iv0,
00029                                  SetView y1)
00030     : Propagator(home), iv(iv0), x1(y1) {
00031 
00032     x1.subscribe(home,this, PC_SET_ANY);
00033     iv.subscribe(home,this, PC_SET_ANY);
00034   }
00035 
00036   forceinline
00037   SelectDisjoint::SelectDisjoint(Space* home, bool share, SelectDisjoint& p)
00038     : Propagator(home,share,p) {
00039     x1.update(home,share,p.x1);
00040     iv.update(home,share,p.iv);
00041   }
00042 
00043   forceinline ExecStatus
00044   SelectDisjoint::post(Space* home, IdxViewArray<SetView>& xs,
00045                        SetView x1) {
00046     int n = xs.size();
00047 
00048     // s2 \subseteq {0,...,n-1}
00049     Iter::Ranges::Singleton s(0, n-1);
00050     GECODE_ME_CHECK(x1.intersectI(home,s));
00051     (void) new (home)
00052       SelectDisjoint(home,xs,x1);
00053     return ES_OK;
00054   }
00055 
00056 
00057 }}}
00058 
00059 // STATISTICS: set-prop