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