/* * Main authors: * Guido Tack * Christian Schulte * * Contributing authors: * Gabor Szokoli * * Copyright: * Guido Tack, 2004 * Christian Schulte, 2004 * Gabor Szokoli, 2004 * * Last modified: * $Date: 2006-08-25 17:31:32 +0200 (Fri, 25 Aug 2006) $ by $Author: tack $ * $Revision: 3573 $ * * 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 Sequence { forceinline ExecStatus propagateSeq(Space* home, bool& modified, bool& assigned, ViewArray& x) { int lastElem = x.size()-1; int cur_max = BndSet::MAX_OF_EMPTY; int cur_min = BndSet::MIN_OF_EMPTY; for (int i=0; i 0) { int glbMax = x[i].glbMax(); cur_max = std::max(cur_max, glbMax); } if (cur_max>=Limits::Set::int_min) GECODE_SET_ME_CHECK_VAL_B(modified, x[i+1].exclude(home, Limits::Set::int_min, cur_max), assigned); if (x[lastElem-i].lubSize() > 0) { int glbMin = x[lastElem-i].glbMin(); cur_min = std::min(cur_min, glbMin); } if (Limits::Set::int_max>=cur_min) GECODE_SET_ME_CHECK_VAL_B(modified, x[lastElem-i-1].exclude(home, cur_min, Limits::Set::int_max), assigned); } return ES_FIX; } forceinline ExecStatus propagateSeqUnion(Space* home, bool& modified, ViewArray& x, SetView& y) { GECODE_AUTOARRAY(GlbRanges, XLBs,x.size()); for (int i=x.size(); i--; ){ GlbRanges lb(x[i]); XLBs[i]=lb; } Iter::Ranges::NaryAppend > u(XLBs,x.size()); GECODE_ME_CHECK_MODIFIED(modified, y.includeI(home,u)); return ES_FIX; } }}} // STATISTICS: set-prop