Beispiel #1
0
 void exclude(Gecode::Space& home, CPRelVar A, GRelation r) {
   if (home.failed()) return;
   if (r.arity() != A.arity())
     throw ArityMissmatch("Exclude constraint");
   CPRelView a(A);
   auto me = a.exclude(home,r);
   if (me == Gecode::ES_FAILED) {
     home.fail();
   }
 }
void projection(Gecode::Space& home, int p, CPRelVar A, CPRelVar B) {
  if (home.failed()) return;

  typedef boost::error_info<struct tag_proj_descriptor,std::string>
      proj_descriptor;
  if (p > A.arity())
    throw InvalidProjection()
      << errno_code(errno)
      << proj_descriptor("Invalid projection description when posting projection constraint: p has to be valid for A");

  CPRelView left(A);
  CPRelView right(B);
  GECODE_ES_FAIL((Project<CPRelView,CPRelView>::post(home,p,left,right)));
}
Beispiel #3
0
 JoinTest(bool share, JoinTest& sp)
   : Gecode::Space(share,sp) {
   r.update(*this, share, sp.r);
   t.update(*this, share, sp.t);
   s.update(*this, share, sp.s);
 }
Beispiel #4
0
 void print(std::ostream& os, const char* varName, CPRelVar v) const {
   os << "<tr><td><b>" << varName << "</b></td>"
      << "<td>" << v.glb() << "</td>"
      << "<td>" << v.unk() << "</td>"
      << "<td>" << (v.assigned()? "Yes" : "NO") << "</td>";
 }
 PermutationTest(bool share, PermutationTest& sp)
   : Gecode::Space(share,sp) {
   r.update(*this, share, sp.r);
   s.update(*this, share, sp.s);
 }
Beispiel #6
0
 MinimalTest(bool share, MinimalTest& s)
   : Gecode::Space(share,s) {
   r.update(*this, share, s.r);
 }