Generated on Thu Jul 25 2019 00:00:00 for Gecode by doxygen 1.8.15
set.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Guido Tack <tack@gecode.org>
5  * Christian Schulte <schulte@gecode.org>
6  *
7  * Contributing authors:
8  * Gabor Szokoli <szokoli@gecode.org>
9  *
10  * Copyright:
11  * Guido Tack, 2004
12  * Christian Schulte, 2004
13  * Gabor Szokoli, 2004
14  *
15  * Last modified:
16  * $Date: 2017-04-01 20:27:10 +0200 (Sat, 01 Apr 2017) $ by $Author: schulte $
17  * $Revision: 15623 $
18  *
19  * This file is part of Gecode, the generic constraint
20  * development environment:
21  * http://www.gecode.org
22  *
23  * Permission is hereby granted, free of charge, to any person obtaining
24  * a copy of this software and associated documentation files (the
25  * "Software"), to deal in the Software without restriction, including
26  * without limitation the rights to use, copy, modify, merge, publish,
27  * distribute, sublicense, and/or sell copies of the Software, and to
28  * permit persons to whom the Software is furnished to do so, subject to
29  * the following conditions:
30  *
31  * The above copyright notice and this permission notice shall be
32  * included in all copies or substantial portions of the Software.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41  *
42  */
43 
44 #ifndef __GECODE_SET_HH__
45 #define __GECODE_SET_HH__
46 
47 #include <gecode/kernel.hh>
48 #include <gecode/int.hh>
49 #include <gecode/iter.hh>
50 
51 #include <functional>
52 
53 /*
54  * Configure linking
55  *
56  */
57 #if !defined(GECODE_STATIC_LIBS) && \
58  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
59 
60 #ifdef GECODE_BUILD_SET
61 #define GECODE_SET_EXPORT __declspec( dllexport )
62 #else
63 #define GECODE_SET_EXPORT __declspec( dllimport )
64 #endif
65 
66 #else
67 
68 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
69 #define GECODE_SET_EXPORT __attribute__ ((visibility("default")))
70 #else
71 #define GECODE_SET_EXPORT
72 #endif
73 
74 #endif
75 
76 // Configure auto-linking
77 #ifndef GECODE_BUILD_SET
78 #define GECODE_LIBRARY_NAME "Set"
80 #endif
81 
82 
94 #include <gecode/set/exception.hpp>
95 
96 namespace Gecode { namespace Set {
97 
99  namespace Limits {
101  const int max = (Gecode::Int::Limits::max / 2) - 1;
103  const int min = -max;
105  const unsigned int card = max-min+1;
107  void check(int n, const char* l);
109  void check(unsigned int n, const char* l);
111  void check(const IntSet& s, const char* l);
112  }
113 
114 }}
115 
116 #include <gecode/set/limits.hpp>
117 
118 #include <gecode/set/var-imp.hpp>
119 
120 namespace Gecode {
121 
122  namespace Set {
123  class SetView;
124  }
125 
131  class SetVar : public VarImpVar<Set::SetVarImp> {
132  friend class SetVarArray;
133  friend class SetVarArgs;
135  public:
137 
138  SetVar(void);
141  SetVar(const SetVar& y);
143  SetVar(const Set::SetView& y);
144 
147 
166  SetVar(Space& home,int glbMin,int glbMax,int lubMin,int lubMax,
167  unsigned int cardMin = 0,
168  unsigned int cardMax = Set::Limits::card);
169 
187  SetVar(Space& home,const IntSet& glbD,int lubMin,int lubMax,
188  unsigned int cardMin = 0,
189  unsigned int cardMax = Set::Limits::card);
190 
209  SetVar(Space& home,int glbMin,int glbMax,const IntSet& lubD,
210  unsigned int cardMin = 0,
211  unsigned int cardMax = Set::Limits::card);
212 
231  SetVar(Space& home,const IntSet& glbD,const IntSet& lubD,
232  unsigned int cardMin = 0,
233  unsigned int cardMax = Set::Limits::card);
235 
237 
238  unsigned int glbSize(void) const;
241  unsigned int lubSize(void) const;
243  unsigned int unknownSize(void) const;
245  unsigned int cardMin(void) const;
247  unsigned int cardMax(void) const;
249  int lubMin(void) const;
251  int lubMax(void) const;
253  int glbMin(void) const;
255  int glbMax(void) const;
257 
259 
260  bool contains(int i) const;
263  bool notContains(int i) const;
265  };
266 
272 
275  private:
277  public:
279 
280  SetVarGlbRanges(void);
283  SetVarGlbRanges(const SetVar& x);
285 
287 
288  bool operator ()(void) const;
291  void operator ++(void);
293 
295 
296  int min(void) const;
299  int max(void) const;
301  unsigned int width(void) const;
303  };
304 
307  private:
309  public:
311 
312  SetVarLubRanges(void);
315  SetVarLubRanges(const SetVar& x);
317 
319 
320  bool operator ()(void) const;
323  void operator ++(void);
325 
327 
328  int min(void) const;
331  int max(void) const;
333  unsigned int width(void) const;
335  };
336 
339  private:
341  public:
343 
344  SetVarUnknownRanges(void);
347  SetVarUnknownRanges(const SetVar& x);
349 
351 
352  bool operator ()(void) const;
355  void operator ++(void);
357 
359 
360  int min(void) const;
363  int max(void) const;
365  unsigned int width(void) const;
367  };
368 
371  private:
373  public:
375 
376  SetVarGlbValues(void);
379  SetVarGlbValues(const SetVar& x);
381 
383 
384  bool operator ()(void) const;
387  void operator ++(void);
389 
391 
392  int val(void) const;
395  };
396 
399  private:
401  public:
403 
404  SetVarLubValues(void);
407  SetVarLubValues(const SetVar& x);
409 
411 
412  bool operator ()(void) const;
415  void operator ++(void);
417 
419 
420  int val(void) const;
423  };
424 
427  private:
429  public:
431 
432  SetVarUnknownValues(void);
435  SetVarUnknownValues(const SetVar& x);
437 
439 
440  bool operator ()(void) const;
443  void operator ++(void);
445 
447 
448  int val(void) const;
451  };
452 
454 
459  template<class Char, class Traits>
460  std::basic_ostream<Char,Traits>&
461  operator <<(std::basic_ostream<Char,Traits>& os, const SetVar& x);
462 
463 }
464 
465 #include <gecode/set/view.hpp>
466 
467 namespace Gecode {
477 
478 }
479 
481 
482 namespace Gecode {
483 
492  class SetVarArgs : public VarArgArray<SetVar> {
493  public:
495 
496  SetVarArgs(void);
499  explicit SetVarArgs(int n);
501  SetVarArgs(const SetVarArgs& a);
503  SetVarArgs(const VarArray<SetVar>& a);
505  SetVarArgs(const std::vector<SetVar>& a);
507  template<class InputIterator>
508  SetVarArgs(InputIterator first, InputIterator last);
516  SetVarArgs(Space& home,int n,int glbMin,int glbMax,
517  int lubMin,int lubMax,
518  unsigned int minCard = 0,
519  unsigned int maxCard = Set::Limits::card);
527  SetVarArgs(Space& home,int n,const IntSet& glb,
528  int lubMin, int lubMax,
529  unsigned int minCard = 0,
530  unsigned int maxCard = Set::Limits::card);
538  SetVarArgs(Space& home,int n,int glbMin,int glbMax,
539  const IntSet& lub,
540  unsigned int minCard = 0,
541  unsigned int maxCard = Set::Limits::card);
549  SetVarArgs(Space& home,int n,
550  const IntSet& glb,const IntSet& lub,
551  unsigned int minCard = 0,
552  unsigned int maxCard = Set::Limits::card);
554  };
556 
572  class SetVarArray : public VarArray<SetVar> {
573  public:
575 
576  SetVarArray(void);
579  SetVarArray(const SetVarArray&);
581  SetVarArray(Space& home, const SetVarArgs&);
583  GECODE_SET_EXPORT SetVarArray(Space& home, int n);
591  SetVarArray(Space& home,int n,int glbMin,int glbMax,int lubMin,int lubMax,
592  unsigned int minCard = 0,
593  unsigned int maxCard = Set::Limits::card);
601  SetVarArray(Space& home,int n,const IntSet& glb, int lubMin, int lubMax,
602  unsigned int minCard = 0,
603  unsigned int maxCard = Set::Limits::card);
611  SetVarArray(Space& home,int n,int glbMin,int glbMax,const IntSet& lub,
612  unsigned int minCard = 0,
613  unsigned int maxCard = Set::Limits::card);
621  SetVarArray(Space& home,int n,
622  const IntSet& glb,const IntSet& lub,
623  unsigned int minCard = 0,
624  unsigned int maxCard = Set::Limits::card);
626  };
627 
628 }
629 
630 #include <gecode/set/array.hpp>
631 
632 namespace Gecode {
633 
645  enum SetRelType {
656  };
657 
662  enum SetOpType {
667  };
668 
676 
678  GECODE_SET_EXPORT void
679  dom(Home home, SetVar x, SetRelType r, int i);
681  GECODE_SET_EXPORT void
682  dom(Home home, const SetVarArgs& x, SetRelType r, int i);
684  GECODE_SET_EXPORT void
685  dom(Home home, SetVar x, SetRelType r, int i, int j);
687  GECODE_SET_EXPORT void
688  dom(Home home, const SetVarArgs& x, SetRelType r, int i, int j);
690  GECODE_SET_EXPORT void
691  dom(Home home, SetVar x, SetRelType r, const IntSet& s);
693  GECODE_SET_EXPORT void
694  dom(Home home, const SetVarArgs& x, SetRelType r, const IntSet& s);
696  GECODE_SET_EXPORT void
697  cardinality(Home home, SetVar x, unsigned int i, unsigned int j);
699  GECODE_SET_EXPORT void
700  cardinality(Home home, const SetVarArgs& x, unsigned int i, unsigned int j);
702  GECODE_SET_EXPORT void
703  dom(Home home, SetVar x, SetRelType rt, int i, Reify r);
705  GECODE_SET_EXPORT void
706  dom(Home home, SetVar x, SetRelType rt, int i, int j, Reify r);
708  GECODE_SET_EXPORT void
709  dom(Home home, SetVar x, SetRelType rt, const IntSet& s, Reify r);
711  GECODE_SET_EXPORT void
712  dom(Home home, SetVar x, SetVar d);
714  GECODE_SET_EXPORT void
715  dom(Home home, const SetVarArgs& x, const SetVarArgs& d);
717 
718 
726 
728  GECODE_SET_EXPORT void
729  rel(Home home, SetVar x, SetRelType r, SetVar y);
730 
732  GECODE_SET_EXPORT void
733  rel(Home home, SetVar x, SetRelType rt, SetVar y, Reify r);
734 
736  GECODE_SET_EXPORT void
737  rel(Home home, SetVar s, SetRelType r, IntVar x);
738 
740  GECODE_SET_EXPORT void
741  rel(Home home, IntVar x, SetRelType r, SetVar s);
742 
744  GECODE_SET_EXPORT void
745  rel(Home home, SetVar s, SetRelType rt, IntVar x, Reify r);
746 
748  GECODE_SET_EXPORT void
749  rel(Home home, IntVar x, SetRelType rt, SetVar s, Reify r);
750 
752  GECODE_SET_EXPORT void
753  rel(Home home, SetVar s, IntRelType rt, IntVar x);
754 
756  void
757  rel(Home home, IntVar x, IntRelType rt, SetVar s);
758 
760  GECODE_SET_EXPORT void
761  rel(Home home, SetVar s, IntRelType rt, IntVar x, Reify r);
762 
764  void
765  rel(Home home, IntVar x, IntRelType rt, SetVar s, Reify r);
767 
768 }
769 
770 #include <gecode/set/int.hpp>
771 
772 namespace Gecode {
773 
781 
783  GECODE_SET_EXPORT void
785 
787  GECODE_SET_EXPORT void
788  rel(Home home, SetOpType op, const SetVarArgs& x, SetVar y);
789 
791  GECODE_SET_EXPORT void
792  rel(Home home, SetOpType op, const SetVarArgs& x, const IntSet& z, SetVar y);
793 
795  GECODE_SET_EXPORT void
796  rel(Home home, SetOpType op, const IntVarArgs& x, const IntSet& z, SetVar y);
797 
799  GECODE_SET_EXPORT void
800  rel(Home home, SetOpType op, const IntVarArgs& x, SetVar y);
801 
803  GECODE_SET_EXPORT void
804  rel(Home home, const IntSet& x, SetOpType op, SetVar y,
805  SetRelType r, SetVar z);
806 
808  GECODE_SET_EXPORT void
809  rel(Home home, SetVar x, SetOpType op, const IntSet& y,
810  SetRelType r, SetVar z);
811 
813  GECODE_SET_EXPORT void
814  rel(Home home, SetVar x, SetOpType op, SetVar y,
815  SetRelType r, const IntSet& z);
816 
818  GECODE_SET_EXPORT void
819  rel(Home home, const IntSet& x, SetOpType op, SetVar y, SetRelType r,
820  const IntSet& z);
821 
823  GECODE_SET_EXPORT void
824  rel(Home home, SetVar x, SetOpType op, const IntSet& y, SetRelType r,
825  const IntSet& z);
826 
831  GECODE_SET_EXPORT void
832  ite(Home home, BoolVar b, SetVar x, SetVar y, SetVar z);
833 
835 
836 
843 
845  GECODE_SET_EXPORT void
846  convex(Home home, SetVar x);
847 
849  GECODE_SET_EXPORT void
850  convex(Home home, SetVar x, SetVar y);
851 
853 
860 
862  GECODE_SET_EXPORT void
863  sequence(Home home, const SetVarArgs& x);
864 
866  GECODE_SET_EXPORT void
867  sequence(Home home, const SetVarArgs& y, SetVar x);
868 
870 
877 
878 
880  GECODE_SET_EXPORT void
881  atmostOne(Home home, const SetVarArgs& x, unsigned int c);
882 
884 
892 
895  GECODE_SET_EXPORT void
896  min(Home home, SetVar s, IntVar x);
897 
900  GECODE_SET_EXPORT void
901  notMin(Home home, SetVar s, IntVar x);
902 
905  GECODE_SET_EXPORT void
906  min(Home home, SetVar s, IntVar x, Reify r);
907 
910  GECODE_SET_EXPORT void
911  max(Home home, SetVar s, IntVar x);
912 
915  GECODE_SET_EXPORT void
916  notMax(Home home, SetVar s, IntVar x);
917 
920  GECODE_SET_EXPORT void
921  max(Home home, SetVar s, IntVar x, Reify r);
922 
924  GECODE_SET_EXPORT void
925  cardinality(Home home, SetVar s, IntVar x);
926 
928  GECODE_SET_EXPORT void
929  cardinality(Home home, SetVar s, IntVar x, Reify r);
930 
941  GECODE_SET_EXPORT void
943  SetVar x, IntVar y);
944 
946 
954 
956  GECODE_SET_EXPORT void
957  channel(Home home, const IntVarArgs& x,const SetVarArgs& y);
958 
960  GECODE_SET_EXPORT void
961  channelSorted(Home home, const IntVarArgs& x, SetVar y);
962 
964  GECODE_SET_EXPORT void
965  channel(Home home, const BoolVarArgs& x, SetVar y);
966 
968  GECODE_SET_EXPORT void
969  channel(Home home, const SetVarArgs& x, const SetVarArgs& y);
970 
972 
984  GECODE_SET_EXPORT void
985  precede(Home home, const SetVarArgs& x, int s, int t);
989  GECODE_SET_EXPORT void
990  precede(Home home, const SetVarArgs& x, const IntArgs& c);
991 
1005 
1015  GECODE_SET_EXPORT void
1016  element(Home home, SetOpType op, const SetVarArgs& x, SetVar y, SetVar z,
1018 
1028  GECODE_SET_EXPORT void
1029  element(Home home, SetOpType op, const IntVarArgs& x, SetVar y, SetVar z,
1031 
1041  GECODE_SET_EXPORT void
1042  element(Home home, SetOpType op, const IntSetArgs& x, SetVar y, SetVar z,
1044 
1054  GECODE_SET_EXPORT void
1055  element(Home home, SetOpType op, const IntArgs& x, SetVar y, SetVar z,
1057 
1063  GECODE_SET_EXPORT void
1064  element(Home home, const SetVarArgs& x, IntVar y, SetVar z);
1065 
1071  GECODE_SET_EXPORT void
1072  element(Home home, const IntSetArgs& s, IntVar y, SetVar z);
1073 
1079  GECODE_SET_EXPORT void
1080  element(Home home, const IntSetArgs& a,
1081  IntVar x, int w, IntVar y, int h, SetVar z);
1087  GECODE_SET_EXPORT void
1088  element(Home home, const SetVarArgs& a,
1089  IntVar x, int w, IntVar y, int h, SetVar z);
1091 
1102  GECODE_SET_EXPORT void
1104  wait(Home home, SetVar x, std::function<void(Space& home)> c);
1106  GECODE_SET_EXPORT void
1107  wait(Home home, const SetVarArgs& x,
1108  std::function<void(Space& home)> c);
1110 
1111 }
1112 
1113 namespace Gecode {
1114 
1128  typedef std::function<bool(const Space& home, SetVar x, int i)>
1140  typedef std::function<double(const Space& home, SetVar x, int i)>
1142 
1153  typedef std::function<int(const Space& home, SetVar x, int i)>
1155 
1167  typedef std::function<void(Space& home, unsigned int a,
1168  SetVar x, int i, int n)>
1170 
1171 }
1172 
1174 
1175 namespace Gecode {
1176 
1182  class SetAFC : public AFC {
1183  public:
1191  SetAFC(void);
1193  SetAFC(const SetAFC& a);
1195  SetAFC& operator =(const SetAFC& a);
1197  SetAFC(Home home, const SetVarArgs& x, double d=1.0);
1205  void init(Home home, const SetVarArgs& x, double d=1.0);
1206  };
1207 
1208 }
1209 
1210 #include <gecode/set/branch/afc.hpp>
1211 
1212 namespace Gecode {
1213 
1214 
1220  class SetAction : public Action {
1221  public:
1229  SetAction(void);
1231  SetAction(const SetAction& a);
1233  SetAction& operator =(const SetAction& a);
1243  SetAction(Home home, const SetVarArgs& x, double d=1.0,
1244  SetBranchMerit bm=nullptr);
1256  GECODE_SET_EXPORT void
1257  init(Home home, const SetVarArgs& x, double d=1.0,
1258  SetBranchMerit bm=nullptr);
1259  };
1260 
1261 }
1262 
1264 
1265 namespace Gecode {
1266 
1272  class SetCHB : public CHB {
1273  public:
1281  SetCHB(void);
1283  SetCHB(const SetCHB& chb);
1285  SetCHB& operator =(const SetCHB& chb);
1295  SetCHB(Home home, const SetVarArgs& x, SetBranchMerit bm=nullptr);
1307  GECODE_SET_EXPORT void
1308  init(Home home, const SetVarArgs& x, SetBranchMerit bm=nullptr);
1309  };
1310 
1311 }
1312 
1313 #include <gecode/set/branch/chb.hpp>
1314 
1315 namespace Gecode {
1316 
1318  typedef std::function<void(const Space &home, const Brancher& b,
1319  unsigned int a,
1320  SetVar x, int i, const int& n,
1321  std::ostream& o)>
1323 
1324 }
1325 
1326 namespace Gecode {
1327 
1333  class SetVarBranch : public VarBranch<SetVar> {
1334  public:
1336  enum Select {
1337  SEL_NONE = 0,
1363  };
1364  protected:
1367  public:
1369  SetVarBranch(void);
1371  SetVarBranch(Rnd r);
1375  SetVarBranch(Select s, double d, BranchTbl t);
1385  Select select(void) const;
1387  void expand(Home home, const SetVarArgs& x);
1388  };
1389 
1395  SetVarBranch SET_VAR_NONE(void);
1408  SetVarBranch SET_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
1412  SetVarBranch SET_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
1416  SetVarBranch SET_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
1420  SetVarBranch SET_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
1448  SetVarBranch SET_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
1452  SetVarBranch SET_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
1456  SetVarBranch SET_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
1460  SetVarBranch SET_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
1472 
1473 }
1474 
1475 #include <gecode/set/branch/var.hpp>
1476 
1477 namespace Gecode {
1478 
1484  class SetValBranch : public ValBranch<SetVar> {
1485  public:
1487  enum Select {
1497  };
1498  protected:
1501  public:
1509  Select select(void) const;
1510  };
1511 
1542 
1543 }
1544 
1545 #include <gecode/set/branch/val.hpp>
1546 
1547 namespace Gecode {
1548 
1554  class SetAssign : public ValBranch<SetVar> {
1555  public:
1557  enum Select {
1567  };
1568  protected:
1571  public:
1575  SetAssign(Select s, Rnd r);
1579  Select select(void) const;
1580  };
1581 
1611 
1612 }
1613 
1615 
1616 namespace Gecode {
1617 
1623  GECODE_SET_EXPORT void
1624  branch(Home home, const SetVarArgs& x,
1625  SetVarBranch vars, SetValBranch vals,
1626  SetBranchFilter bf=nullptr,
1627  SetVarValPrint vvp=nullptr);
1633  GECODE_SET_EXPORT void
1634  branch(Home home, const SetVarArgs& x,
1635  TieBreak<SetVarBranch> vars, SetValBranch vals,
1636  SetBranchFilter bf=nullptr,
1637  SetVarValPrint vvp=nullptr);
1643  GECODE_SET_EXPORT void
1644  branch(Home home, SetVar x, SetValBranch vals,
1645  SetVarValPrint vvp=nullptr);
1651  GECODE_SET_EXPORT void
1652  assign(Home home, const SetVarArgs& x, SetAssign vals,
1653  SetBranchFilter bf=nullptr,
1654  SetVarValPrint vvp=nullptr);
1660  GECODE_SET_EXPORT void
1661  assign(Home home, SetVar x, SetAssign vals,
1662  SetVarValPrint vvp=nullptr);
1663 
1664 }
1665 
1666 // LDSB-related declarations.
1667 namespace Gecode {
1669  GECODE_SET_EXPORT SymmetryHandle VariableSymmetry(const SetVarArgs& x);
1676  SymmetryHandle VariableSequenceSymmetry(const SetVarArgs& x, int ss);
1683  GECODE_SET_EXPORT void
1684  branch(Home home, const SetVarArgs& x,
1685  SetVarBranch vars, SetValBranch vals,
1686  const Symmetries& syms,
1687  SetBranchFilter bf=nullptr,
1688  SetVarValPrint vvp=nullptr);
1695  GECODE_SET_EXPORT void
1696  branch(Home home, const SetVarArgs& x,
1697  TieBreak<SetVarBranch> vars, SetValBranch vals,
1698  const Symmetries& syms,
1699  SetBranchFilter bf=nullptr,
1700  SetVarValPrint vvp=nullptr);
1701 }
1702 
1703 namespace Gecode {
1704 
1705  /*
1706  * \brief Relaxed assignment of variables in \a x from values in \a sx
1707  *
1708  * The variables in \a x are assigned values from the assigned variables
1709  * in the solution \a sx with a relaxation probability \a p. That is,
1710  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
1711  * assigned a value from \a sx.
1712  *
1713  * The random numbers are generated from the generator \a r. At least
1714  * one variable will not be assigned: in case the relaxation attempt
1715  * would suggest that all variables should be assigned, a single
1716  * variable will be selected randomly to remain unassigned.
1717  *
1718  * Throws an exception of type Set::ArgumentSizeMismatch, if \a x and
1719  * \a sx are of different size.
1720  *
1721  * Throws an exception of type Set::OutOfLimits, if \a p is not between
1722  * \a 0.0 and \a 1.0.
1723  *
1724  * \ingroup TaskModeSet
1725  */
1726  GECODE_SET_EXPORT void
1727  relax(Home home, const SetVarArgs& x, const SetVarArgs& sx,
1728  Rnd r, double p);
1729 
1730 }
1731 
1733 
1734 namespace Gecode {
1735 
1746  protected:
1748  public:
1750  class Glb
1751  : public Iter::Ranges::Diff<Set::GlbRanges<Set::SetView>,
1752  Iter::Ranges::RangeList> {
1753  protected:
1758  public:
1760 
1764  };
1767  class Lub
1768  : public Iter::Ranges::Diff<Iter::Ranges::RangeList,
1769  Set::LubRanges<Set::SetView> > {
1770  protected:
1775  public:
1777 
1781  };
1784 
1788 
1790  Glb& glb(void);
1793  Lub& lub(void);
1795  };
1796 
1797 }
1798 
1799 #include <gecode/set/trace/delta.hpp>
1800 
1801 #include <gecode/set/trace/traits.hpp>
1802 
1803 namespace Gecode {
1804 
1815 
1821  protected:
1823  std::ostream& os;
1824  public:
1826  StdSetTracer(std::ostream& os0 = std::cerr);
1828  virtual void init(const Space& home, const SetTraceRecorder& t);
1830  virtual void prune(const Space& home, const SetTraceRecorder& t,
1831  const ViewTraceInfo& vti, int i, SetTraceDelta& d);
1833  virtual void fix(const Space& home, const SetTraceRecorder& t);
1835  virtual void fail(const Space& home, const SetTraceRecorder& t);
1837  virtual void done(const Space& home, const SetTraceRecorder& t);
1840  };
1841 
1842 
1847  GECODE_SET_EXPORT void
1848  trace(Home home, const SetVarArgs& x,
1849  TraceFilter tf,
1850  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
1856  void
1857  trace(Home home, const SetVarArgs& x,
1858  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
1860 
1861 }
1862 
1863 #include <gecode/set/trace.hpp>
1864 
1865 #endif
1866 
1867 // IFDEF: GECODE_HAS_SET_VARS
1868 // STATISTICS: set-post
Initialize with strategy SEL_NONE SetVarBranch(void)
Definition: var.hpp:41
void operator++(void)
Move iterator to next value (if possible)
Definition: set.hpp:200
Which values to select for branching first.
Definition: set.hh:1484
Exclude median element (rounding downwards)
Definition: set.hh:1561
void channelSorted(Home home, const IntVarArgs &x, SetVar y)
Definition: channel.cpp:49
Glb(RangeList *o, Set::SetView n)
Initialize with old glb and new glb.
Definition: delta.hpp:41
CHB & operator=(const CHB &a)
Assignment operator.
Definition: chb.cpp:54
ViewTracer< Set::SetView > SetTracer
Tracer for set variables.
Definition: set.hh:1809
SetVarArray(void)
Default constructor (array of size 0)
Definition: array.hpp:77
Recording actions for set variables.
Definition: set.hh:1220
Post propagator for SetVar SetOpType op
Definition: set.hh:784
SetVarBranch SET_VAR_CHB_SIZE_MIN(BranchTbl tbl)
Definition: var.hpp:270
bool operator()(void) const
Test whether iterator is still at a value or done.
Definition: set.hpp:195
Which value to select Select s
Definition: set.hh:1500
SetVarBranch SET_VAR_SIZE_MIN(BranchTbl tbl)
Definition: var.hpp:210
Variables as interfaces to variable implementations.
Definition: var.hpp:51
int lubMin(void) const
Return minimum element of least upper bound.
Definition: set.hpp:88
NodeType t
Type of node.
Definition: bool-expr.cpp:234
Tracer that process view trace information.
Definition: tracer.hpp:55
void check(int n, const char *l)
Check whether integer n is in range, otherwise throw overflow exception with information l.
Definition: limits.hpp:41
SetRelType
Common relation types for sets.
Definition: set.hh:645
With highest action.
Definition: set.hh:1346
Glb & glb(void)
Give access to iterator for delta in greatest lower bound (values that have been included)
Definition: delta.hpp:56
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Definition: set.hpp:158
With lowest CHB Q-score.
Definition: set.hh:1347
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
void notMin(Home home, SetVar s, IntVar x)
Definition: int.cpp:239
Initialize with selection strategy a CHB a c
Definition: set.hh:1380
Range iterator for the unknown set.
Definition: var-imp.hpp:406
int max(void) const
Return largest value of range.
Definition: set.hpp:127
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
Return selection strategy Select select(void) const
Definition: val.hpp:53
const int min
Smallest allowed integer in integer set.
Definition: set.hh:103
View trace information.
Definition: core.hpp:974
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
Definition: sequence.cpp:51
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition: set.hpp:142
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:43
Set::LubRanges< Set::SetView > n
Iterator over new lub.
Definition: set.hh:1774
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:45
int min(void) const
Return smallest value of range.
Definition: set.hpp:150
Initialize with selection strategy a s SetAssign(Select s=SEL_MIN_INC)
Definition: assign.hpp:41
With largest maximum unknown element.
Definition: set.hh:1352
With largest minimum unknown element.
Definition: set.hh:1350
First unassigned.
Definition: set.hh:1337
Include median element (rounding downwards)
Definition: set.hh:1560
With largest action divided by domain size.
Definition: set.hh:1360
SetVarBranch SET_VAR_MERIT_MAX(SetBranchMerit bm, BranchTbl tbl)
Definition: var.hpp:115
With smallest accumulated failure count divided by domain size.
Definition: set.hh:1357
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:53
Set::GlbRanges< Set::SetView > n
Iterator over new glb.
Definition: set.hh:1757
Standard set variable tracer.
Definition: set.hh:1820
Range iterator for range lists
Select value according to user-defined functions.
Definition: set.hh:1496
Exclude random element.
Definition: set.hh:1495
std::function< double(const Space &home, SetVar x, int i)> SetBranchMerit
Branch merit function type for set variables.
Definition: set.hh:1141
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:44
With largest accumulated failure count divided by domain size.
Definition: set.hh:1358
With smallest degree.
Definition: set.hh:1341
Expand and CHB void expand(Home home, const SetVarArgs &x)
Definition: var.hpp:78
Exclude random element.
Definition: set.hh:1565
SetVarBranch SET_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Definition: var.hpp:225
SetCHB(void)
Construct as not yet initialized.
Definition: chb.hpp:41
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition: set.hpp:170
Exclude smallest element.
Definition: set.hh:1559
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: set.hpp:79
With smallest CHB Q-score divided by domain size.
Definition: set.hh:1361
Range iterator for the greatest lower bound.
Definition: var-imp.hpp:363
Exclude largest element.
Definition: set.hh:1563
With highest CHB Q-score.
Definition: set.hh:1348
With smallest accumulated failure count.
Definition: set.hh:1343
SetValBranch SET_VAL_MED_INC(void)
Definition: val.hpp:69
SetVarBranch SET_VAR_MAX_MAX(BranchTbl tbl)
Definition: var.hpp:205
SetValBranch SET_VAL_RND_INC(Rnd r)
Definition: val.hpp:89
SetOpType
Common operations for sets.
Definition: set.hh:662
Superset ( )
Definition: set.hh:649
int min(void) const
Return smallest value of range.
Definition: set.hpp:178
Complement.
Definition: set.hh:651
const unsigned int card
Maximum cardinality of an integer set.
Definition: set.hh:105
Iter::Ranges::RangeList o
Iterator over old glb.
Definition: set.hh:1755
With largest degree divided by domain size.
Definition: set.hh:1356
const int max
Largest allowed integer in integer set.
Definition: set.hh:101
SetVarBranch SET_VAR_NONE(void)
Definition: var.hpp:100
int min(void) const
Return smallest value of range.
Definition: set.hpp:123
Trace init events.
const int max
Largest allowed integer value.
Definition: int.hh:116
With smallest action divided by domain size.
Definition: set.hh:1359
SetVarBranch SET_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Definition: var.hpp:220
Which variable to select Select s
Definition: set.hh:1366
Computation spaces.
Definition: core.hpp:1748
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition: rel.hpp:257
Lub & lub(void)
Give access iterator for delta in leat bound (values that have been removed)
Definition: delta.hpp:60
SetAssign SET_ASSIGN_RND_INC(Rnd r)
Definition: assign.hpp:89
Difference.
Definition: set.hh:666
Include random element.
Definition: set.hh:1564
Range iterator for the least upper bound.
Definition: var-imp.hpp:321
int glbMin(void) const
Return minimum element of greatest lower bound.
Definition: set.hpp:94
Include largest element.
Definition: set.hh:1562
SetTraceDelta(Set::SetTraceView o, Set::SetView n, const Delta &d)
Initialize with old trace view o, new view n, and delta d.
Definition: delta.hpp:52
Iterator for the unknown ranges of a set variable.
Definition: set.hh:338
Duplicate of a set view.
Definition: trace-view.hpp:41
Gecode::IntSet d(v, 7)
Iterator for the values in the unknown set of a set variable.
Definition: set.hh:426
With largest unknown set.
Definition: set.hh:1354
int lubMax(void) const
Return maximum element of least upper bound.
Definition: set.hpp:91
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
Trace prune events.
Exclude smallest element.
Definition: set.hh:1489
SetVarBranch SET_VAR_AFC_MAX(double d, BranchTbl tbl)
Definition: var.hpp:140
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Definition: ldsb.cpp:66
Which value to select Select s
Definition: set.hh:1570
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
SetVarLubRanges(void)
Default constructor.
Definition: set.hpp:134
Gecode::IntArgs i(4, 1, 2, 3, 4)
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:44
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
unsigned int unknownSize(void) const
Return number of unknown elements (elements in lub but not in glb)
Definition: set.hpp:73
unsigned int glbSize(void) const
Return number of elements in the greatest lower bound.
Definition: set.hpp:67
SetVarBranch SET_VAR_CHB_SIZE_MAX(BranchTbl tbl)
Definition: var.hpp:280
std::function< void(Space &home, unsigned int a, SetVar x, int i, int n)> SetBranchCommit
Branch commit function type for set variables.
Definition: set.hh:1169
SetAssign SET_ASSIGN_MAX_INC(void)
Definition: assign.hpp:79
int val(void) const
Return current value.
Definition: set.hpp:247
SetVarBranch SET_VAR_DEGREE_MIN(BranchTbl tbl)
Definition: var.hpp:120
IntRelType
Relation types for integers.
Definition: int.hh:906
SetVarBranch SET_VAR_DEGREE_MAX(BranchTbl tbl)
Definition: var.hpp:125
With largest CHB Q-score divided by domain size.
Definition: set.hh:1362
SetVarBranch SET_VAR_CHB_MAX(BranchTbl tbl)
Definition: var.hpp:180
void init(Home home, const SetVarArgs &x, double d=1.0, SetBranchMerit bm=nullptr)
Initialize for set variables x with decay factor d.
Definition: action.cpp:49
Less or equal ( )
Definition: set.hh:652
Lub(RangeList *o, Set::SetView n)
Initialize with old lub o and new lub n.
Definition: delta.hpp:46
unsigned int cardMin(void) const
Return cardinality minimum.
Definition: set.hpp:82
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition: branch-var.hpp:52
std::ostream & os
Output stream to use.
Definition: set.hh:1823
Value iterator from range iterator.
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Definition: exec.cpp:44
Class for CHB management.
Definition: chb.hpp:50
Reification specification.
Definition: int.hh:857
Iter::Ranges::RangeList o
Iterator over old lub.
Definition: set.hh:1772
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Iterator for the greatest lower bound ranges of a set variable.
Definition: set.hh:274
Subset ( )
Definition: set.hh:648
Trace filters.
SetAction(void)
Construct as not yet initialized.
Definition: action.hpp:41
Recording CHB for set variables.
Definition: set.hh:1272
Intersection
Definition: set.hh:665
Include random element.
Definition: set.hh:1494
Integer sets.
Definition: int.hh:174
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition: set.hh:784
SetVarBranch SET_VAR_AFC_MIN(double d, BranchTbl tbl)
Definition: var.hpp:130
With smallest degree divided by domain size.
Definition: set.hh:1355
Less ( )
Definition: set.hh:653
SetVarBranch SET_VAR_RND(Rnd r)
Definition: var.hpp:105
Recording AFC information for set variables.
Definition: set.hh:1182
Initialize with selection strategy a branch merit function a mf
Definition: set.hh:1382
int n
Number of variables (size)
Definition: array.hpp:89
Exclude median element (rounding downwards)
Definition: set.hh:1491
SetVarBranch SET_VAR_MERIT_MIN(SetBranchMerit bm, BranchTbl tbl)
Definition: var.hpp:110
void convex(Home home, SetVar x)
Definition: convex.cpp:45
Iterator for the least upper bound ranges of a set variable.
Definition: set.hh:306
Include largest element.
Definition: set.hh:1492
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Definition: set.hpp:186
int glbMax(void) const
Return maximum of greatest lower bound.
Definition: set.hpp:97
Function type for printing branching alternatives for set variables typedef std::function< void(const Space &home, const Brancher &b, unsigned int a, SetVar x, int i, const int &n, std::ostream &o)> SetVarValPrint
Definition: set.hh:1322
SetAssign SET_ASSIGN_MED_INC(void)
Definition: assign.hpp:69
Passing integer variables.
Definition: int.hh:639
void operator++(void)
Move iterator to next value (if possible)
Definition: set.hpp:242
SetVarBranch SET_VAR_MIN_MAX(BranchTbl tbl)
Definition: var.hpp:195
SetValBranch SET_VAL_MIN_EXC(void)
Definition: val.hpp:64
Passing integer arguments.
Definition: int.hh:610
Passing Boolean variables.
Definition: int.hh:693
SetValBranch SET_VAL_MIN_INC(void)
Definition: val.hpp:59
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition: set.hpp:115
void init(Home home, const SetVarArgs &x, SetBranchMerit bm=nullptr)
Initialize for set variables x.
Definition: chb.cpp:48
int max(void) const
Return largest value of range.
Definition: set.hpp:182
SetVarLubValues(void)
Default constructor.
Trace delta information for set variables.
Definition: set.hh:1745
Boolean integer variables.
Definition: int.hh:494
SetVarArgs(void)
Allocate empty array.
Definition: array.hpp:52
LinIntExpr cardinality(const SetExpr &e)
Cardinality of set expression.
Definition: set-expr.cpp:818
SetValBranch SET_VAL_MAX_EXC(void)
Definition: val.hpp:84
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:784
With smallest maximum unknown element.
Definition: set.hh:1351
const int v[7]
Definition: distinct.cpp:263
Propagator for recording view trace information.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:71
Set view for set variables
Definition: view.hpp:60
void atmostOne(Home home, const SetVarArgs &xa, unsigned int c)
Definition: distinct.cpp:45
SetValBranch SET_VAL_MAX_INC(void)
Definition: val.hpp:79
Union.
Definition: set.hh:663
SetVarBranch SET_VAR_MAX_MIN(BranchTbl tbl)
Definition: var.hpp:200
Passing set variables.
Definition: set.hh:492
SetVarBranch SET_VAR_SIZE_MAX(BranchTbl tbl)
Definition: var.hpp:215
Greater or equal ( )
Definition: set.hh:654
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:784
int max(void) const
Return largest value of range.
Definition: set.hpp:154
Value branching information.
Definition: branch-val.hpp:45
Trace done events.
SetAssign SET_ASSIGN_RND_EXC(Rnd r)
Definition: assign.hpp:94
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
Definition: relax.cpp:61
void operator++(void)
Move iterator to next range (if possible)
Definition: set.hpp:119
Variable branching information.
Definition: branch-var.hpp:59
SetValBranch SET_VAL_MED_EXC(void)
Definition: val.hpp:74
Generic domain change information to be supplied to advisors.
Definition: core.hpp:281
Set variables
Definition: set.hh:131
SetValBranch SET_VAL_RND_EXC(Rnd r)
Definition: val.hpp:94
Delta for the least upper bound.
Definition: set.hh:1767
Disjoint union.
Definition: set.hh:664
SetAssign SET_ASSIGN_MIN_INC(void)
Definition: assign.hpp:59
SetVarUnknownValues(void)
Default constructor.
With largest degree.
Definition: set.hh:1342
void operator++(void)
Move iterator to next range (if possible)
Definition: set.hpp:146
Rnd r
Random number generator.
Definition: branch-val.hpp:53
SetAssign SET_ASSIGN(SetBranchVal v, SetBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:99
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel)
Post propagator that s precedes t in x.
Definition: precede.cpp:47
SetVarBranch SET_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl)
Definition: var.hpp:230
Integer variables.
Definition: int.hh:353
Iterator for the values in the greatest lower bound of a set variable.
Definition: set.hh:370
Action & operator=(const Action &a)
Assignment operator.
Definition: action.cpp:54
SetAssign SET_ASSIGN_MED_EXC(void)
Definition: assign.hpp:74
Include smallest element.
Definition: set.hh:1488
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:47
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Definition: set.hpp:131
Initialize with selection strategy a s SetValBranch(Select s=SEL_MIN_INC)
Definition: val.hpp:41
Greater ( )
Definition: set.hh:655
Equality ( )
Definition: set.hh:646
Disjoint ( )
Definition: set.hh:650
std::function< bool(const Space &home, SetVar x, int i)> SetBranchFilter
Branch filter function type for set variables.
Definition: set.hh:1129
SetAssign SET_ASSIGN_MAX_EXC(void)
Definition: assign.hpp:84
void notMax(Home home, SetVar s, IntVar x)
Definition: int.cpp:271
bool operator()(void) const
Test whether iterator is still at a value or done.
Definition: set.hpp:237
Trace fail events.
Return selection strategy Select select(void) const
Definition: var.hpp:73
Post propagator for SetVar x
Definition: set.hh:784
Archive & operator<<(Archive &e, FloatNumBranch nl)
Definition: val-sel.hpp:43
Include smallest element.
Definition: set.hh:1558
Trace fixpoint events.
Initialize with selection strategy a decay factor a d
Definition: set.hh:1374
int n
Number of elements.
Definition: array.hpp:527
unsigned int cardMax(void) const
Return cardinality maximum.
Definition: set.hpp:85
SetVarUnknownRanges(void)
Default constructor.
Definition: set.hpp:161
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:43
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Definition: ldsb.cpp:94
SetValBranch SET_VAL(SetBranchVal v, SetBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: val.hpp:99
bool contains(int i) const
Test whether i is in greatest lower bound.
Definition: set.hpp:76
Set variable array
Definition: set.hh:572
Lists of ranges (intervals)
Definition: range-list.hpp:53
Random (uniform, for tie breaking)
Definition: set.hh:1338
Disequality ( )
Definition: set.hh:647
Which value to select for assignment.
Definition: set.hh:1554
Delta for the greatest lower bound.
Definition: set.hh:1750
SetAssign SET_ASSIGN_MIN_EXC(void)
Definition: assign.hpp:64
void operator++(void)
Move iterator to next range (if possible)
Definition: set.hpp:174
Gecode toplevel namespace
Argument array for variables.
Definition: array.hpp:53
void weights(Home home, IntSharedArray elements, IntSharedArray weights, SetVar x, IntVar y)
Definition: int.cpp:296
With highest merit.
Definition: set.hh:1340
int val(void) const
Return current value.
Definition: set.hpp:205
Class for action management.
Definition: action.hpp:46
Range iterator for computing set difference.
Definition: ranges-diff.hpp:47
SetVarBranch SET_VAR_ACTION_MAX(double d, BranchTbl tbl)
Definition: var.hpp:160
AFC & operator=(const AFC &a)
Assignment operator.
Definition: afc.hpp:147
SetVarBranch SET_VAR_MIN_MIN(BranchTbl tbl)
Definition: var.hpp:190
SetVarBranch SET_VAR_CHB_MIN(BranchTbl tbl)
Definition: var.hpp:170
void operator++(void)
Move iterator to next value (if possible)
Definition: set.hpp:221
Which variable to select for branching.
Definition: set.hh:1333
Random number generator.
Definition: rnd.hpp:46
SetVarGlbRanges(void)
Default constructor.
Definition: set.hpp:107
SetVarBranch SET_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Definition: var.hpp:240
ViewTraceRecorder< Set::SetView > SetTraceRecorder
Trace recorder for set variables.
Definition: set.hh:1814
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:115
Return selection strategy Select select(void) const
Definition: assign.hpp:53
SetVar(void)
Default constructor.
Definition: set.hpp:50
void init(Home home, const SetVarArgs &x, double d=1.0)
Initialize for set variables x with decay factor d.
Definition: afc.hpp:58
Exclude largest element.
Definition: set.hh:1493
Home class for posting propagators
Definition: core.hpp:922
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:65
bool operator()(void) const
Test whether iterator is still at a value or done.
Definition: set.hpp:216
Include median element (rounding downwards)
Definition: set.hh:1490
With largest accumulated failure count.
Definition: set.hh:1344
SetVarBranch SET_VAR_ACTION_SIZE_MAX(double d, BranchTbl tbl)
Definition: var.hpp:260
int val(void) const
Return current value.
Definition: set.hpp:226
SetVarGlbValues(void)
Default constructor.
std::function< int(const Space &home, SetVar x, int i)> SetBranchVal
Branch value function type for set variables.
Definition: set.hh:1154
Shared array with arbitrary number of elements.
Select value according to user-defined functions.
Definition: set.hh:1566
SetAFC(void)
Construct as not yet initialized.
Definition: afc.hpp:41
#define GECODE_SET_EXPORT
Definition: set.hh:71
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:43
SetVarBranch SET_VAR_ACTION_SIZE_MIN(double d, BranchTbl tbl)
Definition: var.hpp:250
Iterator for the values in the least upper bound of a set variable.
Definition: set.hh:398
static StdSetTracer def
Default tracer (printing to std::cerr)
Definition: set.hh:1839
Initialize with selection strategy a afc a a
Definition: set.hh:1376
With smallest unknown set.
Definition: set.hh:1353
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
Definition: element.cpp:43
unsigned int lubSize(void) const
Return number of elements in the least upper bound.
Definition: set.hpp:70
SetVar * a
Element array.
Definition: array.hpp:531
With smallest minimum unknown element.
Definition: set.hh:1349
SetVarBranch SET_VAR_ACTION_MIN(double d, BranchTbl tbl)
Definition: var.hpp:150