예제 #1
0
 // Copy constructor during cloning
 NoOverlap(Space& home, bool share, NoOverlap& p)
   : Propagator(home,share,p) {
   x.update(home,share,p.x);
   y.update(home,share,p.y);
   // Also copy width and height arrays
   w = home.alloc<int>(x.size());
   h = home.alloc<int>(y.size());
   for (int i=x.size(); i--; ) {
     w[i]=p.w[i]; h[i]=p.h[i];
   }
 }
예제 #2
0
 // copy constructor used during cloning
 NonLinearity(Space& home, bool share, NonLinearity& p) : 
     Propagator(home,share,p), n(p.n), m(p.m), threshold(p.threshold), size(p.size),
     pow2n(p.pow2n), pow2m(p.pow2m) {
         // update the view
         x.update(home, share, p.x);
         // copy the scores
         scores = home.alloc<int>(size);
         std::copy(p.scores, p.scores+size, scores);
         /*
         for(int i=0; i<size; i++) {
             scores[i] = p.scores[i];
         }
         */
         // copy the completed assignments
         assigned = home.alloc<bool>(pow2n);
         std::copy(p.assigned,p.assigned+pow2n,assigned);
         /*
         for(int i=0; i<pow2n; i++) {
             assigned[i] = p.assigned[i];
         }
         */
     }
예제 #3
0
파일: knights.cpp 프로젝트: kenhys/gecode
 /// Copy constructor
 Warnsdorff(Space& home, bool share, Warnsdorff& b) 
   : Brancher(home, share, b), start(b.start) {
   x.update(home, share, b.x);
 }