seq-u.icc
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 "set/rel.hh"
00029
00030 namespace Gecode { namespace Set { namespace Sequence {
00031
00032
00033
00034
00035
00036
00037 forceinline
00038 SeqU::SeqU(Space* home, ViewArray<SetView>& x, SetView y)
00039 : NaryOnePropagator<SetView,PC_SET_ANY>(home,x, y) {}
00040
00041 forceinline
00042 SeqU::SeqU(Space* home, bool share, SeqU& p)
00043 : NaryOnePropagator<SetView,PC_SET_ANY>(home,share,p) {
00044 unionOfDets.update(home, p.unionOfDets);
00045 }
00046
00047 forceinline ExecStatus
00048 SeqU::post(Space* home, ViewArray<SetView> x, SetView y) {
00049 switch (x.size()) {
00050 case 0:
00051 GECODE_ME_CHECK(y.cardMax(home, 0));
00052 return ES_OK;
00053 case 1:
00054 return Rel::Eq<SetView,SetView>::post(home, x[0], y);
00055 default:
00056 if (x.shared() || x.shared(y))
00057 return ES_FAILED;
00058 (void) new (home) SeqU(home,x,y);
00059 return ES_OK;
00060 }
00061 }
00062
00063 }}}
00064
00065