/* * Main authors: * Guido Tack * Christian Schulte * * Copyright: * Guido Tack, 2004 * Christian Schulte, 2004 * * Last modified: * $Date: 2005-11-24 18:03:01 +0100 (Thu, 24 Nov 2005) $ by $Author: tack $ * $Revision: 2639 $ * * This file is part of Gecode, the generic constraint * development environment: * http://www.gecode.org * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a * DISCLAIMER OF ALL WARRANTIES. * */ namespace Gecode { namespace Set { namespace Select { forceinline SelectDisjoint::SelectDisjoint(Space* home, IdxViewArray& iv0, SetView y1) : Propagator(home), iv(iv0), x1(y1) { x1.subscribe(home,this, PC_SET_ANY); iv.subscribe(home,this, PC_SET_ANY); } forceinline SelectDisjoint::SelectDisjoint(Space* home, bool share, SelectDisjoint& p) : Propagator(home,share,p) { x1.update(home,share,p.x1); iv.update(home,share,p.iv); } forceinline ExecStatus SelectDisjoint::post(Space* home, IdxViewArray& xs, SetView x1) { int n = xs.size(); // s2 \subseteq {0,...,n-1} Iter::Ranges::Singleton s(0, n-1); GECODE_ME_CHECK(x1.intersectI(home,s)); (void) new (home) SelectDisjoint(home,xs,x1); return ES_OK; } }}} // STATISTICS: set-prop