rel.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 #include "gecode/int/rel.hh"
00023
00024 namespace Gecode { namespace Int { namespace Count {
00025
00026
00027
00028
00029
00030
00031 template <class VX>
00032 forceinline RelTest
00033 holds(VX x, ConstIntView y) {
00034 return rtest_eq_dom(x,y.val());
00035 }
00036 template <class VX>
00037 forceinline RelTest
00038 holds(VX x, VX y) {
00039 return rtest_eq_dom(x,y);
00040 }
00041 template <class VX>
00042 forceinline ExecStatus
00043 post_true(Space* home, VX x, ConstIntView y) {
00044 GECODE_ME_CHECK(x.eq(home,y.val()));
00045 return ES_SUBSUMED;
00046 }
00047 template <class VX>
00048 forceinline ExecStatus
00049 post_true(Space* home, ViewArray<VX>& x, ConstIntView y) {
00050 for (int i = x.size(); i--; )
00051 GECODE_ME_CHECK(x[i].eq(home,y.val()));
00052 return ES_SUBSUMED;
00053 }
00054 template <class VX>
00055 forceinline ExecStatus
00056 post_false(Space* home, VX x, ConstIntView y) {
00057 GECODE_ME_CHECK(x.nq(home,y.val()));
00058 return ES_SUBSUMED;
00059 }
00060 template <class VX>
00061 forceinline ExecStatus
00062 post_false(Space* home, ViewArray<VX>& x, ConstIntView y) {
00063 for (int i = x.size(); i--; )
00064 GECODE_ME_CHECK(x[i].nq(home,y.val()));
00065 return ES_SUBSUMED;
00066 }
00067 template <class VX>
00068 forceinline ExecStatus
00069 post_true(Space* home, ViewArray<VX>& x, VX y) {
00070 ViewArray<VX> z(home,x.size()+1);
00071 z[x.size()] = y;
00072 for (int i = x.size(); i--; )
00073 z[i] = x[i];
00074 GECODE_ES_CHECK(Rel::NaryEqDom<VX>::post(home,z));
00075 return ES_SUBSUMED;
00076 }
00077 template <class VX>
00078 forceinline ExecStatus
00079 post_true(Space* home, VX x, VX y) {
00080 GECODE_ES_CHECK((Rel::EqDom<VX,VX>::post(home,x,y)));
00081 return ES_SUBSUMED;
00082 }
00083 template <class VX>
00084 forceinline ExecStatus
00085 post_false(Space* home, ViewArray<VX>& x, VX y) {
00086 for (int i = x.size(); i--; )
00087 GECODE_ES_CHECK(Rel::Nq<VX>::post(home,x[i],y));
00088 return ES_SUBSUMED;
00089 }
00090 template <class VX>
00091 forceinline ExecStatus
00092 post_false(Space* home, VX x, VX y) {
00093 GECODE_ES_CHECK(Rel::Nq<VX>::post(home,x,y));
00094 return ES_SUBSUMED;
00095 }
00096
00097 }}}
00098
00099
00100