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