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 namespace Gecode {
00037
00038 inline void
00039 atmost(Home home, const IntVarArgs& x, int n, int m,
00040 IntPropLevel ipl) {
00041 count(home,x,n,IRT_LQ,m,ipl);
00042 }
00043 inline void
00044 atmost(Home home, const IntVarArgs& x, IntVar y, int m,
00045 IntPropLevel ipl) {
00046 count(home,x,y,IRT_LQ,m,ipl);
00047 }
00048 inline void
00049 atmost(Home home, const IntVarArgs& x, const IntArgs& y, int m,
00050 IntPropLevel ipl) {
00051 count(home,x,y,IRT_LQ,m,ipl);
00052 }
00053 inline void
00054 atmost(Home home, const IntVarArgs& x, int n, IntVar z,
00055 IntPropLevel ipl) {
00056 count(home,x,n,IRT_LQ,z,ipl);
00057 }
00058 inline void
00059 atmost(Home home, const IntVarArgs& x, IntVar y, IntVar z,
00060 IntPropLevel ipl) {
00061 count(home,x,y,IRT_LQ,z,ipl);
00062 }
00063 inline void
00064 atmost(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
00065 IntPropLevel ipl) {
00066 count(home,x,y,IRT_LQ,z,ipl);
00067 }
00068
00069 inline void
00070 atleast(Home home, const IntVarArgs& x, int n, int m,
00071 IntPropLevel ipl) {
00072 count(home,x,n,IRT_GQ,m,ipl);
00073 }
00074 inline void
00075 atleast(Home home, const IntVarArgs& x, IntVar y, int m,
00076 IntPropLevel ipl) {
00077 count(home,x,y,IRT_GQ,m,ipl);
00078 }
00079 inline void
00080 atleast(Home home, const IntVarArgs& x, const IntArgs& y, int m,
00081 IntPropLevel ipl) {
00082 count(home,x,y,IRT_GQ,m,ipl);
00083 }
00084 inline void
00085 atleast(Home home, const IntVarArgs& x, int n, IntVar z,
00086 IntPropLevel ipl) {
00087 count(home,x,n,IRT_GQ,z,ipl);
00088 }
00089 inline void
00090 atleast(Home home, const IntVarArgs& x, IntVar y, IntVar z,
00091 IntPropLevel ipl) {
00092 count(home,x,y,IRT_GQ,z,ipl);
00093 }
00094 inline void
00095 atleast(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
00096 IntPropLevel ipl) {
00097 count(home,x,y,IRT_GQ,z,ipl);
00098 }
00099
00100 inline void
00101 exactly(Home home, const IntVarArgs& x, int n, int m,
00102 IntPropLevel ipl) {
00103 count(home,x,n,IRT_EQ,m,ipl);
00104 }
00105 inline void
00106 exactly(Home home, const IntVarArgs& x, IntVar y, int m,
00107 IntPropLevel ipl) {
00108 count(home,x,y,IRT_EQ,m,ipl);
00109 }
00110 inline void
00111 exactly(Home home, const IntVarArgs& x, const IntArgs& y, int m,
00112 IntPropLevel ipl) {
00113 count(home,x,y,IRT_EQ,m,ipl);
00114 }
00115 inline void
00116 exactly(Home home, const IntVarArgs& x, int n, IntVar z,
00117 IntPropLevel ipl) {
00118 count(home,x,n,IRT_EQ,z,ipl);
00119 }
00120 inline void
00121 exactly(Home home, const IntVarArgs& x, IntVar y, IntVar z,
00122 IntPropLevel ipl) {
00123 count(home,x,y,IRT_EQ,z,ipl);
00124 }
00125 inline void
00126 exactly(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
00127 IntPropLevel ipl) {
00128 count(home,x,y,IRT_EQ,z,ipl);
00129 }
00130
00131 inline void
00132 lex(Home home, const IntVarArgs& x, IntRelType r, const IntVarArgs& y,
00133 IntPropLevel ipl) {
00134 rel(home,x,r,y,ipl);
00135 }
00136 inline void
00137 lex(Home home, const BoolVarArgs& x, IntRelType r, const BoolVarArgs& y,
00138 IntPropLevel ipl) {
00139 rel(home,x,r,y,ipl);
00140 }
00141
00142 inline void
00143 values(Home home, const IntVarArgs& x, IntSet y,
00144 IntPropLevel ipl) {
00145 dom(home,x,y,ipl);
00146 nvalues(home,x,IRT_EQ,static_cast<int>(y.size()),ipl);
00147 }
00148
00149 #ifdef GECODE_HAS_SET_VARS
00150
00151 inline void
00152 channel(Home home, const IntVarArgs& x, SetVar y) {
00153 rel(home,SOT_UNION,x,y);
00154 nvalues(home,x,IRT_EQ,expr(home,cardinality(y)));
00155 }
00156
00157 inline void
00158 range(Home home, const IntVarArgs& x, SetVar y, SetVar z) {
00159 element(home,SOT_UNION,x,y,z);
00160 }
00161
00162 inline void
00163 roots(Home home, const IntVarArgs& x, SetVar y, SetVar z) {
00164 SetVarArgs xiv(home,z.lubMax()+1,IntSet::empty,0,x.size()-1);
00165 channel(home,x,xiv);
00166 element(home,SOT_UNION,xiv,z,y);
00167 }
00168
00169 #endif
00170
00171 }
00172
00173
00174