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