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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 namespace Gecode { namespace Set { namespace Branch {
00041
00042 forceinline
00043 ValCommitInc::ValCommitInc(Space& home, const ValBranch<Var>& vb)
00044 : ValCommit<SetView,int>(home,vb) {}
00045 forceinline
00046 ValCommitInc::ValCommitInc(Space& home, ValCommitInc& vc)
00047 : ValCommit<SetView,int>(home,vc) {}
00048 forceinline ModEvent
00049 ValCommitInc::commit(Space& home, unsigned int a, SetView x, int, int n) {
00050 return (a == 0) ? x.include(home,n) : x.exclude(home,n);
00051 }
00052 forceinline NGL*
00053 ValCommitInc::ngl(Space& home, unsigned int a, SetView x, int n) const {
00054 if (a == 0)
00055 return new (home) IncNGL(home,x,n);
00056 else
00057 return NULL;
00058 }
00059 forceinline void
00060 ValCommitInc::print(const Space&, unsigned int a, SetView, int i, int n,
00061 std::ostream& o) const {
00062 o << "var[" << i << "]."
00063 << ((a == 0) ? "include" : "exclude") << "(" << n << ")";
00064 }
00065
00066 forceinline
00067 ValCommitExc::ValCommitExc(Space& home, const ValBranch<Var>& vb)
00068 : ValCommit<SetView,int>(home,vb) {}
00069 forceinline
00070 ValCommitExc::ValCommitExc(Space& home, ValCommitExc& vc)
00071 : ValCommit<SetView,int>(home,vc) {}
00072 forceinline ModEvent
00073 ValCommitExc::commit(Space& home, unsigned int a, SetView x, int, int n) {
00074 return (a == 0) ? x.exclude(home,n) : x.include(home,n);
00075 }
00076 forceinline NGL*
00077 ValCommitExc::ngl(Space& home, unsigned int a, SetView x, int n) const {
00078 if (a == 0)
00079 return new (home) ExcNGL(home,x,n);
00080 else
00081 return NULL;
00082 }
00083 forceinline void
00084 ValCommitExc::print(const Space&, unsigned int a, SetView, int i, int n,
00085 std::ostream& o) const {
00086 o << "var[" << i << "]."
00087 << ((a == 0) ? "exclude" : "include") << "(" << n << ")";
00088 }
00089
00090 }}}
00091
00092
00093