seq-u.cc
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "gecode/set.hh"
00029 #include "gecode/set/sequence.hh"
00030
00031 namespace Gecode { namespace Set { namespace Sequence {
00032
00033
00034
00035
00036
00037
00038 Actor*
00039 SeqU::copy(Space* home, bool share) {
00040 return new (home) SeqU(home,share,*this);
00041 }
00042
00043
00044 ExecStatus
00045 SeqU::propagate(Space* home) {
00046 ModEvent me0 = SetView::pme(this);
00047 bool ubevent = Rel::testSetEventUB(me0);
00048 bool lbevent = Rel::testSetEventLB(me0);
00049 bool anybevent = Rel::testSetEventAnyB(me0);
00050 bool cardevent = Rel::testSetEventCard(me0);
00051
00052 bool modified = false;
00053 bool assigned=false;
00054 bool oldModified = false;
00055
00056 do {
00057 oldModified = modified;
00058 modified = false;
00059
00060 if (oldModified || modified || lbevent)
00061 GECODE_ME_CHECK(propagateSeq(home,modified,assigned,x));
00062 if (oldModified || modified || lbevent)
00063 GECODE_ME_CHECK(propagateSeqUnion(home,modified,x,y));
00064 if (oldModified || modified || ubevent)
00065 GECODE_ME_CHECK(RelOp::unionNXiUB(home,modified,x,y,unionOfDets));
00066 if (oldModified || modified || ubevent)
00067 GECODE_ME_CHECK(RelOp::partitionNYUB(home,modified,x,y,unionOfDets));
00068 if (oldModified || modified || anybevent)
00069 GECODE_ME_CHECK(RelOp::partitionNXiLB(home,modified,x,y,unionOfDets));
00070 if (oldModified || modified || cardevent || ubevent)
00071 GECODE_ME_CHECK(RelOp::partitionNCard(home,modified,x,y,unionOfDets));
00072
00073 } while (modified);
00074
00075 for (int i=x.size(); i--;)
00076 if (!x[i].assigned())
00077 return ES_FIX;
00078 return ES_SUBSUMED;
00079 }
00080
00081 }}}
00082
00083