Generated on Sat Jun 2 2018 07:17:44 for Gecode by doxygen 1.8.13
pentominoes.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Mikael Lagerkvist <lagerkvist@gecode.org>
5  *
6  * Contributing authors:
7  * Guido Tack <tack@gecode.org>
8  *
9  * Copyright:
10  * Mikael Lagerkvist, 2006
11  * Guido Tack, 2006
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #include <gecode/driver.hh>
39 #include <gecode/int.hh>
40 #include <gecode/minimodel.hh>
41 
42 using namespace Gecode;
43 
52 class TileSpec {
53 public:
54  int width;
55  int height;
56  int amount;
57  const char *tile;
58 };
59 
68 extern const TileSpec *examples[];
73 extern const int examples_size[];
78 extern const unsigned int n_examples;
79 
80 namespace {
93  int pos(int h, int w, int h1, int w1);
95  typedef void (*tsymmfunc)(const char*, int, int, char*, int&, int&);
97  typedef void (*bsymmfunc)(const IntVarArgs, int, int, IntVarArgs&, int&, int&);
99  template<class CArray, class Array>
100  void id(CArray t1, int w1, int h1, Array t2, int& w2, int&h2);
102  template<class CArray, class Array>
103  void rot90(CArray t1, int w1, int h1, Array t2, int& w2, int& h2);
105  template<class CArray, class Array>
106  void rot180(CArray t1, int w1, int h1, Array t2, int& w2, int& h2);
108  template<class CArray, class Array>
109  void rot270(CArray t1, int w1, int h1, Array t2, int& w2, int& h2);
111  template<class CArray, class Array>
112  void flipx(CArray t1, int w1, int h1, Array t2, int& w2, int& h2);
114  template<class CArray, class Array>
115  void flipy(CArray t1, int w1, int h1, Array t2, int& w2, int& h2);
117  template<class CArray, class Array>
118  void flipd1(CArray t1, int w1, int h1, Array t2, int& w2, int& h2);
120  template<class CArray, class Array>
121  void flipd2(CArray t1, int w1, int h1, Array t2, int& w2, int& h2);
123 }
124 
261 class Pentominoes : public Script {
262 public:
264  enum {
267  };
269  enum {
272  };
273 private:
275  const TileSpec *spec;
277  int width, height;
279  bool filled;
281  int nspecs;
283  int ntiles;
284 
286  IntVarArray board;
287 
289  int compute_number_of_tiles(const TileSpec* ts, int nspecs) {
290  int res = 0;
291  for (int i = nspecs; i--; ) {
292  res += ts[i].amount;
293  }
294  return res;
295  }
296 
299  REG tile_reg(int twidth, int theight, const char* tile,
300  REG mark, REG other, REG eol) {
301  REG oe = other | eol;
302  REG res = *oe;
303  REG color[] = {other, mark};
304  for (int h = 0; h < theight; ++h) {
305  for (int w = 0; w < twidth; ++w) {
306  int which = tile[h*twidth + w] == 'X';
307  res += color[which];
308  }
309  if (h < theight-1) {
310  res += oe(width-twidth, width-twidth);
311  }
312  }
313  res += *oe + oe;
314  return res;
315  }
316 
319  REG get_constraint(int t, REG mark, REG other, REG eol) {
320  // This should be done for all rotations
321  REG res;
322  char *t2 = new char[width*height];
323  int w2, h2;
324  tsymmfunc syms[] = {id, flipx, flipy, flipd1, flipd2, rot90, rot180, rot270};
325  int symscnt = sizeof(syms)/sizeof(tsymmfunc);
326  for (int i = 0; i < symscnt; ++i) {
327  syms[i](spec[t].tile, spec[t].width, spec[t].height, t2, w2, h2);
328  res = res | tile_reg(w2, h2, t2, mark, other, eol);
329  }
330  delete [] t2;
331 
332  return res;
333  }
334 
335 
336 public:
339  : Script(opt), spec(examples[opt.size()]),
340  width(spec[0].width+1), // Add one for extra row at end.
341  height(spec[0].height),
342  filled(spec[0].amount),
343  nspecs(examples_size[opt.size()]-1),
344  ntiles(compute_number_of_tiles(spec+1, nspecs)),
345  board(*this, width*height, filled,ntiles+1) {
346  spec += 1; // No need for the specification-part any longer
347 
348  // Set end-of-line markers
349  for (int h = 0; h < height; ++h) {
350  for (int w = 0; w < width-1; ++w)
351  rel(*this, board[h*width + w], IRT_NQ, ntiles+1);
352  rel(*this, board[h*width + width - 1], IRT_EQ, ntiles+1);
353  }
354 
355  // Post constraints
356  if (opt.propagation() == PROPAGATION_INT) {
357  int tile = 0;
358  for (int i = 0; i < nspecs; ++i) {
359  for (int j = 0; j < spec[i].amount; ++j) {
360  // Color
361  int col = tile+1;
362  // Expression for color col
363  REG mark(col);
364  // Build expression for complement to color col
365  REG other;
366  bool first = true;
367  for (int j = filled; j <= ntiles; ++j) {
368  if (j == col) continue;
369  if (first) {
370  other = REG(j);
371  first = false;
372  } else {
373  other |= REG(j);
374  }
375  }
376  // End of line marker
377  REG eol(ntiles+1);
378  extensional(*this, board, get_constraint(i, mark, other, eol));
379  ++tile;
380  }
381  }
382  } else { // opt.propagation() == PROPAGATION_BOOLEAN
383  int ncolors = ntiles + 2;
384  // Boolean variables for channeling
385  BoolVarArgs p(*this,ncolors * board.size(),0,1);
386 
387  // Post channel constraints
388  for (int i=board.size(); i--; ) {
389  BoolVarArgs c(ncolors);
390  for (int j=ncolors; j--; )
391  c[j]=p[i*ncolors+j];
392  channel(*this, c, board[i]);
393  }
394 
395  // For placing tile i, we construct the expression over
396  // 0/1-variables and apply it to the projection of
397  // the board on the color for the tile.
398  REG other(0), mark(1);
399  int tile = 0;
400  for (int i = 0; i < nspecs; ++i) {
401  for (int j = 0; j < spec[i].amount; ++j) {
402  int col = tile+1;
403  // Projection for color col
404  BoolVarArgs c(board.size());
405 
406  for (int k = board.size(); k--; ) {
407  c[k] = p[k*ncolors+col];
408  }
409 
410  extensional(*this, c, get_constraint(i, mark, other, other));
411  ++tile;
412  }
413  }
414  }
415 
416  if (opt.symmetry() == SYMMETRY_FULL) {
417  // Remove symmetrical boards
418  IntVarArgs orig(board.size()-height), symm(board.size()-height);
419  int pos = 0;
420  for (int i = 0; i < board.size(); ++i) {
421  if ((i+1)%width==0) continue;
422  orig[pos++] = board[i];
423  }
424 
425  int w2, h2;
426  bsymmfunc syms[] = {flipx, flipy, flipd1, flipd2, rot90, rot180, rot270};
427  int symscnt = sizeof(syms)/sizeof(bsymmfunc);
428  for (int i = 0; i < symscnt; ++i) {
429  syms[i](orig, width-1, height, symm, w2, h2);
430  if (width-1 == w2 && height == h2)
431  rel(*this, orig, IRT_LQ, symm);
432  }
433  }
434 
435  // Install branching
436  branch(*this, board, INT_VAR_NONE(), INT_VAL_MIN());
437  }
438 
441  Script(s), spec(s.spec), width(s.width), height(s.height),
442  filled(s.filled), nspecs(s.nspecs) {
443  board.update(*this, s.board);
444  }
445 
447  virtual Space*
448  copy(void) {
449  return new Pentominoes(*this);
450  }
451 
453  virtual void
454  print(std::ostream& os) const {
455  for (int h = 0; h < height; ++h) {
456  os << "\t";
457  for (int w = 0; w < width-1; ++w) {
458  int val = board[h*width + w].val();
459  char c = val < 10 ? '0'+val : 'A' + (val-10);
460  os << c;
461  }
462  os << std::endl;
463  }
464  os << std::endl;
465  }
466 };
467 
468 
472 int
473 main(int argc, char* argv[]) {
474  SizeOptions opt("Pentominoes");
475  opt.size(1);
478  "none", "do not remove symmetric solutions");
480  "full", "remove symmetric solutions");
481 
484  "int", "use integer propagators");
486  "bool", "use Boolean propagators");
487 
488  opt.parse(argc,argv);
489  if (opt.size() >= n_examples) {
490  std::cerr << "Error: size must be between 0 and "
491  << n_examples-1 << std::endl;
492  return 1;
493  }
494  Script::run<Pentominoes,DFS,SizeOptions>(opt);
495  return 0;
496 }
497 
498 
504 static const TileSpec puzzle0[] =
506  {
507  // Width and height of board
508  {4, 4, true, ""},
509  {2, 3, 1,
510  "XX"
511  "X "
512  "X "},
513  {2, 1, 1,
514  "XX"},
515  {3, 3, 1,
516  " XX"
517  " X"
518  "XXX"},
519  {1, 1, 1,
520  "X"},
521  {3, 1, 1,
522  "XXX"}
523  };
525 static const TileSpec puzzle1[] =
526  {
527  // Width and height of board
528  {8, 8, true, ""},
529  {3, 3, 1,
530  "XXX"
531  "XXX"
532  "XX "},
533  {5, 3, 1,
534  " XXX"
535  " X "
536  "XXX "},
537  {3, 4, 1,
538  "XXX"
539  "XXX"
540  " X"
541  " X"},
542  {3, 4, 1,
543  "XXX"
544  " X"
545  " X"
546  " X"},
547  {2, 5, 1,
548  " X"
549  " X"
550  " X"
551  "XX"
552  "XX"},
553  {4, 2, 1,
554  "XX "
555  "XXXX"},
556  {3, 3, 1,
557  "XXX"
558  " X"
559  " X"},
560  {2, 3, 1,
561  "XX"
562  "X "
563  "X "},
564  {2, 4, 1,
565  "XX"
566  "XX"
567  "XX"
568  "XX"},
569  {3, 2, 1,
570  "XX "
571  "XXX"}
572  };
573 
574 // Perfect square number 2 from examples/perfect-square.cc
575 static const TileSpec square2[] =
576  {
577  // Width and height of board
578  {10, 10, true, ""},
579  {6, 6, 1,
580  "XXXXXX"
581  "XXXXXX"
582  "XXXXXX"
583  "XXXXXX"
584  "XXXXXX"
585  "XXXXXX"
586  },
587  {4, 4, 3,
588  "XXXX"
589  "XXXX"
590  "XXXX"
591  "XXXX"},
592  {2, 2, 4,
593  "XX"
594  "XX"}
595  };
596 
597 // Perfect square number 3 from examples/perfect-square.cc
598 static const TileSpec square3[] =
599  {
600  // Width and height of board
601  {20, 20, true, ""},
602  {9, 9, 1,
603  "XXXXXXXXX"
604  "XXXXXXXXX"
605  "XXXXXXXXX"
606  "XXXXXXXXX"
607  "XXXXXXXXX"
608  "XXXXXXXXX"
609  "XXXXXXXXX"
610  "XXXXXXXXX"
611  "XXXXXXXXX"
612  },
613  {8, 8, 2,
614  "XXXXXXXX"
615  "XXXXXXXX"
616  "XXXXXXXX"
617  "XXXXXXXX"
618  "XXXXXXXX"
619  "XXXXXXXX"
620  "XXXXXXXX"
621  "XXXXXXXX"
622  },
623  {7, 7, 1,
624  "XXXXXXX"
625  "XXXXXXX"
626  "XXXXXXX"
627  "XXXXXXX"
628  "XXXXXXX"
629  "XXXXXXX"
630  "XXXXXXX"
631  },
632  {5, 5, 1,
633  "XXXXX"
634  "XXXXX"
635  "XXXXX"
636  "XXXXX"
637  "XXXXX"
638  },
639  {4, 4, 5,
640  "XXXX"
641  "XXXX"
642  "XXXX"
643  "XXXX"},
644  {3, 3, 3,
645  "XXX"
646  "XXX"
647  "XXX"},
648  {2, 2, 2,
649  "XX"
650  "XX"},
651  {1, 1, 2,
652  "X"}
653  };
654 
655 static const TileSpec pentomino6x10[] =
656  {
657  // Width and height of board
658  {10, 6, true, ""},
659  {2, 4, 1,
660  "X "
661  "X "
662  "X "
663  "XX"},
664  {3,3, 1,
665  "XX "
666  " XX"
667  " X "},
668  {3,3, 1,
669  "XXX"
670  " X "
671  " X "},
672  {3,3, 1,
673  " X"
674  " XX"
675  "XX "},
676  {2,4, 1,
677  " X"
678  "XX"
679  " X"
680  " X"},
681  {5,1, 1,
682  "XXXXX"},
683  {3,3, 1,
684  "X "
685  "XXX"
686  " X"},
687  {4,2, 1,
688  " XXX"
689  "XX "},
690  {2,3, 1,
691  "XX"
692  "XX"
693  " X"},
694  {3,2, 1,
695  "X X"
696  "XXX"},
697  {3,3, 1,
698  " X "
699  "XXX"
700  " X "},
701  {3,3, 1,
702  " X"
703  " X"
704  "XXX"}
705  };
706 
707 static const TileSpec pentomino5x12[] =
708  {
709  // Width and height of board
710  {12, 5, true, ""},
711  {2, 4, 1,
712  "X "
713  "X "
714  "X "
715  "XX"},
716  {3,3, 1,
717  "XX "
718  " XX"
719  " X "},
720  {3,3, 1,
721  "XXX"
722  " X "
723  " X "},
724  {3,3, 1,
725  " X"
726  " XX"
727  "XX "},
728  {2,4, 1,
729  " X"
730  "XX"
731  " X"
732  " X"},
733  {5,1, 1,
734  "XXXXX"},
735  {3,3, 1,
736  "X "
737  "XXX"
738  " X"},
739  {4,2, 1,
740  " XXX"
741  "XX "},
742  {2,3, 1,
743  "XX"
744  "XX"
745  " X"},
746  {3,2, 1,
747  "X X"
748  "XXX"},
749  {3,3, 1,
750  " X "
751  "XXX"
752  " X "},
753  {3,3, 1,
754  " X"
755  " X"
756  "XXX"}
757  };
758 
759 static const TileSpec pentomino4x15[] =
760  {
761  // Width and height of board
762  {15, 4, true, ""},
763  {2, 4, 1,
764  "X "
765  "X "
766  "X "
767  "XX"},
768  {3,3, 1,
769  "XX "
770  " XX"
771  " X "},
772  {3,3, 1,
773  "XXX"
774  " X "
775  " X "},
776  {3,3, 1,
777  " X"
778  " XX"
779  "XX "},
780  {2,4, 1,
781  " X"
782  "XX"
783  " X"
784  " X"},
785  {5,1, 1,
786  "XXXXX"},
787  {3,3, 1,
788  "X "
789  "XXX"
790  " X"},
791  {4,2, 1,
792  " XXX"
793  "XX "},
794  {2,3, 1,
795  "XX"
796  "XX"
797  " X"},
798  {3,2, 1,
799  "X X"
800  "XXX"},
801  {3,3, 1,
802  " X "
803  "XXX"
804  " X "},
805  {3,3, 1,
806  " X"
807  " X"
808  "XXX"}
809  };
810 
811 static const TileSpec pentomino3x20[] =
812  {
813  // Width and height of board
814  {20, 3, true, ""},
815  {2, 4, 1,
816  "X "
817  "X "
818  "X "
819  "XX"},
820  {3,3, 1,
821  "XX "
822  " XX"
823  " X "},
824  {3,3, 1,
825  "XXX"
826  " X "
827  " X "},
828  {3,3, 1,
829  " X"
830  " XX"
831  "XX "},
832  {2,4, 1,
833  " X"
834  "XX"
835  " X"
836  " X"},
837  {5,1, 1,
838  "XXXXX"},
839  {3,3, 1,
840  "X "
841  "XXX"
842  " X"},
843  {4,2, 1,
844  " XXX"
845  "XX "},
846  {2,3, 1,
847  "XX"
848  "XX"
849  " X"},
850  {3,2, 1,
851  "X X"
852  "XXX"},
853  {3,3, 1,
854  " X "
855  "XXX"
856  " X "},
857  {3,3, 1,
858  " X"
859  " X"
860  "XXX"}
861  };
862 
864 const TileSpec *examples[] = {puzzle0, puzzle1, square2, square3,
865  pentomino6x10,pentomino5x12,
866  pentomino4x15,pentomino3x20};
867 const int examples_size[] = {sizeof(puzzle0)/sizeof(TileSpec),
868  sizeof(puzzle1)/sizeof(TileSpec),
869  sizeof(square2)/sizeof(TileSpec),
870  sizeof(square3)/sizeof(TileSpec),
871  sizeof(pentomino6x10)/sizeof(TileSpec),
872  sizeof(pentomino5x12)/sizeof(TileSpec),
873  sizeof(pentomino4x15)/sizeof(TileSpec),
874  sizeof(pentomino3x20)/sizeof(TileSpec)};
875 
877 const unsigned n_examples = sizeof(examples)/sizeof(TileSpec*);
879 
880 // Symmetry functions
881 namespace {
882  int pos(int h, int w, int h1, int w1) {
883  if (!(0 <= h && h < h1) ||
884  !(0 <= w && w < w1)) {
885  std::cerr << "Cannot place (" << h << "," << w
886  << ") on board of size " << h1 << "x" << w1 << std::endl;
887  }
888  return h * w1 + w;
889  }
890  template<class CArray, class Array>
891  void id(CArray t1, int w1, int h1, Array t2, int& w2, int&h2) {
892  w2 = w1; h2 = h1;
893  for (int h = 0; h < h1; ++h)
894  for (int w = 0; w < w1; ++w)
895  t2[pos(h, w, h2, w2)] = t1[pos(h, w, h1, w1)];
896  }
897  template<class CArray, class Array>
898  void rot90(CArray t1, int w1, int h1, Array t2, int& w2, int& h2) {
899  w2 = h1; h2 = w1;
900  for (int h = 0; h < h1; ++h)
901  for (int w = 0; w < w1; ++w)
902  t2[pos(w, w2-h-1, h2, w2)] = t1[pos(h, w, h1, w1)];
903  }
904  template<class CArray, class Array>
905  void rot180(CArray t1, int w1, int h1, Array t2, int& w2, int& h2) {
906  w2 = w1; h2 = h1;
907  for (int h = 0; h < h1; ++h)
908  for (int w = 0; w < w1; ++w)
909  t2[pos(h2-h-1, w2-w-1, h2, w2)] = t1[pos(h, w, h1, w1)];
910  }
911  template<class CArray, class Array>
912  void rot270(CArray t1, int w1, int h1, Array t2, int& w2, int& h2) {
913  w2 = h1; h2 = w1;
914  for (int h = 0; h < h1; ++h)
915  for (int w = 0; w < w1; ++w)
916  t2[pos(h2-w-1, h, h2, w2)] = t1[pos(h, w, h1, w1)];
917  }
918  template<class CArray, class Array>
919  void flipx(CArray t1, int w1, int h1, Array t2, int& w2, int& h2) {
920  w2 = w1; h2 = h1;
921  for (int h = 0; h < h1; ++h)
922  for (int w = 0; w < w1; ++w)
923  t2[pos(h, w2-w-1, h2, w2)] = t1[pos(h, w, h1, w1)];
924  }
925  template<class CArray, class Array>
926  void flipy(CArray t1, int w1, int h1, Array t2, int& w2, int& h2) {
927  w2 = w1; h2 = h1;
928  for (int h = 0; h < h1; ++h)
929  for (int w = 0; w < w1; ++w)
930  t2[pos(h2-h-1, w, h2, w2)] = t1[pos(h, w, h1, w1)];
931  }
932  template<class CArray, class Array>
933  void flipd1(CArray t1, int w1, int h1, Array t2, int& w2, int& h2) {
934  w2 = h1; h2 = w1;
935  for (int h = 0; h < h1; ++h)
936  for (int w = 0; w < w1; ++w)
937  t2[pos(w, h, h2, w2)] = t1[pos(h, w, h1, w1)];
938  }
939  template<class CArray, class Array>
940  void flipd2(CArray t1, int w1, int h1, Array t2, int& w2, int& h2) {
941  w2 = h1; h2 = w1;
942  for (int h = 0; h < h1; ++h)
943  for (int w = 0; w < w1; ++w)
944  t2[pos(h2-w-1, w2-h-1, h2, w2)] = t1[pos(h, w, h1, w1)];
945  }
946 }
947 
948 // STATISTICS: example-any
void size(unsigned int s)
Set default size.
Definition: options.hpp:586
int amount
Number of tiles.
Definition: pentominoes.cpp:56
Options for scripts with additional size parameter
Definition: driver.hh:675
NodeType t
Type of node.
Definition: bool-expr.cpp:230
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:96
int width
Width of tile.
Definition: pentominoes.cpp:54
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
Definition: branch.cpp:39
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:41
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:969
void propagation(int v)
Set default propagation value.
Definition: options.hpp:203
Do not remove symmetric solutions.
void update(Space &home, VarArray< Var > &a)
Update array to be a clone of array a.
Definition: array.hpp:1056
IntArgs w1(7, w1v)
Regular expressions over integer values.
Definition: minimodel.hh:1518
Use Boolean propagators.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Definition: options.cpp:666
Less or equal ( )
Definition: int.hh:903
bool pos(const View &x)
Test whether x is postive.
Definition: mult.hpp:41
virtual void print(std::ostream &os) const
Print solution.
int height
Height of tile.
Definition: pentominoes.cpp:55
Integer variable array.
Definition: int.hh:738
IntArgs w2(7, w2v)
void * mark(void *p)
Return marked pointer for unmarked pointer p.
int main(int argc, char *argv[])
Main-function.
Use integer propagators.
Computation spaces.
Definition: core.hpp:1701
Parametric base-class for scripts.
Definition: driver.hh:729
Pentominoes(const SizeOptions &opt)
Construction of the model.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
Gecode::IntArgs i(4, 1, 2, 3, 4)
Equality ( )
Definition: int.hh:901
Options opt
The options.
Definition: test.cpp:97
void extensional(Home home, const IntVarArgs &x, DFA dfa, IntPropLevel)
Post domain consistent propagator for extensional constraint described by a DFA.
Definition: extensional.cpp:43
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:55
unsigned int size(I &i)
Size of all ranges of range iterator i.
virtual Space * copy(void)
Copy space during cloning.
const unsigned int n_examples
Number of board specifications.
Definition: pentominoes.cpp:78
Passing integer variables.
Definition: int.hh:633
Passing Boolean variables.
Definition: int.hh:687
const char * tile
Picture of tile.
Definition: pentominoes.cpp:57
void symmetry(int v)
Set default symmetry value.
Definition: options.hpp:190
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:43
Pentominoes(Pentominoes &s)
Constructor for cloning s.
Gecode toplevel namespace
Disequality ( )
Definition: int.hh:902
Example: Pentominoes
Specification of one tile.
Definition: pentominoes.cpp:52
Remove symmetric solutions.