Generated on for Gecode by doxygen 1.17.0
int.hh
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Christian Schulte <schulte@gecode.dev>
5 * Guido Tack <tack@gecode.dev>
6 *
7 * Contributing authors:
8 * Stefano Gualandi <stefano.gualandi@gmail.com>
9 * Mikael Zayenz Lagerkvist <lagerkvist@gecode.dev>
10 * David Rijsman <David.Rijsman@quintiq.com>
11 * Samuel Gagnon <samuel.gagnon92@gmail.com>
12 *
13 * Copyright:
14 * Stefano Gualandi, 2013
15 * Mikael Zayenz Lagerkvist, 2006, 2026
16 * David Rijsman, 2009
17 * Christian Schulte, 2002
18 * Guido Tack, 2004
19 * Samuel Gagnon, 2018
20 *
21 * This file is part of Gecode, the generic constraint
22 * development environment:
23 * http://www.gecode.dev
24 *
25 * Permission is hereby granted, free of charge, to any person obtaining
26 * a copy of this software and associated documentation files (the
27 * "Software"), to deal in the Software without restriction, including
28 * without limitation the rights to use, copy, modify, merge, publish,
29 * distribute, sublicense, and/or sell copies of the Software, and to
30 * permit persons to whom the Software is furnished to do so, subject to
31 * the following conditions:
32 *
33 * The above copyright notice and this permission notice shall be
34 * included in all copies or substantial portions of the Software.
35 *
36 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
40 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
41 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
42 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43 *
44 */
45
46#ifndef GECODE_INT_HH
47#define GECODE_INT_HH
48
49#include <climits>
50#include <cfloat>
51
52#ifdef GECODE_HAS_FAULT_INJECTION
53#include <atomic>
54#endif
55
56#include <iostream>
57#include <vector>
58#include <unordered_map>
59#include <functional>
60#include <utility>
61#include <initializer_list>
62
63#include <gecode/kernel.hh>
64#include <gecode/search.hh>
65#include <gecode/iter.hh>
66
67/*
68 * Configure linking
69 *
70 */
71#if !defined(GECODE_STATIC_LIBS) && \
72 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
73
74#ifdef GECODE_BUILD_INT
75#define GECODE_INT_EXPORT __declspec( dllexport )
76#else
77#define GECODE_INT_EXPORT __declspec( dllimport )
78#endif
79
80#else
81
82#ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
83#define GECODE_INT_EXPORT __attribute__ ((visibility("default")))
84#else
85#define GECODE_INT_EXPORT
86#endif
87
88#endif
89
90// Configure auto-linking
91#ifndef GECODE_BUILD_INT
92#define GECODE_LIBRARY_NAME "Int"
94#endif
95
106
108
109namespace Gecode { namespace Int {
110
118 namespace Limits {
120 const int max = INT_MAX - 1;
122 const int min = -max;
124 const int infinity = max + 1;
126 const long long int llmax = LLONG_MAX - 1;
128 const long long int llmin = -llmax;
130 const long long int llinfinity = llmax + 1;
132 bool valid(int n);
134 bool valid(long long int n);
136 void check(int n, const char* l);
138 void check(long long int n, const char* l);
140 void positive(int n, const char* l);
142 void positive(long long int n, const char* l);
144 void nonnegative(int n, const char* l);
146 void nonnegative(long long int n, const char* l);
148 bool overflow_add(int n, int m);
150 bool overflow_add(long long int n, long long int m);
152 bool overflow_sub(int n, int m);
154 bool overflow_sub(long long int n, long long int m);
156 bool overflow_mul(int n, int m);
158 bool overflow_mul(long long int n, long long int m);
159 }
160
161}}
162
163#include <gecode/int/limits.hpp>
164
165namespace Gecode {
166
167 class IntSetRanges;
168
169 template<class I> class IntSetInit;
170
178 class IntSet : public SharedHandle {
179 friend class IntSetRanges;
180 template<class I> friend class IntSetInit;
181 private:
183 class Range {
184 public:
185 int min, max;
186 };
187 class IntSetObject : public SharedHandle::Object {
188 public:
190 unsigned int size;
192 int n;
194 Range* r;
195#ifdef GECODE_HAS_FAULT_INJECTION
197 static std::atomic<int> fault_live_objects;
199 static void* operator new(size_t s);
201 static void operator delete(void* p);
202#endif
204 GECODE_INT_EXPORT static IntSetObject* allocate(int m);
206 GECODE_INT_EXPORT bool in(int n) const;
208 GECODE_INT_EXPORT bool equal(const IntSetObject& so) const;
210 GECODE_INT_EXPORT virtual ~IntSetObject(void);
211 };
213 class MinInc;
215 GECODE_INT_EXPORT void normalize(Range* r, int n);
217 GECODE_INT_EXPORT void init(int n, int m);
219 GECODE_INT_EXPORT void init(const int r[], int n);
221 GECODE_INT_EXPORT void init(const int r[][2], int n);
222 public:
223#ifdef GECODE_HAS_FAULT_INJECTION
225 GECODE_INT_EXPORT static void fault_reset_allocations(void);
227 GECODE_INT_EXPORT static int fault_live_allocations(void);
228#endif
230
231
232 IntSet(void);
237 explicit IntSet(int n, int m);
239 explicit IntSet(const int r[], int n);
245 explicit IntSet(const int r[][2], int n);
247 template<class I>
248 explicit IntSet(I& i);
250 template<class I>
251 explicit IntSet(const I& i);
254 explicit IntSet(std::initializer_list<int> r);
261 explicit IntSet(std::initializer_list<std::pair<int,int>> r);
263
265
266
267 int ranges(void) const;
269 int min(int i) const;
271 int max(int i) const;
273 unsigned int width(int i) const;
275
277
278
279 bool in(int n) const;
281 unsigned int size(void) const;
283 unsigned int width(void) const;
285 int min(void) const;
287 int max(void) const;
289
291
292
293 bool operator ==(const IntSet& s) const;
295 bool operator !=(const IntSet& s) const;
297
299
300
303 };
304
311 private:
313 const IntSet::Range* i;
315 const IntSet::Range* e;
316 public:
318
319
320 IntSetRanges(void);
322 IntSetRanges(const IntSet& s);
324 void init(const IntSet& s);
326
328
329
330 bool operator ()(void) const;
332 void operator ++(void);
334
336
337
338 int min(void) const;
340 int max(void) const;
342 unsigned int width(void) const;
344 };
345
351 class IntSetValues : public Iter::Ranges::ToValues<IntSetRanges> {
352 public:
354
355
356 IntSetValues(void);
358 IntSetValues(const IntSet& s);
360 void init(const IntSet& s);
362 };
363
368 template<class Char, class Traits>
369 std::basic_ostream<Char,Traits>&
370 operator <<(std::basic_ostream<Char,Traits>& os, const IntSet& s);
371
372}
373
375
376#include <gecode/int/var-imp.hpp>
377
378namespace Gecode {
379
380 namespace Int {
381 class IntView;
382 }
383
389 class IntVar : public VarImpVar<Int::IntVarImp> {
390 friend class IntVarArray;
391 friend class IntVarArgs;
392 private:
400 void _init(Space& home, int min, int max);
407 void _init(Space& home, const IntSet& d);
408 public:
410
411
412 IntVar(void);
414 IntVar(const IntVar& y);
416 IntVar(const Int::IntView& y);
442
444
445
446 int min(void) const;
448 int max(void) const;
450 int med(void) const;
458 int val(void) const;
459
461 unsigned int size(void) const;
463 unsigned int width(void) const;
465 unsigned int regret_min(void) const;
467 unsigned int regret_max(void) const;
469
471
472
473 bool range(void) const;
475 bool in(int n) const;
477
479 IntVar& operator =(const IntVar&) = default;
480 };
481
486 template<class Char, class Traits>
487 std::basic_ostream<Char,Traits>&
488 operator <<(std::basic_ostream<Char,Traits>& os, const IntVar& x);
489
495 public:
497
498
499 IntVarRanges(void);
501 IntVarRanges(const IntVar& x);
503 void init(const IntVar& x);
505 };
506
511 class IntVarValues : public Iter::Ranges::ToValues<IntVarRanges> {
512 public:
514
515
516 IntVarValues(void);
518 IntVarValues(const IntVar& x);
520 void init(const IntVar& x);
522 };
523
524 namespace Int {
525 class BoolView;
526 }
527
533 class BoolVar : public VarImpVar<Int::BoolVarImp> {
534 friend class BoolVarArray;
535 friend class BoolVarArgs;
536 private:
544 void _init(Space& home, int min, int max);
545 public:
547
548
549 BoolVar(void);
551 BoolVar(const BoolVar& y);
553 BoolVar(const Int::BoolView& y);
567
569
570
571 int min(void) const;
573 int max(void) const;
575 int med(void) const;
583 int val(void) const;
584
586 unsigned int size(void) const;
588 unsigned int width(void) const;
590 unsigned int regret_min(void) const;
592 unsigned int regret_max(void) const;
594
596
597
598 bool range(void) const;
600 bool in(int n) const;
602
604
605
606 bool zero(void) const;
608 bool one(void) const;
610 bool none(void) const;
612
614 BoolVar& operator =(const BoolVar&) = default;
615 };
616
621 template<class Char, class Traits>
622 std::basic_ostream<Char,Traits>&
623 operator <<(std::basic_ostream<Char,Traits>& os, const BoolVar& x);
624
625}
626
627
628#include <gecode/int/view.hpp>
630
631namespace Gecode {
632
640
642
644
645}
646
648
649namespace Gecode {
650
652 class IntArgs : public ArgArray<int> {
653 public:
655
656
657 IntArgs(void);
659 explicit IntArgs(int n);
661 IntArgs(const SharedArray<int>& x);
663 IntArgs(const std::vector<int>& x);
665 IntArgs(std::initializer_list<int> x);
667 template<class InputIterator>
668 IntArgs(InputIterator first, InputIterator last);
670 IntArgs(int n, const int* e);
672 IntArgs(const ArgArray<int>& a);
673
675 static IntArgs create(int n, int start, int inc=1);
677 };
678
680 class IntVarArgs : public VarArgArray<IntVar> {
681 public:
683
684
685 IntVarArgs(void);
687 explicit IntVarArgs(int n);
689 IntVarArgs(const IntVarArgs& a);
693 IntVarArgs(const std::vector<IntVar>& a);
695 IntVarArgs(std::initializer_list<IntVar> a);
697 template<class InputIterator>
698 IntVarArgs(InputIterator first, InputIterator last);
711 IntVarArgs(Space& home, int n, int min, int max);
724 IntVarArgs(Space& home, int n, const IntSet& s);
726 IntVarArgs& operator =(const IntVarArgs&) = default;
728 };
729
738 class BoolVarArgs : public VarArgArray<BoolVar> {
739 public:
741
742
743 BoolVarArgs(void);
745 explicit BoolVarArgs(int n);
747 BoolVarArgs(const BoolVarArgs& a);
751 BoolVarArgs(const std::vector<BoolVar>& a);
753 BoolVarArgs(std::initializer_list<BoolVar> a);
755 template<class InputIterator>
756 BoolVarArgs(InputIterator first, InputIterator last);
769 BoolVarArgs(Space& home, int n, int min, int max);
773 };
774
775
786
791 class IntVarArray : public VarArray<IntVar> {
792 public:
794
795
796 IntVarArray(void);
798 IntVarArray(Space& home, int n);
800 IntVarArray(const IntVarArray& a);
802 IntVarArray(Space& home, const IntVarArgs& a);
815 IntVarArray(Space& home, int n, int min, int max);
828 IntVarArray(Space& home, int n, const IntSet& s);
830
833 };
834
839 class BoolVarArray : public VarArray<BoolVar> {
840 public:
842
843
844 BoolVarArray(void);
846 BoolVarArray(Space& home, int n);
848 BoolVarArray(const BoolVarArray& a);
850 BoolVarArray(Space& home, const BoolVarArgs& a);
863 BoolVarArray(Space& home, int n, int min, int max);
865
868 };
869
870}
871
873
874#include <gecode/int/array.hpp>
875
876namespace Gecode {
877
905
910 class Reify {
911 protected:
916 public:
918 Reify(void);
922 BoolVar var(void) const;
924 ReifyMode mode(void) const;
926 void var(BoolVar x);
928 void mode(ReifyMode rm);
929 };
930
935 Reify eqv(BoolVar x);
936
941 Reify imp(BoolVar x);
942
947 Reify pmi(BoolVar x);
948
949}
950
951#include <gecode/int/reify.hpp>
952
953namespace Gecode {
954
967
970
973
974}
975
976#include <gecode/int/irt.hpp>
977
978namespace Gecode {
979
991
1021
1024
1027
1028}
1029
1030#include <gecode/int/ipl.hpp>
1031
1032namespace Gecode {
1033
1040 TT_FIXP, //< Task with fixed processing time
1041 TT_FIXS, //< Task with fixed start time
1042 TT_FIXE //< Task with fixed end time
1043 };
1044
1051
1053 template<>
1060
1061
1067
1069
1071 dom(Home home, IntVar x, int n,
1072 IntPropLevel ipl=IPL_DEF);
1075 dom(Home home, const IntVarArgs& x, int n,
1076 IntPropLevel ipl=IPL_DEF);
1077
1080 dom(Home home, IntVar x, int l, int m,
1081 IntPropLevel ipl=IPL_DEF);
1084 dom(Home home, const IntVarArgs& x, int l, int m,
1085 IntPropLevel ipl=IPL_DEF);
1086
1089 dom(Home home, IntVar x, const IntSet& s,
1090 IntPropLevel ipl=IPL_DEF);
1093 dom(Home home, const IntVarArgs& x, const IntSet& s,
1094 IntPropLevel ipl=IPL_DEF);
1095
1098 dom(Home home, IntVar x, int n, Reify r,
1099 IntPropLevel ipl=IPL_DEF);
1102 dom(Home home, IntVar x, int l, int m, Reify r,
1103 IntPropLevel ipl=IPL_DEF);
1106 dom(Home home, IntVar x, const IntSet& s, Reify r,
1107 IntPropLevel ipl=IPL_DEF);
1108
1111 dom(Home home, IntVar x, IntVar d,
1112 IntPropLevel ipl=IPL_DEF);
1116 IntPropLevel ipl=IPL_DEF);
1119 dom(Home home, const IntVarArgs& x, const IntVarArgs& d,
1120 IntPropLevel ipl=IPL_DEF);
1123 dom(Home home, const BoolVarArgs& x, const BoolVarArgs& d,
1124 IntPropLevel ipl=IPL_DEF);
1126
1127
1139 rel(Home home, IntVar x0, IntRelType irt, IntVar x1,
1140 IntPropLevel ipl=IPL_DEF);
1148 rel(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1149 IntPropLevel ipl=IPL_DEF);
1154 rel(Home home, IntVar x, IntRelType irt, int c,
1155 IntPropLevel ipl=IPL_DEF);
1160 rel(Home home, const IntVarArgs& x, IntRelType irt, int c,
1161 IntPropLevel ipl=IPL_DEF);
1169 rel(Home home, IntVar x0, IntRelType irt, IntVar x1, Reify r,
1170 IntPropLevel ipl=IPL_DEF);
1178 rel(Home home, IntVar x, IntRelType irt, int c, Reify r,
1179 IntPropLevel ipl=IPL_DEF);
1195 rel(Home home, const IntVarArgs& x, IntRelType irt,
1196 IntPropLevel ipl=IPL_DEF);
1212 rel(Home home, const IntVarArgs& x, IntRelType irt, const IntVarArgs& y,
1213 IntPropLevel ipl=IPL_DEF);
1228 rel(Home home, const IntVarArgs& x, IntRelType irt, const IntArgs& y,
1229 IntPropLevel ipl=IPL_DEF);
1244 rel(Home home, const IntArgs& x, IntRelType irt, const IntVarArgs& y,
1245 IntPropLevel ipl=IPL_DEF);
1246
1255 rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1,
1256 IntPropLevel ipl=IPL_DEF);
1261 rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1, Reify r,
1262 IntPropLevel ipl=IPL_DEF);
1267 rel(Home home, const BoolVarArgs& x, IntRelType irt, BoolVar y,
1268 IntPropLevel ipl=IPL_DEF);
1277 rel(Home home, BoolVar x, IntRelType irt, int n,
1278 IntPropLevel ipl=IPL_DEF);
1287 rel(Home home, BoolVar x, IntRelType irt, int n, Reify r,
1288 IntPropLevel ipl=IPL_DEF);
1297 rel(Home home, const BoolVarArgs& x, IntRelType irt, int n,
1298 IntPropLevel ipl=IPL_DEF);
1312 rel(Home home, const BoolVarArgs& x, IntRelType irt, const BoolVarArgs& y,
1313 IntPropLevel ipl=IPL_DEF);
1327 rel(Home home, const BoolVarArgs& x, IntRelType irt, const IntArgs& y,
1328 IntPropLevel ipl=IPL_DEF);
1342 rel(Home home, const IntArgs& x, IntRelType irt, const BoolVarArgs& y,
1343 IntPropLevel ipl=IPL_DEF);
1355 rel(Home home, const BoolVarArgs& x, IntRelType irt,
1356 IntPropLevel ipl=IPL_DEF);
1364 IntPropLevel ipl=IPL_DEF);
1374 rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, int n,
1375 IntPropLevel ipl=IPL_DEF);
1386 rel(Home home, BoolOpType o, const BoolVarArgs& x, BoolVar y,
1387 IntPropLevel ipl=IPL_DEF);
1401 rel(Home home, BoolOpType o, const BoolVarArgs& x, int n,
1402 IntPropLevel ipl=IPL_DEF);
1414 clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1430 clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1431 int n, IntPropLevel ipl=IPL_DEF);
1443 IntPropLevel ipl=IPL_DEF);
1452 IntPropLevel ipl=IPL_DEF);
1453
1454
1467 precede(Home home, const IntVarArgs& x, int s, int t,
1477 precede(Home home, const IntVarArgs& x, const IntArgs& c,
1479
1480
1486
1488 member(Home home, const IntVarArgs& x, IntVar y,
1489 IntPropLevel ipl=IPL_DEF);
1492 member(Home home, const BoolVarArgs& x, BoolVar y,
1493 IntPropLevel ipl=IPL_DEF);
1496 member(Home home, const IntVarArgs& x, IntVar y, Reify r,
1497 IntPropLevel ipl=IPL_DEF);
1500 member(Home home, const BoolVarArgs& x, BoolVar y, Reify r,
1501 IntPropLevel ipl=IPL_DEF);
1503
1504
1509
1511
1520 IntPropLevel ipl=IPL_DEF);
1527 element(Home home, IntSharedArray n, IntVar x0, int offset, IntVar x1,
1528 IntPropLevel ipl=IPL_DEF);
1536 IntPropLevel ipl=IPL_DEF);
1543 element(Home home, IntSharedArray n, IntVar x0, int offset, BoolVar x1,
1544 IntPropLevel ipl=IPL_DEF);
1551 element(Home home, IntSharedArray n, IntVar x0, int x1,
1552 IntPropLevel ipl=IPL_DEF);
1559 element(Home home, IntSharedArray n, IntVar x0, int offset, int x1,
1560 IntPropLevel ipl=IPL_DEF);
1567 element(Home home, const IntVarArgs& x, IntVar y0, IntVar y1,
1568 IntPropLevel ipl=IPL_DEF);
1575 element(Home home, const IntVarArgs& x, IntVar y0, int offset, IntVar y1,
1576 IntPropLevel ipl=IPL_DEF);
1583 element(Home home, const IntVarArgs& x, IntVar y0, int y1,
1584 IntPropLevel ipl=IPL_DEF);
1591 element(Home home, const IntVarArgs& x, IntVar y0, int offset, int y1,
1592 IntPropLevel ipl=IPL_DEF);
1595 element(Home home, const BoolVarArgs& x, IntVar y0, BoolVar y1,
1596 IntPropLevel ipl=IPL_DEF);
1599 element(Home home, const BoolVarArgs& x, IntVar y0, int offset, BoolVar y1,
1600 IntPropLevel ipl=IPL_DEF);
1603 element(Home home, const BoolVarArgs& x, IntVar y0, int y1,
1604 IntPropLevel ipl=IPL_DEF);
1607 element(Home home, const BoolVarArgs& x, IntVar y0, int offset, int y1,
1608 IntPropLevel ipl=IPL_DEF);
1609
1624 IntVar x, int w, IntVar y, int h, IntVar z,
1625 IntPropLevel ipl=IPL_DEF);
1641 IntVar x, int xoff, int w, IntVar y, int yoff, int h, IntVar z,
1642 IntPropLevel ipl=IPL_DEF);
1657 IntVar x, int w, IntVar y, int h, BoolVar z,
1658 IntPropLevel ipl=IPL_DEF);
1674 IntVar x, int xoff, int w, IntVar y, int yoff, int h, BoolVar z,
1675 IntPropLevel ipl=IPL_DEF);
1692 element(Home home, const IntVarArgs& a,
1693 IntVar x, int w, IntVar y, int h, IntVar z,
1694 IntPropLevel ipl=IPL_DEF);
1712 element(Home home, const IntVarArgs& a,
1713 IntVar x, int xoff, int w, IntVar y, int yoff, int h, IntVar z,
1714 IntPropLevel ipl=IPL_DEF);
1728 element(Home home, const BoolVarArgs& a,
1729 IntVar x, int w, IntVar y, int h, BoolVar z,
1730 IntPropLevel ipl=IPL_DEF);
1745 element(Home home, const BoolVarArgs& a,
1746 IntVar x, int xoff, int w, IntVar y, int yoff, int h, BoolVar z,
1747 IntPropLevel ipl=IPL_DEF);
1749
1750
1755
1757
1766 distinct(Home home, const IntVarArgs& x,
1767 IntPropLevel ipl=IPL_DEF);
1781 distinct(Home home, const IntArgs& n, const IntVarArgs& x,
1782 IntPropLevel ipl=IPL_DEF);
1798 distinct(Home home, const BoolVarArgs& b, const IntVarArgs& x,
1799 IntPropLevel ipl=IPL_DEF);
1813 distinct(Home home, const IntVarArgs& x, int c,
1814 IntPropLevel ipl=IPL_DEF);
1816
1817
1822
1824
1836 channel(Home home, const IntVarArgs& x, const IntVarArgs& y,
1837 IntPropLevel ipl=IPL_DEF);
1838
1853 channel(Home home, const IntVarArgs& x, int xoff,
1854 const IntVarArgs& y, int yoff,
1855 IntPropLevel ipl=IPL_DEF);
1856
1860 IntPropLevel ipl=IPL_DEF);
1862 void
1863 channel(Home home, IntVar x0, BoolVar x1,
1864 IntPropLevel ipl=IPL_DEF);
1871 channel(Home home, const BoolVarArgs& x, IntVar y, int o=0,
1872 IntPropLevel ipl=IPL_DEF);
1874
1875}
1876
1877#include <gecode/int/channel.hpp>
1878
1879namespace Gecode {
1880
1889
1898 sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1899 IntPropLevel ipl=IPL_DEF);
1900
1913 sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1914 const IntVarArgs& z,
1915 IntPropLevel ipl=IPL_DEF);
1917
1918
1931
1933
1938 count(Home home, const IntVarArgs& x, int n, IntRelType irt, int m,
1939 IntPropLevel ipl=IPL_DEF);
1945 count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, int m,
1946 IntPropLevel ipl=IPL_DEF);
1955 count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, int m,
1956 IntPropLevel ipl=IPL_DEF);
1965 count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, int m,
1966 IntPropLevel ipl=IPL_DEF);
1972 count(Home home, const IntVarArgs& x, int n, IntRelType irt, IntVar z,
1973 IntPropLevel ipl=IPL_DEF);
1979 count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, IntVar z,
1980 IntPropLevel ipl=IPL_DEF);
1989 count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, IntVar z,
1990 IntPropLevel ipl=IPL_DEF);
1999 count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, IntVar z,
2000 IntPropLevel ipl=IPL_DEF);
2001
2016 count(Home home, const IntVarArgs& x, const IntVarArgs& c,
2017 IntPropLevel ipl=IPL_DEF);
2018
2033 count(Home home, const IntVarArgs& x, const IntSetArgs& c,
2034 IntPropLevel ipl=IPL_DEF);
2035
2053 count(Home home, const IntVarArgs& x,
2054 const IntVarArgs& c, const IntArgs& v,
2055 IntPropLevel ipl=IPL_DEF);
2056
2074 count(Home home, const IntVarArgs& x,
2075 const IntSetArgs& c, const IntArgs& v,
2076 IntPropLevel ipl=IPL_DEF);
2077
2095 count(Home home, const IntVarArgs& x,
2096 const IntSet& c, const IntArgs& v,
2097 IntPropLevel ipl=IPL_DEF);
2098
2100
2110
2112
2116 nvalues(Home home, const IntVarArgs& x, IntRelType irt, int y,
2117 IntPropLevel ipl=IPL_DEF);
2122 nvalues(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
2123 IntPropLevel ipl=IPL_DEF);
2128 nvalues(Home home, const BoolVarArgs& x, IntRelType irt, int y,
2129 IntPropLevel ipl=IPL_DEF);
2134 nvalues(Home home, const BoolVarArgs& x, IntRelType irt, IntVar y,
2135 IntPropLevel ipl=IPL_DEF);
2137
2142
2144
2159 sequence(Home home, const IntVarArgs& x, const IntSet& s,
2160 int q, int l, int u, IntPropLevel ipl=IPL_DEF);
2161
2177 sequence(Home home, const BoolVarArgs& x, const IntSet& s,
2178 int q, int l, int u, IntPropLevel ipl=IPL_DEF);
2179
2181
2193
2203 class DFA : public SharedHandle {
2204 private:
2206 class DFAI;
2209 bool equal(const DFA& d) const;
2210 public:
2213 public:
2218 Transition(void);
2220 Transition(int i_state0, int symbol0, int o_state0);
2221 };
2222
2224 private:
2226 const Transition* c_trans;
2228 const Transition* e_trans;
2229 public:
2231 Transitions(const DFA& d);
2233 Transitions(const DFA& d, int n);
2235 bool operator ()(void) const;
2237 void operator ++(void);
2239 int i_state(void) const;
2241 int symbol(void) const;
2243 int o_state(void) const;
2244 };
2245
2246 class Symbols {
2247 private:
2249 const Transition* c_trans;
2251 const Transition* e_trans;
2252 public:
2254 Symbols(const DFA& d);
2256 bool operator ()(void) const;
2258 void operator ++(void);
2260 int val(void) const;
2261 };
2262
2274 void init(int s, Transition t[], int f[], bool minimize=true);
2275 public:
2276 friend class Transitions;
2278 DFA(void);
2291 DFA(int s, Transition t[], int f[], bool minimize=true);
2302 DFA(int s, std::initializer_list<Transition> t,
2303 std::initializer_list<int> f, bool minimize=true);
2305 DFA(const DFA& d);
2308 bool operator ==(const DFA& d) const;
2310 bool operator !=(const DFA& d) const;
2312 int n_states(void) const;
2314 int n_transitions(void) const;
2316 unsigned int n_symbols(void) const;
2318 unsigned int max_degree(void) const;
2320 int final_fst(void) const;
2322 int final_lst(void) const;
2324 int symbol_min(void) const;
2326 int symbol_max(void) const;
2328 std::size_t hash(void) const;
2329 };
2330
2331}
2332
2334
2335namespace Gecode { namespace Int { namespace Extensional {
2336
2337 class TupleSetAccess;
2338
2339}}}
2340
2341namespace Gecode {
2342
2356 EPK_AUTO,
2357 EPK_DENSE,
2358 EPK_SPARSE,
2359 EPK_DENSE_COMPRESSED
2360 };
2361
2362 static constexpr ExtensionalPropKind EPK_AUTO =
2365 static constexpr ExtensionalPropKind EPK_DENSE =
2368 static constexpr ExtensionalPropKind EPK_SPARSE =
2371 static constexpr ExtensionalPropKind EPK_DENSE_COMPRESSED =
2373
2382 class TupleSet : public SharedHandle {
2384 public:
2389 typedef int* Tuple;
2394 public:
2395 unsigned int widx;
2397 };
2398
2399 class Range {
2400 public:
2402 int min;
2404 int max;
2408 unsigned int width(void) const;
2415 const BitSetData* supports(unsigned int n_words, int n) const;
2416 };
2417 protected:
2420 public:
2422 unsigned int n;
2426 unsigned int* base;
2428 unsigned int start(int n) const;
2429 };
2430
2435 protected:
2437 static const int n_initial_free = 1024;
2438 public:
2447 public:
2451 unsigned int n_words;
2457 int min;
2459 int max;
2461 std::size_t key;
2463 int* td;
2469 unsigned int* range_base;
2475 unsigned int sparse_n_vals;
2477 unsigned int* sparse_offsets;
2479 unsigned int* sparse_tuples;
2481 unsigned int* sparse_tv;
2483 unsigned int* compressed_offsets;
2488
2490 Tuple add(void);
2492 Tuple get(int i) const;
2494 static void set(BitSetData* d, unsigned int n);
2496 static bool get(const BitSetData* d, unsigned int n);
2498 unsigned int tuple2idx(Tuple t) const;
2500 const Range* fst(int i) const;
2502 const Range* lst(int i) const;
2505 void finalize(void);
2511 void resize(void);
2513 void clear_support(void);
2518 ExtensionalPropKind epk, bool dense_possible,
2519 bool sparse_possible, bool compressed_possible,
2520 bool support_bits_sparse, unsigned long long dense_bytes) const;
2522 bool finalized(void) const;
2524 bool failed(void) const;
2526 bool terminal(void) const;
2527
2529 Data(int a);
2532 virtual ~Data(void);
2533 };
2534
2536 Data& data(void) const;
2538 Data& raw(void) const;
2541 void _add(const IntArgs& t);
2544 bool equal(const TupleSet& t) const;
2545 public:
2547
2548
2549 TupleSet(void);
2552 TupleSet(int a);
2555 void init(int a);
2564 TupleSet(int a, const DFA& dfa);
2567 TupleSet(int a, const DFA& dfa, ExtensionalPropKind epk);
2569 operator bool(void) const;
2571 bool operator ==(const TupleSet& t) const;
2573 bool operator !=(const TupleSet& t) const;
2575
2577
2578
2579 TupleSet& add(const IntArgs& t);
2581 bool finalized(void) const;
2588 bool failed(void) const;
2590 void finalize(void);
2592
2600 void finalize(ExtensionalPropKind epk);
2602
2604
2605
2606 int arity(void) const;
2608 int tuples(void) const;
2610 unsigned int words(void) const;
2612 Tuple operator [](int i) const;
2614 int min(void) const;
2616 int max(void) const;
2618 std::size_t hash(void) const;
2621 private:
2623 unsigned int sparse_values(void) const;
2625 const unsigned int* sparse_tuple_value_ids(void) const;
2627 const unsigned int* sparse_support_offsets(void) const;
2629 bool support_id(int p, int n, unsigned int& gid) const;
2631 bool sparse_support(int p, int n,
2632 const unsigned int*& b,
2633 const unsigned int*& e,
2634 unsigned int& gid) const;
2636 bool dense_compressed_support(int p, int n,
2637 const CSupportWord*& b,
2638 const CSupportWord*& e) const;
2639 public:
2641
2643
2644
2645 const Range* fst(int i) const;
2647 const Range* lst(int i) const;
2649 class Ranges {
2650 protected:
2652 const Range* c;
2654 const Range* l;
2655 public:
2657
2658
2659 Ranges(const TupleSet& ts, int i);
2661
2663
2664
2665 bool operator ()(void) const;
2667 void operator ++(void);
2669
2671
2672
2673 int min(void) const;
2675 int max(void) const;
2677 unsigned int width(void) const;
2679 };
2680
2681 };
2682
2683 namespace Int { namespace Extensional {
2684
2687 public:
2689 static unsigned int sparse_values(const TupleSet& ts);
2691 static const unsigned int* sparse_tuple_value_ids(const TupleSet& ts);
2693 static const unsigned int* sparse_support_offsets(const TupleSet& ts);
2695 static bool support_id(const TupleSet& ts, int p, int n,
2696 unsigned int& gid);
2698 static bool sparse_support(const TupleSet& ts, int p, int n,
2699 const unsigned int*& b,
2700 const unsigned int*& e,
2701 unsigned int& gid);
2703 static bool dense_compressed_support(const TupleSet& ts, int p, int n,
2704 const TupleSet::CSupportWord*& b,
2705 const TupleSet::CSupportWord*& e);
2706 };
2707
2708 }}
2709
2710}
2711
2713
2714namespace Gecode {
2715
2729 extensional(Home home, const IntVarArgs& x, DFA d,
2730 IntPropLevel ipl=IPL_DEF);
2731
2745 extensional(Home home, const BoolVarArgs& x, DFA d,
2746 IntPropLevel ipl=IPL_DEF);
2747
2758 void
2759 extensional(Home home, const IntVarArgs& x, const TupleSet& t,
2760 IntPropLevel ipl=IPL_DEF);
2761
2775 extensional(Home home, const IntVarArgs& x, const TupleSet& t, bool pos,
2776 IntPropLevel ipl=IPL_DEF);
2777
2788 void
2789 extensional(Home home, const IntVarArgs& x, const TupleSet& t, Reify r,
2790 IntPropLevel ipl=IPL_DEF);
2791
2805 extensional(Home home, const IntVarArgs& x, const TupleSet& t, bool pos,
2806 Reify r,
2807 IntPropLevel ipl=IPL_DEF);
2808
2819 void
2820 extensional(Home home, const BoolVarArgs& x, const TupleSet& t,
2821 IntPropLevel ipl=IPL_DEF);
2822
2836 extensional(Home home, const BoolVarArgs& x, const TupleSet& t, bool pos,
2837 IntPropLevel ipl=IPL_DEF);
2838
2849 void
2850 extensional(Home home, const BoolVarArgs& x, const TupleSet& t, Reify r,
2851 IntPropLevel ipl=IPL_DEF);
2852
2866 extensional(Home home, const BoolVarArgs& x, const TupleSet& t, bool pos,
2867 Reify r,
2868 IntPropLevel ipl=IPL_DEF);
2869
2870}
2871
2873
2874namespace Gecode {
2875
2880
2882
2888 min(Home home, IntVar x0, IntVar x1, IntVar x2,
2889 IntPropLevel ipl=IPL_DEF);
2898 min(Home home, const IntVarArgs& x, IntVar y,
2899 IntPropLevel ipl=IPL_DEF);
2906 max(Home home, IntVar x0, IntVar x1, IntVar x2,
2907 IntPropLevel ipl=IPL_DEF);
2916 max(Home home, const IntVarArgs& x, IntVar y,
2917 IntPropLevel ipl=IPL_DEF);
2918
2929 argmin(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2930 IntPropLevel ipl=IPL_DEF);
2941 argmin(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2942 IntPropLevel ipl=IPL_DEF);
2953 argmax(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2954 IntPropLevel ipl=IPL_DEF);
2965 argmax(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2966 IntPropLevel ipl=IPL_DEF);
2977 argmin(Home home, const BoolVarArgs& x, IntVar y, bool tiebreak=true,
2978 IntPropLevel ipl=IPL_DEF);
2989 argmin(Home home, const BoolVarArgs& x, int o, IntVar y, bool tiebreak=true,
2990 IntPropLevel ipl=IPL_DEF);
3001 argmax(Home home, const BoolVarArgs& x, IntVar y, bool tiebreak=true,
3002 IntPropLevel ipl=IPL_DEF);
3013 argmax(Home home, const BoolVarArgs& x, int o, IntVar y, bool tiebreak=true,
3014 IntPropLevel ipl=IPL_DEF);
3015
3022 abs(Home home, IntVar x0, IntVar x1,
3023 IntPropLevel ipl=IPL_DEF);
3024
3031 mult(Home home, IntVar x0, IntVar x1, IntVar x2,
3032 IntPropLevel ipl=IPL_DEF);
3033
3039 divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
3040 IntPropLevel ipl=IPL_DEF);
3041
3047 div(Home home, IntVar x0, IntVar x1, IntVar x2,
3048 IntPropLevel ipl=IPL_DEF);
3049
3055 mod(Home home, IntVar x0, IntVar x1, IntVar x2,
3056 IntPropLevel ipl=IPL_DEF);
3057
3064 sqr(Home home, IntVar x0, IntVar x1,
3065 IntPropLevel ipl=IPL_DEF);
3066
3073 sqrt(Home home, IntVar x0, IntVar x1,
3074 IntPropLevel ipl=IPL_DEF);
3075
3085 pow(Home home, IntVar x0, int n, IntVar x1,
3086 IntPropLevel ipl=IPL_DEF);
3087
3097 nroot(Home home, IntVar x0, int n, IntVar x1,
3098 IntPropLevel ipl=IPL_DEF);
3099
3101
3138 linear(Home home, const IntVarArgs& x,
3139 IntRelType irt, int c,
3140 IntPropLevel ipl=IPL_DEF);
3145 linear(Home home, const IntVarArgs& x,
3146 IntRelType irt, IntVar y,
3147 IntPropLevel ipl=IPL_DEF);
3152 linear(Home home, const IntVarArgs& x,
3153 IntRelType irt, int c, Reify r,
3154 IntPropLevel ipl=IPL_DEF);
3159 linear(Home home, const IntVarArgs& x,
3160 IntRelType irt, IntVar y, Reify r,
3161 IntPropLevel ipl=IPL_DEF);
3169 linear(Home home, const IntArgs& a, const IntVarArgs& x,
3170 IntRelType irt, int c,
3171 IntPropLevel ipl=IPL_DEF);
3179 linear(Home home, const IntArgs& a, const IntVarArgs& x,
3180 IntRelType irt, IntVar y,
3181 IntPropLevel ipl=IPL_DEF);
3189 linear(Home home, const IntArgs& a, const IntVarArgs& x,
3190 IntRelType irt, int c, Reify r,
3191 IntPropLevel ipl=IPL_DEF);
3199 linear(Home home, const IntArgs& a, const IntVarArgs& x,
3200 IntRelType irt, IntVar y, Reify r,
3201 IntPropLevel ipl=IPL_DEF);
3202
3203
3232 linear(Home home, const BoolVarArgs& x,
3233 IntRelType irt, int c,
3234 IntPropLevel ipl=IPL_DEF);
3239 linear(Home home, const BoolVarArgs& x,
3240 IntRelType irt, int c, Reify r,
3241 IntPropLevel ipl=IPL_DEF);
3246 linear(Home home, const BoolVarArgs& x,
3247 IntRelType irt, IntVar y,
3248 IntPropLevel ipl=IPL_DEF);
3253 linear(Home home, const BoolVarArgs& x,
3254 IntRelType irt, IntVar y, Reify r,
3255 IntPropLevel ipl=IPL_DEF);
3263 linear(Home home, const IntArgs& a, const BoolVarArgs& x,
3264 IntRelType irt, int c,
3265 IntPropLevel ipl=IPL_DEF);
3273 linear(Home home, const IntArgs& a, const BoolVarArgs& x,
3274 IntRelType irt, int c, Reify r,
3275 IntPropLevel ipl=IPL_DEF);
3283 linear(Home home, const IntArgs& a, const BoolVarArgs& x,
3284 IntRelType irt, IntVar y,
3285 IntPropLevel ipl=IPL_DEF);
3293 linear(Home home, const IntArgs& a, const BoolVarArgs& x,
3294 IntRelType irt, IntVar y, Reify r,
3295 IntPropLevel ipl=IPL_DEF);
3296
3297
3335 const IntVarArgs& l,
3336 const IntVarArgs& b, const IntArgs& s,
3337 IntPropLevel ipl=IPL_DEF);
3338 /* \brief Post propagator for multi-dimensional bin packing
3339 *
3340 * In the following \a n refers to the number of items and \a m
3341 * refers to the number of bins.
3342 *
3343 * The multi-dimensional bin-packing constraint enforces that
3344 * all items are packed into bins
3345 * \f$b_i\in\{0,\ldots,m-1\}\f$ for \f$0\leq i<n\f$
3346 * and that the load of each bin corresponds to the items
3347 * packed into it for each dimension \f$l_{j\cdot
3348 * d + k} = \sum_{\{i\in\{0,\ldots,n-1\}|
3349 * b_{j\cdot d+k}=i}\}s_{i\cdot d+k}\f$
3350 * for \f$0\leq j<m\f$, \f$0\leq k<d\f$
3351 * Furthermore, the load variables must satisfy the capacity
3352 * constraints \f$l_{j\cdot d + k} \leq
3353 * c_k\f$ for \f$0\leq j<m\f$, \f$0\leq k<d\f$.
3354 *
3355 * The constraint is implemented by the decomposition
3356 * introduced in: Stefano Gualandi and Michele Lombardi. A
3357 * simple and effective decomposition for the multidimensional
3358 * binpacking constraint. CP 2013, pages 356--364.
3359 *
3360 * Posting the constraint returns a maximal set containing conflicting
3361 * items that require pairwise different bins.
3362 *
3363 * Note that posting the constraint has exponential complexity in the
3364 * number of items due to the Bron-Kerbosch algorithm used for finding
3365 * the maximal conflict item sets.
3366 *
3367 * The propagation level \a ipl controls the filtering performed by each
3368 * per-dimension bin-packing propagator:
3369 * - \a IPL_BASIC performs basic load and item filtering only.
3370 * - \a IPL_ADVANCED performs basic filtering, knapsack filtering using
3371 * NoSum, and a small DFF portfolio (CCM1 and MT). It is the default
3372 * (\a IPL_DEF).
3373 * - \a IPL_FULL performs all of the above and the complete DFF portfolio.
3374 *
3375 * Throws the following exceptions:
3376 * - Of type Int::ArgumentSizeMismatch if any of the following properties
3377 * is violated: \f$|b|=n\f$, \f$|l|=m\cdot d\f$, \f$|s|=n\cdot d\f$,
3378 * and \f$|c|=d\f$.
3379 * - Of type Int::ArgumentSame if \a l and \a b share unassigned variables.
3380 * - Of type Int::OutOfLimits if \a s or \a c contains a negative number.
3381 *
3382 * \ingroup TaskModelIntBinPacking
3383 */
3385 binpacking(Home home, int d,
3386 const IntVarArgs& l, const IntVarArgs& b,
3387 const IntArgs& s, const IntArgs& c,
3388 IntPropLevel ipl=IPL_DEF);
3389
3390
3411 const IntVarArgs& x, const IntArgs& w,
3412 const IntVarArgs& y, const IntArgs& h,
3413 IntPropLevel ipl=IPL_DEF);
3429 const IntVarArgs& x, const IntArgs& w,
3430 const IntVarArgs& y, const IntArgs& h,
3431 const BoolVarArgs& o,
3432 IntPropLevel ipl=IPL_DEF);
3451 const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
3452 const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
3453 IntPropLevel ipl=IPL_DEF);
3473 const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
3474 const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
3475 const BoolVarArgs& o,
3476 IntPropLevel ipl=IPL_DEF);
3477
3478
3484
3496 order(Home home, IntVar s0, int p0, IntVar s1, int p1, BoolVar b,
3497 IntPropLevel ipl=IPL_DEF);
3498
3543 const IntVarArgs& s, const IntVarArgs& p,
3544 const IntVarArgs& e, const IntVarArgs& u,
3545 const IntArgs& c, bool at_most,
3546 IntPropLevel ipl=IPL_DEF);
3552 cumulatives(Home home, const IntArgs& m,
3553 const IntVarArgs& s, const IntVarArgs& p,
3554 const IntVarArgs& e, const IntVarArgs& u,
3555 const IntArgs& c, bool at_most,
3556 IntPropLevel ipl=IPL_DEF);
3563 const IntVarArgs& s, const IntArgs& p,
3564 const IntVarArgs& e, const IntVarArgs& u,
3565 const IntArgs& c, bool at_most,
3566 IntPropLevel ipl=IPL_DEF);
3572 cumulatives(Home home, const IntArgs& m,
3573 const IntVarArgs& s, const IntArgs& p,
3574 const IntVarArgs& e, const IntVarArgs& u,
3575 const IntArgs& c, bool at_most,
3576 IntPropLevel ipl=IPL_DEF);
3583 const IntVarArgs& s, const IntVarArgs& p,
3584 const IntVarArgs& e, const IntArgs& u,
3585 const IntArgs& c, bool at_most,
3586 IntPropLevel ipl=IPL_DEF);
3592 cumulatives(Home home, const IntArgs& m,
3593 const IntVarArgs& s, const IntVarArgs& p,
3594 const IntVarArgs& e, const IntArgs& u,
3595 const IntArgs& c, bool at_most,
3596 IntPropLevel ipl=IPL_DEF);
3603 const IntVarArgs& s, const IntArgs& p,
3604 const IntVarArgs& e, const IntArgs& u,
3605 const IntArgs& c, bool at_most,
3606 IntPropLevel ipl=IPL_DEF);
3612 cumulatives(Home home, const IntArgs& m,
3613 const IntVarArgs& s, const IntArgs& p,
3614 const IntVarArgs& e, const IntArgs& u,
3615 const IntArgs& c, bool at_most,
3616 IntPropLevel ipl=IPL_DEF);
3617
3645 unary(Home home, const IntVarArgs& s, const IntArgs& p,
3646 IntPropLevel ipl=IPL_DEF);
3647
3677 unary(Home home, const IntVarArgs& s, const IntArgs& p,
3678 const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3679
3717 unary(Home home, const TaskTypeArgs& t,
3718 const IntVarArgs& flex, const IntArgs& fix, IntPropLevel ipl=IPL_DEF);
3719
3759 unary(Home home, const TaskTypeArgs& t,
3760 const IntVarArgs& flex, const IntArgs& fix,
3761 const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3762
3790 unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3791 const IntVarArgs& e, IntPropLevel ipl=IPL_DEF);
3792
3822 unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3823 const IntVarArgs& e, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3824
3825
3826
3870 cumulative(Home home, int c, const TaskTypeArgs& t,
3871 const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3872 IntPropLevel ipl=IPL_DEF);
3873
3874
3881 const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3882 IntPropLevel ipl=IPL_DEF);
3883
3929 cumulative(Home home, int c, const TaskTypeArgs& t,
3930 const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3931 const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3932
3938 const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3939 const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3940
3974 cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3975 const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3976
3981 cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3982 const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3983
4019 cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
4020 const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
4021
4026 cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
4027 const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
4028
4066 cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
4067 const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
4068
4073 cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
4074 const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
4075
4115 cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
4116 const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
4117 IntPropLevel ipl=IPL_DEF);
4118
4123 cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
4124 const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
4125 IntPropLevel ipl=IPL_DEF);
4127
4128
4134
4149 circuit(Home home, const IntVarArgs& x,
4150 IntPropLevel ipl=IPL_DEF);
4167 circuit(Home home, int offset, const IntVarArgs& x,
4168 IntPropLevel ipl=IPL_DEF);
4192 const IntArgs& c,
4193 const IntVarArgs& x, const IntVarArgs& y, IntVar z,
4194 IntPropLevel ipl=IPL_DEF);
4219 const IntArgs& c, int offset,
4220 const IntVarArgs& x, const IntVarArgs& y, IntVar z,
4221 IntPropLevel ipl=IPL_DEF);
4242 const IntArgs& c,
4243 const IntVarArgs& x, IntVar z,
4244 IntPropLevel ipl=IPL_DEF);
4267 const IntArgs& c, int offset,
4268 const IntVarArgs& x, IntVar z,
4269 IntPropLevel ipl=IPL_DEF);
4286 path(Home home, const IntVarArgs& x, IntVar s, IntVar e,
4287 IntPropLevel ipl=IPL_DEF);
4306 path(Home home, int offset, const IntVarArgs& x, IntVar s, IntVar e,
4307 IntPropLevel ipl=IPL_DEF);
4332 const IntArgs& c,
4333 const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
4334 IntPropLevel ipl=IPL_DEF);
4361 const IntArgs& c, int offset,
4362 const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
4363 IntPropLevel ipl=IPL_DEF);
4386 const IntArgs& c,
4387 const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
4388 IntPropLevel ipl=IPL_DEF);
4413 const IntArgs& c, int offset,
4414 const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
4415 IntPropLevel ipl=IPL_DEF);
4417
4418
4419
4428
4430 wait(Home home, IntVar x, std::function<void(Space& home)> c,
4431 IntPropLevel ipl=IPL_DEF);
4434 wait(Home home, BoolVar x, std::function<void(Space& home)> c,
4435 IntPropLevel ipl=IPL_DEF);
4438 wait(Home home, const IntVarArgs& x, std::function<void(Space& home)> c,
4439 IntPropLevel ipl=IPL_DEF);
4442 wait(Home home, const BoolVarArgs& x,
4443 std::function<void(Space& home)> c,
4444 IntPropLevel ipl=IPL_DEF);
4448 std::function<void(Space& home)> t,
4449 std::function<void(Space& home)> e,
4450 IntPropLevel ipl=IPL_DEF);
4454 std::function<void(Space& home)> t,
4455 IntPropLevel ipl=IPL_DEF);
4457
4458
4476
4485 IntPropLevel ipl=IPL_DEF);
4489 IntPropLevel ipl=IPL_DEF);
4491
4492}
4493
4494namespace Gecode {
4495
4500
4509 typedef std::function<bool(const Space& home, IntVar x, int i)>
4519 typedef std::function<bool(const Space& home, BoolVar x, int i)>
4521
4531 typedef std::function<double(const Space& home, IntVar x, int i)>
4542 typedef std::function<double(const Space& home, BoolVar x, int i)>
4544
4555 typedef std::function<int(const Space& home, IntVar x, int i)>
4567 typedef std::function<int(const Space& home, BoolVar x, int i)>
4569
4581 typedef std::function<void(Space& home, unsigned int a,
4582 IntVar x, int i, int n)>
4595 typedef std::function<void(Space& home, unsigned int a,
4596 BoolVar x, int i, int n)>
4598
4599}
4600
4602
4603namespace Gecode {
4604
4610 class IntAFC : public AFC {
4611 public:
4619 IntAFC(void);
4621 IntAFC(const IntAFC& a);
4623 IntAFC& operator =(const IntAFC& a);
4631 IntAFC(Home home, const IntVarArgs& x, double d=1.0, bool share=true);
4642 void init(Home home, const IntVarArgs& x, double d=1.0, bool share=true);
4643 };
4644
4650 class BoolAFC : public AFC {
4651 public:
4659 BoolAFC(void);
4661 BoolAFC(const BoolAFC& a);
4663 BoolAFC& operator =(const BoolAFC& a);
4671 BoolAFC(Home home, const BoolVarArgs& x, double d=1.0, bool share=true);
4682 void init(Home home, const BoolVarArgs& x, double d=1.0, bool share=true);
4683 };
4684
4685}
4686
4688
4689namespace Gecode {
4690
4696 class IntAction : public Action {
4697 public:
4705 IntAction(void);
4707 IntAction(const IntAction& a);
4709 IntAction& operator =(const IntAction& a);
4720 IntAction(Home home, const IntVarArgs& x, double d=1.0,
4721 bool p=true, bool f=true,
4722 IntBranchMerit bm=nullptr);
4737 init(Home home, const IntVarArgs& x, double d=1.0,
4738 bool p=true, bool f=true,
4739 IntBranchMerit bm=nullptr);
4740 };
4741
4747 class BoolAction : public Action {
4748 public:
4756 BoolAction(void);
4758 BoolAction(const BoolAction& a);
4760 BoolAction& operator =(const BoolAction& a);
4771 BoolAction(Home home, const BoolVarArgs& x, double d=1.0,
4772 bool p=true, bool f=true,
4773 BoolBranchMerit bm=nullptr);
4788 init(Home home, const BoolVarArgs& x, double d=1.0,
4789 bool p=true, bool f=true,
4790 BoolBranchMerit bm=nullptr);
4791 };
4792
4793}
4794
4796
4797namespace Gecode {
4798
4804 class IntCHB : public CHB {
4805 public:
4813 IntCHB(void);
4815 IntCHB(const IntCHB& chb);
4817 IntCHB& operator =(const IntCHB& chb);
4827 IntCHB(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4840 init(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4841 };
4842
4848 class BoolCHB : public CHB {
4849 public:
4857 BoolCHB(void);
4859 BoolCHB(const BoolCHB& chb);
4861 BoolCHB& operator =(const BoolCHB& chb);
4871 BoolCHB(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4884 init(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4885 };
4886
4887}
4888
4890
4891namespace Gecode {
4892
4894 typedef std::function<void(const Space &home, const Brancher& b,
4895 unsigned int a,
4896 IntVar x, int i, const int& n,
4897 std::ostream& o)>
4899
4901 typedef std::function<void(const Space &home, const Brancher& b,
4902 unsigned int a,
4903 BoolVar x, int i, const int& n,
4904 std::ostream& o)>
4906
4907}
4908
4909namespace Gecode {
4910
4996
5044
5050
5063 IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
5067 IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
5071 IntVarBranch INT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
5075 IntVarBranch INT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
5103 IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
5107 IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
5111 IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
5115 IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
5150
5164 BoolVarBranch BOOL_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
5168 BoolVarBranch BOOL_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
5172 BoolVarBranch BOOL_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
5176 BoolVarBranch BOOL_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
5188
5189}
5190
5192
5193namespace Gecode {
5194
5229
5235 class BoolValBranch : public ValBranch<BoolVar> {
5236 public:
5244 protected:
5247 public:
5255 Select select(void) const;
5256 };
5257
5263
5290
5305
5306}
5307
5309
5310namespace Gecode {
5311
5317 class IntAssign : public ValBranch<IntVar> {
5318 public:
5327 protected:
5330 public:
5334 IntAssign(Rnd r);
5338 Select select(void) const;
5339 };
5340
5346 class BoolAssign : public ValBranch<BoolVar> {
5347 public:
5355 protected:
5358 public:
5362 BoolAssign(Rnd r);
5366 Select select(void) const;
5367 };
5368
5374
5389
5404
5405}
5406
5408
5409namespace Gecode {
5410
5417 branch(Home home, const IntVarArgs& x,
5418 IntVarBranch vars, IntValBranch vals,
5419 IntBranchFilter bf=nullptr,
5420 IntVarValPrint vvp=nullptr);
5427 branch(Home home, const IntVarArgs& x,
5429 IntBranchFilter bf=nullptr,
5430 IntVarValPrint vvp=nullptr);
5438 IntVarValPrint vvp=nullptr);
5445 branch(Home home, const BoolVarArgs& x,
5446 BoolVarBranch vars, BoolValBranch vals,
5447 BoolBranchFilter bf=nullptr,
5448 BoolVarValPrint vvp=nullptr);
5455 branch(Home home, const BoolVarArgs& x,
5457 BoolBranchFilter bf=nullptr,
5458 BoolVarValPrint vvp=nullptr);
5466 BoolVarValPrint vvp=nullptr);
5467
5474 assign(Home home, const IntVarArgs& x,
5475 IntVarBranch vars, IntAssign vals,
5476 IntBranchFilter bf=nullptr,
5477 IntVarValPrint vvp=nullptr);
5484 assign(Home home, const IntVarArgs& x,
5486 IntBranchFilter bf=nullptr,
5487 IntVarValPrint vvp=nullptr);
5495 IntVarValPrint vvp=nullptr);
5502 assign(Home home, const BoolVarArgs& x,
5503 BoolVarBranch vars, BoolAssign vals,
5504 BoolBranchFilter bf=nullptr,
5505 BoolVarValPrint vvp=nullptr);
5512 assign(Home home, const BoolVarArgs& x,
5514 IntBranchFilter bf=nullptr,
5515 IntVarValPrint vvp=nullptr);
5523 BoolVarValPrint vvp=nullptr);
5524
5525}
5526
5527namespace Gecode {
5528
5534 void
5535 branch(Home home, const IntVarArgs& x, IntValBranch vals,
5536 IntBranchFilter bf=nullptr,
5537 IntVarValPrint vvp=nullptr);
5543 void
5544 branch(Home home, const BoolVarArgs& x, BoolValBranch vals,
5545 BoolBranchFilter bf=nullptr,
5546 BoolVarValPrint vvp=nullptr);
5547
5553 void
5554 assign(Home home, const IntVarArgs& x, IntAssign vals,
5555 IntBranchFilter bf=nullptr,
5556 IntVarValPrint vvp=nullptr);
5562 void
5563 assign(Home home, const BoolVarArgs& x, BoolAssign vals,
5564 BoolBranchFilter bf=nullptr,
5565 BoolVarValPrint vvp=nullptr);
5566
5567}
5568
5569#include <gecode/int/branch.hpp>
5570
5571namespace Gecode {
5572
5576 template<class Char, class Traits>
5577 std::basic_ostream<Char,Traits>&
5578 operator <<(std::basic_ostream<Char,Traits>& os, const DFA& d);
5579
5583 template<class Char, class Traits>
5584 std::basic_ostream<Char,Traits>&
5585 operator <<(std::basic_ostream<Char,Traits>& os, const TupleSet& ts);
5586
5587}
5588
5589// LDSB-related declarations.
5590namespace Gecode {
5591
5592 namespace Int { namespace LDSB {
5593 class SymmetryObject;
5594 }}
5595
5621 class Symmetries;
5623 template<>
5630
5637
5638 class Symmetries : public ArgArray<SymmetryHandle> {};
5639 // If this is instead a typedef, strange things happen with the
5640 // overloading of the "branch" function.
5641
5648 const IntArgs& indices);
5676
5682
5695 branch(Home home, const IntVarArgs& x,
5696 IntVarBranch vars, IntValBranch vals,
5697 const Symmetries& syms,
5698 IntBranchFilter bf=nullptr,
5699 IntVarValPrint vvp=nullptr);
5712 branch(Home home, const IntVarArgs& x,
5714 const Symmetries& syms,
5715 IntBranchFilter bf=nullptr,
5716 IntVarValPrint vvp=nullptr);
5729 branch(Home home, const BoolVarArgs& x,
5730 BoolVarBranch vars, BoolValBranch vals,
5731 const Symmetries& syms,
5732 BoolBranchFilter bf=nullptr,
5733 BoolVarValPrint vvp=nullptr);
5746 branch(Home home, const BoolVarArgs& x,
5748 const Symmetries& syms,
5749 BoolBranchFilter bf=nullptr,
5750 BoolVarValPrint vvp=nullptr);
5751
5752#ifdef GECODE_HAS_CBS
5753
5775 cbsbranch(Home home, const IntVarArgs& x);
5776
5777
5799 cbsbranch(Home home, const BoolVarArgs& x);
5800
5801#endif
5802
5803}
5804
5805namespace Gecode {
5806
5807 /*
5808 * \brief Relaxed assignment of variables in \a x from values in \a sx
5809 *
5810 * The variables in \a x are assigned values from the assigned variables
5811 * in the solution \a sx with a relaxation probability \a p. That is,
5812 * if \f$p=0.1\f$ approximately 10% of the variables in \a x will be
5813 * assigned a value from \a sx.
5814 *
5815 * The random numbers are generated from the generator \a r. At least
5816 * one variable will not be assigned: in case the relaxation attempt
5817 * would suggest that all variables should be assigned, a single
5818 * variable will be selected randomly to remain unassigned.
5819 *
5820 * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5821 * \a sx are of different size.
5822 *
5823 * Throws an exception of type Int::OutOfLimits, if \a p is not between
5824 * \a 0.0 and \a 1.0.
5825 *
5826 * \ingroup TaskModelInt
5827 */
5829 relax(Home home, const IntVarArgs& x, const IntVarArgs& sx,
5830 Rnd r, double p);
5831
5832 /*
5833 * \brief Relaxed assignment of variables in \a x from values in \a sx
5834 *
5835 * The variables in \a x are assigned values from the assigned variables
5836 * in the solution \a sx with a relaxation probability \a p. That is,
5837 * if \f$p=0.1\f$ approximately 10% of the variables in \a x will be
5838 * assigned a value from \a sx.
5839 *
5840 * The random numbers are generated from the generator \a r. At least
5841 * one variable will not be assigned: in case the relaxation attempt
5842 * would suggest that all variables should be assigned, a single
5843 * variable will be selected randomly to remain unassigned.
5844 *
5845 * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5846 * \a sx are of different size.
5847 *
5848 * Throws an exception of type Int::OutOfLimits, if \a p is not between
5849 * \a 0.0 and \a 1.0.
5850 *
5851 * \ingroup TaskModelInt
5852 */
5854 relax(Home home, const BoolVarArgs& x, const BoolVarArgs& sx,
5855 Rnd r, double p);
5856
5857}
5858
5859
5862
5863namespace Gecode {
5864
5869
5875 : public Iter::Ranges::Diff<Iter::Ranges::RangeList,
5876 Int::ViewRanges<Int::IntView> > {
5877 protected:
5882 public:
5884
5885
5888 };
5889
5895 protected:
5898 public:
5900
5901
5904
5906
5907 bool operator ()(void) const;
5909 void operator ++(void);
5911
5913
5914
5915 int min(void) const;
5917 int max(void) const;
5919 unsigned int width(void) const;
5921 };
5922
5923}
5924
5927
5929
5930namespace Gecode {
5931
5942
5948 protected:
5950 std::ostream& os;
5951 public:
5953 StdIntTracer(std::ostream& os0 = std::cerr);
5955 virtual void init(const Space& home, const IntTraceRecorder& t);
5957 virtual void prune(const Space& home, const IntTraceRecorder& t,
5958 const ViewTraceInfo& vti, int i, IntTraceDelta& d);
5960 virtual void fix(const Space& home, const IntTraceRecorder& t);
5962 virtual void fail(const Space& home, const IntTraceRecorder& t);
5964 virtual void done(const Space& home, const IntTraceRecorder& t);
5967 };
5968
5969
5980
5986 protected:
5988 std::ostream& os;
5989 public:
5991 StdBoolTracer(std::ostream& os0 = std::cerr);
5993 virtual void init(const Space& home, const BoolTraceRecorder& t);
5995 virtual void prune(const Space& home, const BoolTraceRecorder& t,
5996 const ViewTraceInfo& vti, int i, BoolTraceDelta& d);
5998 virtual void fix(const Space& home, const BoolTraceRecorder& t);
6000 virtual void fail(const Space& home, const BoolTraceRecorder& t);
6002 virtual void done(const Space& home, const BoolTraceRecorder& t);
6005 };
6006
6012 trace(Home home, const IntVarArgs& x,
6013 TraceFilter tf,
6014 int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
6020 void
6021 trace(Home home, const IntVarArgs& x,
6022 int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
6024
6030 trace(Home home, const BoolVarArgs& x,
6031 TraceFilter tf,
6032 int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
6038 void
6039 trace(Home home, const BoolVarArgs& x,
6040 int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
6042
6043}
6044
6045#include <gecode/int/trace.hpp>
6046
6047#endif
6048
6049// IFDEF: GECODE_HAS_INT_VARS
6050// STATISTICS: int-post
AFC(void)
Construct as not yet initialized.
Definition afc.hpp:119
Action(void)
Construct as not yet initialized.
Definition action.hpp:344
Argument array for non-primitive types.
Definition array.hpp:695
Traits of arrays in Gecode.
Definition array.hpp:94
Recording AFC information for Boolean variables.
Definition int.hh:4650
BoolAFC(void)
Construct as not yet initialized.
Definition afc.hpp:61
BoolAFC & operator=(const BoolAFC &a)
Assignment operator.
Definition afc.hpp:68
void init(Home home, const BoolVarArgs &x, double d=1.0, bool share=true)
Initialize for Boolean variables x with decay factor d.
Definition afc.hpp:78
Recording actions for Boolean variables.
Definition int.hh:4747
BoolAction(Home home, const BoolVarArgs &x, double d=1.0, bool p=true, bool f=true, BoolBranchMerit bm=nullptr)
Initialize for Boolean variables x with decay factor d.
BoolAction(void)
Construct as not yet initialized.
Definition action.hpp:50
BoolAction & operator=(const BoolAction &a)
Assignment operator.
Definition action.hpp:57
void init(Home home, const BoolVarArgs &x, double d=1.0, bool p=true, bool f=true, BoolBranchMerit bm=nullptr)
Initialize for Boolean variables x with decay factor d.
Which values to select for assignment.
Definition int.hh:5346
Select
Which value selection.
Definition int.hh:5349
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:5353
@ SEL_MIN
Select smallest value.
Definition int.hh:5350
@ SEL_MAX
Select largest value.
Definition int.hh:5351
@ SEL_RND
Select random value.
Definition int.hh:5352
BoolAssign(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition assign.hpp:82
Select select(void) const
Return selection strategy.
Definition assign.hpp:94
Select s
Which value to select.
Definition int.hh:5357
Recording CHB for Boolean variables.
Definition int.hh:4848
BoolCHB & operator=(const BoolCHB &chb)
Assignment operator.
Definition chb.hpp:57
void init(Home home, const BoolVarArgs &x, BoolBranchMerit bm=nullptr)
Initialize for Boolean variables x.
BoolCHB(void)
Construct as not yet initialized.
Definition chb.hpp:50
BoolCHB(Home home, const BoolVarArgs &x, BoolBranchMerit bm=nullptr)
Initialize for Boolean variables x.
Trace delta information for Boolean variables.
Definition int.hh:5894
void operator++(void)
Move iterator to next range (if possible).
int min(void) const
Return smallest value of range.
bool operator()(void) const
Test whether iterator is still at a range or done.
int max(void) const
Return largest value of range.
BoolTraceDelta(Int::BoolTraceView o, Int::BoolView n, const Delta &d)
Initialize with old trace view o, new view n, and delta d.
unsigned int width(void) const
Return width of range (distance between minimum and maximum).
int delta
Delta information.
Definition int.hh:5897
Which values to select for branching first.
Definition int.hh:5235
Select s
Which value to select.
Definition int.hh:5246
Select
Which value selection.
Definition int.hh:5238
@ SEL_MIN
Select smallest value.
Definition int.hh:5239
@ SEL_RND
Select random value.
Definition int.hh:5241
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:5242
@ SEL_MAX
Select largest value.
Definition int.hh:5240
Select select(void) const
Return selection strategy.
Definition val.hpp:124
BoolValBranch(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition val.hpp:112
Passing Boolean variables.
Definition int.hh:738
BoolVarArgs(void)
Allocate empty array.
Definition array.hpp:114
BoolVarArgs(Space &home, int n, int min, int max)
Initialize array with n new variables.
BoolVarArgs & operator=(const BoolVarArgs &)=default
Assignment operator.
BoolVarArray & operator=(const BoolVarArray &)=default
Assignment operator.
BoolVarArray(Space &home, int n, int min, int max)
Initialize array with n new variables.
BoolVarArray(void)
Default constructor (array of size 0).
Definition array.hpp:159
Which Boolean variable to select for branching.
Definition int.hh:5002
void expand(Home home, const BoolVarArgs &x)
Expand decay factor into AFC or action.
Definition var.hpp:345
Select select(void) const
Return selection strategy.
Definition var.hpp:340
BoolVarBranch(void)
Initialize with strategy SEL_NONE.
Definition var.hpp:308
Select
Which variable selection.
Definition int.hh:5005
@ SEL_DEGREE_MIN
With smallest degree.
Definition int.hh:5010
@ SEL_AFC_MAX
With largest accumulated failure count.
Definition int.hh:5013
@ SEL_CHB_MIN
With lowest CHB.
Definition int.hh:5016
@ SEL_MERIT_MIN
With least merit.
Definition int.hh:5008
@ SEL_ACTION_MIN
With lowest action.
Definition int.hh:5014
@ SEL_AFC_MIN
With smallest accumulated failure count.
Definition int.hh:5012
@ SEL_RND
Random (uniform, for tie breaking).
Definition int.hh:5007
@ SEL_NONE
First unassigned.
Definition int.hh:5006
@ SEL_ACTION_MAX
With highest action.
Definition int.hh:5015
@ SEL_CHB_MAX
With highest CHB.
Definition int.hh:5017
@ SEL_MERIT_MAX
With highest merit.
Definition int.hh:5009
@ SEL_DEGREE_MAX
With largest degree.
Definition int.hh:5011
Select s
Which variable to select.
Definition int.hh:5021
Boolean integer variables.
Definition int.hh:533
bool one(void) const
Test whether domain is one.
Definition bool.hpp:107
unsigned int size(void) const
Return size (cardinality) of domain.
Definition bool.hpp:81
int val(void) const
Return assigned value.
Definition bool.hpp:57
bool zero(void) const
Test whether domain is zero.
Definition bool.hpp:103
int max(void) const
Return maximum of domain.
Definition bool.hpp:71
BoolVar(Space &home, int min, int max)
Initialize Boolean variable with range domain.
BoolVar & operator=(const BoolVar &)=default
Assignment operator.
int med(void) const
Return median of domain (greatest element not greater than the median).
Definition bool.hpp:67
friend class BoolVarArgs
Definition int.hh:535
friend class BoolVarArray
Definition int.hh:534
bool in(int n) const
Test whether n is contained in domain.
Definition bool.hpp:98
BoolVar(void)
Default constructor.
Definition bool.hpp:48
unsigned int width(void) const
Return width of domain (distance between maximum and minimum).
Definition bool.hpp:77
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value).
Definition bool.hpp:85
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
Definition bool.hpp:89
int min(void) const
Return minimum of domain.
Definition bool.hpp:63
bool none(void) const
Test whether domain is neither zero nor one.
Definition bool.hpp:111
bool range(void) const
Test whether domain is a range.
Definition bool.hpp:94
Base-class for branchers.
Definition core.hpp:1453
CHB(void)
Construct as not yet initialized.
Definition chb.hpp:346
Data stored for a DFA.
Definition dfa.hpp:42
int val(void) const
Return current symbol.
Definition dfa.hpp:293
void operator++(void)
Move iterator to next symbol.
Definition dfa.hpp:285
bool operator()(void) const
Test whether iterator still at a symbol.
Definition dfa.hpp:280
Symbols(const DFA &d)
Initialize to symbols of DFA d.
Definition dfa.hpp:269
Specification of a DFA transition.
Definition int.hh:2212
int i_state
input state
Definition int.hh:2214
int o_state
output state Default constructor
Definition int.hh:2216
Iterator for DFA transitions (sorted by symbols).
Definition int.hh:2223
int o_state(void) const
Return out-state of current transition.
Definition dfa.hpp:259
void operator++(void)
Move iterator to next transition.
Definition dfa.hpp:244
bool operator()(void) const
Test whether iterator still at a transition.
Definition dfa.hpp:239
Transitions(const DFA &d)
Initialize to all transitions of DFA d.
Definition dfa.hpp:213
int i_state(void) const
Return in-state of current transition.
Definition dfa.hpp:249
int symbol(void) const
Return symbol of current transition.
Definition dfa.hpp:254
Deterministic finite automaton (DFA).
Definition int.hh:2203
DFA(int s, std::initializer_list< Transition > t, std::initializer_list< int > f, bool minimize=true)
Initialize DFA.
bool operator==(const DFA &d) const
Test whether DFA is equal to d.
Definition dfa.hpp:330
int symbol_max(void) const
Return largest symbol in DFA.
Definition dfa.hpp:182
friend class Transitions
Definition int.hh:2276
unsigned int max_degree(void) const
Return maximal degree (in-degree and out-degree) of any state.
Definition dfa.hpp:157
int n_states(void) const
Return the number of states.
Definition dfa.hpp:139
int symbol_min(void) const
Return smallest symbol in DFA.
Definition dfa.hpp:175
DFA(void)
Initialize for DFA accepting the empty word.
Definition dfa.hpp:131
int final_lst(void) const
Return the number of the last final state.
Definition dfa.hpp:169
DFA(int s, Transition t[], int f[], bool minimize=true)
Initialize DFA.
int n_transitions(void) const
Return the number of transitions.
Definition dfa.hpp:151
unsigned int n_symbols(void) const
Return the number of symbols.
Definition dfa.hpp:145
void init(int s, Transition t[], int f[], bool minimize=true)
Initialize DFA.
std::size_t hash(void) const
Return hash key.
Definition dfa.hpp:189
bool operator!=(const DFA &d) const
Test whether DFA is not equal to d.
Definition dfa.hpp:347
int final_fst(void) const
Return the number of the first final state.
Definition dfa.hpp:163
Generic domain change information to be supplied to advisors.
Definition core.hpp:209
Home class for posting propagators
Definition core.hpp:863
Recording AFC information for integer variables.
Definition int.hh:4610
IntAFC(void)
Construct as not yet initialized.
Definition afc.hpp:37
void init(Home home, const IntVarArgs &x, double d=1.0, bool share=true)
Initialize for integer variables x with decay factor d.
Definition afc.hpp:54
IntAFC & operator=(const IntAFC &a)
Assignment operator.
Definition afc.hpp:44
Recording actions for integer variables.
Definition int.hh:4696
IntAction(Home home, const IntVarArgs &x, double d=1.0, bool p=true, bool f=true, IntBranchMerit bm=nullptr)
Initialize for integer variables x with decay factor d.
void init(Home home, const IntVarArgs &x, double d=1.0, bool p=true, bool f=true, IntBranchMerit bm=nullptr)
Initialize for integer variables x with decay factor d.
IntAction & operator=(const IntAction &a)
Assignment operator.
Definition action.hpp:44
IntAction(void)
Construct as not yet initialized.
Definition action.hpp:37
Passing integer arguments.
Definition int.hh:652
static IntArgs create(int n, int start, int inc=1)
Allocate array with n elements such that for all .
Definition array.hpp:76
IntArgs(void)
Allocate empty array.
Definition array.hpp:42
Which values to select for assignment.
Definition int.hh:5317
Select s
Which value to select.
Definition int.hh:5329
Select select(void) const
Return selection strategy.
Definition assign.hpp:49
IntAssign(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition assign.hpp:37
Select
Which value selection.
Definition int.hh:5320
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:5325
@ SEL_MIN
Select smallest value.
Definition int.hh:5321
@ SEL_MED
Select greatest value not greater than the median.
Definition int.hh:5322
@ SEL_RND
Select random value.
Definition int.hh:5324
@ SEL_MAX
Select largest value.
Definition int.hh:5323
Recording CHB for integer variables.
Definition int.hh:4804
IntCHB(void)
Construct as not yet initialized.
Definition chb.hpp:37
IntCHB(Home home, const IntVarArgs &x, IntBranchMerit bm=nullptr)
Initialize for integer variables x.
IntCHB & operator=(const IntCHB &chb)
Assignment operator.
Definition chb.hpp:44
void init(Home home, const IntVarArgs &x, IntBranchMerit bm=nullptr)
Initialize for integer variables x.
unsigned int width(void) const
Return width of range (distance between minimum and maximum).
bool operator()(void) const
Test whether iterator is still at a range or done.
int max(void) const
Return largest value of range.
void operator++(void)
Move iterator to next range (if possible).
void init(const IntSet &s)
Initialize with ranges for set s.
int min(void) const
Return smallest value of range.
IntSetRanges(void)
Default constructor.
void init(const IntSet &s)
Initialize with values for s.
IntSetValues(void)
Default constructor.
Integer sets.
Definition int.hh:178
int min(void) const
Return minimum of entire set.
unsigned int width(void) const
Return width of set (distance between maximum and minimum).
int min(int i) const
Return minimum of range at position i.
bool in(int n) const
Return whether n is included in the set.
int max(int i) const
Return maximum of range at position i.
int max(void) const
Return maximum of entire set.
friend class IntSetRanges
Definition int.hh:179
IntSet(std::initializer_list< std::pair< int, int > > r)
Initialize with ranges from vector r.
int ranges(void) const
Return number of ranges of the specification.
bool operator==(const IntSet &s) const
Return whether s is equal.
unsigned int size(void) const
Return size (cardinality) of set.
IntSet(void)
Initialize as empty set.
Definition int-set-1.hpp:47
static const IntSet empty
Empty set.
Definition int.hh:301
bool operator!=(const IntSet &s) const
Return whether s is not equal.
IntSet(std::initializer_list< int > r)
Initialize with integers from list r.
friend class IntSetInit
Definition int.hh:180
Trace delta information for integer variables.
Definition int.hh:5876
Int::ViewRanges< Int::IntView > rn
Iterator over the new values.
Definition int.hh:5879
Iter::Ranges::RangeList ro
Iterator over the old values.
Definition int.hh:5881
IntTraceDelta(Int::IntTraceView o, Int::IntView n, const Delta &d)
Initialize with old trace view o, new view n, and delta d.
Definition int-delta.hpp:37
Which values to select for branching first.
Definition int.hh:5200
Select
Which value selection.
Definition int.hh:5203
@ SEL_VALUES_MIN
Select all values starting from smallest.
Definition int.hh:5213
@ SEL_RND
Select random value.
Definition int.hh:5207
@ SEL_SPLIT_MAX
Select values greater than mean of smallest and largest value.
Definition int.hh:5209
@ SEL_MIN
Select smallest value.
Definition int.hh:5204
@ SEL_MAX
Select largest value.
Definition int.hh:5206
@ SEL_RANGE_MAX
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition int.hh:5211
@ SEL_RANGE_MIN
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition int.hh:5210
@ SEL_VALUES_MAX
Select all values starting from largest.
Definition int.hh:5214
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:5212
@ SEL_MED
Select greatest value not greater than the median.
Definition int.hh:5205
@ SEL_SPLIT_MIN
Select values not greater than mean of smallest and largest value.
Definition int.hh:5208
Select select(void) const
Return selection strategy.
Definition val.hpp:49
IntValBranch(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition val.hpp:37
Select s
Which value to select.
Definition int.hh:5218
Passing integer variables.
Definition int.hh:680
IntVarArgs(void)
Allocate empty array.
Definition array.hpp:85
IntVarArgs(Space &home, int n, int min, int max)
Initialize array with n new variables.
IntVarArgs(Space &home, int n, const IntSet &s)
Initialize array with n new variables.
IntVarArgs & operator=(const IntVarArgs &)=default
Assignment operator.
IntVarArray & operator=(const IntVarArray &)=default
Assignment operator.
IntVarArray(void)
Default constructor (array of size 0).
Definition array.hpp:143
IntVarArray(Space &home, int n, int min, int max)
Initialize array with n new variables.
IntVarArray(Space &home, int n, const IntSet &s)
Initialize array with n new variables.
Which integer variable to select for branching.
Definition int.hh:4916
void expand(Home home, const IntVarArgs &x)
Expand AFC, action, and CHB.
Definition var.hpp:74
Select
Which variable selection.
Definition int.hh:4919
@ SEL_MAX_MIN
With smallest max.
Definition int.hh:4934
@ SEL_CHB_MAX
With highest CHB Q-score.
Definition int.hh:4931
@ SEL_AFC_SIZE_MAX
With largest accumulated failure count divided by domain size.
Definition int.hh:4941
@ SEL_MIN_MIN
With smallest min.
Definition int.hh:4932
@ SEL_ACTION_SIZE_MAX
With largest action divided by domain size.
Definition int.hh:4943
@ SEL_AFC_SIZE_MIN
With smallest accumulated failure count divided by domain size.
Definition int.hh:4940
@ SEL_REGRET_MIN_MIN
With smallest min-regret.
Definition int.hh:4951
@ SEL_DEGREE_SIZE_MIN
With smallest degree divided by domain size.
Definition int.hh:4938
@ SEL_MIN_MAX
With largest min.
Definition int.hh:4933
@ SEL_REGRET_MIN_MAX
With largest min-regret.
Definition int.hh:4957
@ SEL_CHB_SIZE_MAX
With largest CHB Q-score divided by domain size.
Definition int.hh:4945
@ SEL_MAX_MAX
With largest max.
Definition int.hh:4935
@ SEL_AFC_MIN
With smallest accumulated failure count.
Definition int.hh:4926
@ SEL_SIZE_MIN
With smallest domain size.
Definition int.hh:4936
@ SEL_AFC_MAX
With largest accumulated failure count.
Definition int.hh:4927
@ SEL_MERIT_MAX
With highest merit.
Definition int.hh:4923
@ SEL_DEGREE_MAX
With largest degree.
Definition int.hh:4925
@ SEL_SIZE_MAX
With largest domain size.
Definition int.hh:4937
@ SEL_ACTION_MIN
With lowest action.
Definition int.hh:4928
@ SEL_ACTION_MAX
With highest action.
Definition int.hh:4929
@ SEL_CHB_MIN
With lowest CHB Q-score.
Definition int.hh:4930
@ SEL_RND
Random (uniform, for tie breaking).
Definition int.hh:4921
@ SEL_NONE
First unassigned.
Definition int.hh:4920
@ SEL_MERIT_MIN
With least merit.
Definition int.hh:4922
@ SEL_REGRET_MAX_MIN
With smallest max-regret.
Definition int.hh:4963
@ SEL_CHB_SIZE_MIN
With smallest CHB Q-score divided by domain size.
Definition int.hh:4944
@ SEL_DEGREE_MIN
With smallest degree.
Definition int.hh:4924
@ SEL_REGRET_MAX_MAX
With largest max-regret.
Definition int.hh:4969
@ SEL_ACTION_SIZE_MIN
With smallest action divided by domain size.
Definition int.hh:4942
@ SEL_DEGREE_SIZE_MAX
With largest degree divided by domain size.
Definition int.hh:4939
Select s
Which variable to select.
Definition int.hh:4973
Select select(void) const
Return selection strategy.
Definition var.hpp:69
IntVarBranch(void)
Initialize with strategy SEL_NONE.
Definition var.hpp:37
IntVarRanges(void)
Default constructor.
Definition int.hpp:106
void init(const IntVar &x)
Initialize with ranges for integer variable x.
Definition int.hpp:113
IntVarValues(void)
Default constructor.
Definition int.hpp:124
void init(const IntVar &x)
Initialize with values x.
Definition int.hpp:133
Integer variables.
Definition int.hh:389
unsigned int size(void) const
Return size (cardinality) of domain.
Definition int.hpp:80
IntVar & operator=(const IntVar &)=default
Assignment operator.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
Definition int.hpp:88
int min(void) const
Return minimum of domain.
Definition int.hpp:62
friend class IntVarArgs
Definition int.hh:391
IntVar(Space &home, const IntSet &d)
Initialize variable with arbitrary domain.
int val(void) const
Return assigned value.
Definition int.hpp:56
IntVar(void)
Default constructor.
Definition int.hpp:47
bool in(int n) const
Test whether n is contained in domain.
Definition int.hpp:97
unsigned int width(void) const
Return width of domain (distance between maximum and minimum).
Definition int.hpp:76
bool range(void) const
Test whether domain is a range.
Definition int.hpp:93
IntVar(Space &home, int min, int max)
Initialize variable with range domain.
friend class IntVarArray
Definition int.hh:390
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value).
Definition int.hpp:84
int med(void) const
Return median of domain (greatest element not greater than the median).
Definition int.hpp:66
int max(void) const
Return maximum of domain.
Definition int.hpp:70
Duplicate of a Boolean view.
Boolean variable implementation.
Definition var-imp.hpp:491
Boolean view for Boolean variables.
Definition view.hpp:1378
Internal access to finalized tuple-set support representations.
Definition int.hh:2686
static bool dense_compressed_support(const TupleSet &ts, int p, int n, const TupleSet::CSupportWord *&b, const TupleSet::CSupportWord *&e)
Return compressed support words for position/value.
static bool support_id(const TupleSet &ts, int p, int n, unsigned int &gid)
Return support id for position/value.
static unsigned int sparse_values(const TupleSet &ts)
Return number of sparse support values.
static bool sparse_support(const TupleSet &ts, int p, int n, const unsigned int *&b, const unsigned int *&e, unsigned int &gid)
Return sparse support tuple id range for position/value.
static const unsigned int * sparse_support_offsets(const TupleSet &ts)
Return sparse support offsets.
static const unsigned int * sparse_tuple_value_ids(const TupleSet &ts)
Return tuple-value sparse ids.
Duplicate of an integer view.
Range iterator for ranges of integer variable implementation.
Definition var-imp.hpp:392
Integer variable implementation.
Definition var-imp.hpp:89
Integer view for integer variables.
Definition view.hpp:129
Implementation of a symmetry at the modelling level.
Definition ldsb.hh:106
Range iterator for integer views.
Definition view.hpp:54
Range iterator for computing set difference.
Range iterator for range lists
Value iterator from range iterator.
Reification specification.
Definition int.hh:910
BoolVar x
The Boolean control variable.
Definition int.hh:913
BoolVar var(void) const
Return Boolean control variable.
Definition reify.hpp:48
Reify(void)
Default constructor without proper initialization.
Definition reify.hpp:42
ReifyMode mode(void) const
Return reification mode.
Definition reify.hpp:56
ReifyMode rm
The reification mode.
Definition int.hh:915
Random number generator.
Definition rnd.hpp:42
Shared array with arbitrary number of elements.
SharedHandle(void)
Create shared handle with no object pointing to.
Computation spaces.
Definition core.hpp:1775
virtual void prune(const Space &home, const BoolTraceRecorder &t, const ViewTraceInfo &vti, int i, BoolTraceDelta &d)
Print prune information.
virtual void init(const Space &home, const BoolTraceRecorder &t)
Print init information.
std::ostream & os
Output stream to use.
Definition int.hh:5988
virtual void fix(const Space &home, const BoolTraceRecorder &t)
Print fixpoint information.
static StdBoolTracer def
Default tracer (printing to std::cerr).
Definition int.hh:6004
virtual void fail(const Space &home, const BoolTraceRecorder &t)
Print failure information.
StdBoolTracer(std::ostream &os0=std::cerr)
Initialize with output stream os0.
virtual void done(const Space &home, const BoolTraceRecorder &t)
Print that trace recorder is done.
virtual void prune(const Space &home, const IntTraceRecorder &t, const ViewTraceInfo &vti, int i, IntTraceDelta &d)
Print prune information.
virtual void fail(const Space &home, const IntTraceRecorder &t)
Print failure information.
virtual void done(const Space &home, const IntTraceRecorder &t)
Print that trace recorder is done.
StdIntTracer(std::ostream &os0=std::cerr)
Initialize with output stream os0 and events \ e.
std::ostream & os
Output stream to use.
Definition int.hh:5950
virtual void fix(const Space &home, const IntTraceRecorder &t)
Print fixpoint information.
virtual void init(const Space &home, const IntTraceRecorder &t)
Print init information.
static StdIntTracer def
Default tracer (printing to std::cerr).
Definition int.hh:5966
Date item for bitsets.
Collection of symmetries.
Definition int.hh:5638
A reference-counted pointer to a SymmetryObject.
Definition int.hh:5601
SymmetryHandle(const SymmetryHandle &h)
Copy constructor.
SymmetryHandle(Int::LDSB::SymmetryObject *o)
Initialies with a SymmetryObject.
SymmetryHandle(void)
Default constructor.
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Definition int.hh:5604
void decrement(void)
Decrement counter.
const SymmetryHandle & operator=(const SymmetryHandle &h)
Assignment operator.
void increment(void)
Increment counter.
~SymmetryHandle(void)
Destructor.
Combine variable selection criteria for tie-breaking.
Definition tiebreak.hpp:38
Trace filters.
Definition filter.hpp:133
Compressed support data for one tuple-word block.
Definition int.hh:2393
unsigned int widx
Word index in tuple-word array.
Definition int.hh:2395
BitSetData bits
Support bits in that word.
Definition int.hh:2396
Data stored for a Table.
Definition int.hh:2434
int max
Largest value.
Definition int.hh:2459
State select_state(ExtensionalPropKind epk, bool dense_possible, bool sparse_possible, bool compressed_possible, bool support_bits_sparse, unsigned long long dense_bytes) const
Select the finalized state for the computed table layout.
void clear_support(void)
Release partially or fully constructed support data.
unsigned int compressed_n_entries
Number of compressed support entries.
Definition int.hh:2487
int n_free
Number of free tuple entries of arity.
Definition int.hh:2455
bool terminal(void) const
Is datastructure no longer mutable.
Definition tuple-set.hpp:93
unsigned int * sparse_tuples
Sparse support tuple ids (size arity*n_tuples).
Definition int.hh:2479
void resize(void)
Resize tuple data.
BitSetData * support
Pointer to all support data.
Definition int.hh:2471
Data(int a)
Initialize as empty tuple set with arity a.
Definition tuple-set.hpp:66
unsigned int * compressed_offsets
Compressed support offsets (size n_vals+1).
Definition int.hh:2483
unsigned int n_words
Number of words for support.
Definition int.hh:2451
int min
Smallest value.
Definition int.hh:2457
bool failed(void) const
Has finalization failed.
Definition tuple-set.hpp:88
static void set(BitSetData *d, unsigned int n)
Set bit n in bitset data d.
unsigned int * sparse_offsets
Sparse support offsets (size sparse_n_vals+1).
Definition int.hh:2477
void finalize(void)
Finalize datastructure (disallows additions of more Tuples).
int n_tuples
Number of Tuples.
Definition int.hh:2453
unsigned int sparse_n_vals
Number of sparse support values.
Definition int.hh:2475
Tuple get(int i) const
Return tuple with number i.
unsigned int * sparse_tv
Tuple cell to sparse support id map (size arity*n_tuples).
Definition int.hh:2481
int * td
Tuple data.
Definition int.hh:2463
State state
Tuple set lifecycle state and finalized representation.
Definition int.hh:2473
CSupportWord * compressed_words
Compressed support words (size compressed_n_entries).
Definition int.hh:2485
unsigned int tuple2idx(Tuple t) const
Map tuple address to index.
State
Tuple set lifecycle state and finalized representation.
Definition int.hh:2440
Range * range
Pointer to all ranges.
Definition int.hh:2467
const Range * lst(int i) const
Return last range for position i.
bool finalized(void) const
Is datastructure finalized.
Definition tuple-set.hpp:81
void finalize(ExtensionalPropKind epk)
Finalize datastructure (disallows additions of more Tuples).
virtual ~Data(void)
Delete implementation.
State empty_state(ExtensionalPropKind epk) const
Select the state for an empty finalized tuple set.
ValueData * vd
Value data.
Definition int.hh:2465
const Range * fst(int i) const
Return first range for position i.
static const int n_initial_free
Initial number of free tuples.
Definition int.hh:2437
std::size_t key
Hash key.
Definition int.hh:2461
Tuple add(void)
Return newly added tuple.
Definition tuple-set.hpp:98
unsigned int * range_base
Pointer to all range support ids.
Definition int.hh:2469
Range information.
Definition int.hh:2399
BitSetData * s
Begin of supports.
Definition int.hh:2406
unsigned int width(void) const
Return the width.
Definition tuple-set.hpp:45
int max
Maximum value.
Definition int.hh:2404
int min
Minimum value.
Definition int.hh:2402
const BitSetData * supports(unsigned int n_words, int n) const
Return the dense supports for value n.
Definition tuple-set.hpp:50
bool operator()(void) const
Test whether iterator is still at a range.
Ranges(const TupleSet &ts, int i)
Initialize for column i.
int max(void) const
Return largest value of range.
const Range * l
Last range.
Definition int.hh:2654
int min(void) const
Return smallest value of range.
void operator++(void)
Move iterator to next range (if possible).
const Range * c
Current range.
Definition int.hh:2652
unsigned int width(void) const
Return width of range (distance between minimum and maximum).
Data about values in the table.
Definition int.hh:2419
unsigned int start(int n) const
Find start range for value n.
unsigned int n
Number of ranges.
Definition int.hh:2422
unsigned int * base
Base support id for each range (sparse and compressed only).
Definition int.hh:2426
Class representing a set of tuples.
Definition int.hh:2382
TupleSet(void)
Construct an uninitialized tuple set.
bool failed(void) const
Has tuple-set finalization failed.
void _add(const IntArgs &t)
Add tuple t to tuple set.
int tuples(void) const
Number of tuples.
TupleSet(int a, const DFA &dfa, ExtensionalPropKind epk)
Initialize with DFA dfa for arity a and representation epk.
int max(void) const
Return maximal value in all tuples.
bool operator!=(const TupleSet &t) const
Test whether tuple set is different from t.
bool finalized(void) const
Is tuple set successfully finalized.
TupleSet(int a)
Initialize for a tuple set with arity a.
ExtensionalPropKind representation(void) const
Return materialized tuple-set representation.
TupleSet & add(const IntArgs &t)
Add tuple t to tuple set.
bool operator==(const TupleSet &t) const
Test whether tuple set is equal to t.
TupleSet & operator=(const TupleSet &t)
Assignment operator.
Tuple operator[](int i) const
Get tuple i.
const Range * lst(int i) const
Return last range for position i.
int * Tuple
Type of a tuple.
Definition int.hh:2389
std::size_t hash(void) const
Return hash key.
void finalize(void)
Finalize tuple set with dense support data.
bool equal(const TupleSet &t) const
Test whether tuple set is equal to t.
TupleSet(int a, const DFA &dfa)
Initialize with DFA dfa for arity a using dense supports.
TupleSet(const TupleSet &t)
Initialize by TupleSet t (tuple set is shared).
const Range * fst(int i) const
Return first range for position i.
unsigned int words(void) const
Return number of required bit set words.
int min(void) const
Return minimal value in all tuples.
Data & raw(void) const
Get raw data (must be initialized).
Gecode::Support::BitSetData BitSetData
Import bit set data type.
Definition int.hh:2391
Data & data(void) const
Get data (must be initialized and finalized).
void init(int a)
Initialize an uninitialized tuple set.
int arity(void) const
Arity of tuple set.
Variable arrays
Definition array.hpp:112
View trace information.
Definition core.hpp:917
Propagator for recording view trace information.
Definition recorder.hpp:60
Tracer that process view trace information.
Definition tracer.hpp:51
#define GECODE_INT_EXPORT
Definition int.hh:85
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te=(TE_INIT|TE_PRUNE|TE_FIX|TE_FAIL|TE_DONE), FloatTracer &t=StdFloatTracer::def)
Create a tracer for float variables.
ViewTraceRecorder< Int::IntView > IntTraceRecorder
Trace recorder for integer variables.
Definition int.hh:5941
ViewTraceRecorder< Int::BoolView > BoolTraceRecorder
Trace recorder for Boolean variables.
Definition int.hh:5979
ViewTracer< Int::IntView > IntTracer
Tracer for integer variables.
Definition int.hh:5936
ViewTracer< Int::BoolView > BoolTracer
Tracer for Boolean variables.
Definition int.hh:5974
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition var.hpp:48
void assign(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatAssign vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
Assign all x with variable selection vars and value selection vals.
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
Branch over x with variable selection vars and value selection vals.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
void binpacking(Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntPropLevel ipl=IPL_DEF)
Post propagator for bin packing.
std::function< double(const Space &home, IntVar x, int i)> IntBranchMerit
Branch merit function type for integer variables.
Definition int.hh:4532
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
Definition int.hh:4510
std::function< bool(const Space &home, BoolVar x, int i)> BoolBranchFilter
Branch filter function type for Boolean variables.
Definition int.hh:4520
std::function< int(const Space &home, BoolVar x, int i)> BoolBranchVal
Branch value function type for Boolean variables.
Definition int.hh:4568
std::function< double(const Space &home, BoolVar x, int i)> BoolBranchMerit
Branch merit function type for Boolean variables.
Definition int.hh:4543
std::function< int(const Space &home, IntVar x, int i)> IntBranchVal
Branch value function type for integer variables.
Definition int.hh:4556
std::function< void(Space &home, unsigned int a, BoolVar x, int i, int n)> BoolBranchCommit
Branch commit function type for Boolean variables.
Definition int.hh:4597
std::function< void(Space &home, unsigned int a, IntVar x, int i, int n)> IntBranchCommit
Branch commit function type for integer variables.
Definition int.hh:4583
ExtensionalPropKind
Support representation selection for extensional tuple sets.
Definition int.hh:2355
void extensional(Home home, const IntVarArgs &x, DFA d, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for extensional constraint described by a DFA.
@ EPK_AUTO
Select dense or compressed representation automatically.
Definition int.hh:2356
@ EPK_DENSE
Use dense support representation.
Definition int.hh:2357
@ EPK_SPARSE
Use sparse support representation.
Definition int.hh:2358
@ EPK_DENSE_COMPRESSED
Use compressed dense support representation.
Definition int.hh:2359
void nooverlap(Home home, const IntVarArgs &x, const IntArgs &w, const IntVarArgs &y, const IntArgs &h, IntPropLevel ipl=IPL_DEF)
Post propagator for rectangle packing.
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel=IPL_DEF)
Post propagator that s precedes t in x.
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, BoolVar z, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
Reify imp(BoolVar x)
Use implication for reification.
Definition reify.hpp:73
IntRelType
Relation types for integers.
Definition int.hh:959
Reify eqv(BoolVar x)
Use equivalence for reification.
Definition reify.hpp:69
TaskType
Type of task for scheduling constraints.
Definition int.hh:1039
ReifyMode
Mode for reification.
Definition int.hh:882
BoolOpType
Operation types for Booleans.
Definition int.hh:984
Reify pmi(BoolVar x)
Use reverse implication for reification.
Definition reify.hpp:77
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:1008
ArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
Definition int.hh:1050
@ IRT_EQ
Equality ( ).
Definition int.hh:960
@ IRT_NQ
Disequality ( ).
Definition int.hh:961
@ IRT_GQ
Greater or equal ( ).
Definition int.hh:964
@ IRT_LE
Less ( ).
Definition int.hh:963
@ IRT_GR
Greater ( ).
Definition int.hh:965
@ IRT_LQ
Less or equal ( ).
Definition int.hh:962
@ TT_FIXS
Definition int.hh:1041
@ TT_FIXE
Definition int.hh:1042
@ TT_FIXP
Definition int.hh:1040
@ RM_IMP
Implication for reification.
Definition int.hh:896
@ RM_PMI
Inverse implication for reification.
Definition int.hh:903
@ RM_EQV
Equivalence for reification (default).
Definition int.hh:889
@ BOT_OR
Disjunction.
Definition int.hh:986
@ BOT_EQV
Equivalence.
Definition int.hh:988
@ BOT_IMP
Implication.
Definition int.hh:987
@ BOT_XOR
Exclusive or.
Definition int.hh:989
@ BOT_AND
Conjunction.
Definition int.hh:985
@ IPL_BITS_
Number of bits required (internal).
Definition int.hh:1019
@ IPL_BASIC
Use basic propagation algorithm.
Definition int.hh:1015
@ IPL_BASIC_ADVANCED
Use both.
Definition int.hh:1017
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
Definition int.hh:1013
@ IPL_FULL
Use full propagation.
Definition int.hh:1018
@ IPL_VAL
Value propagation.
Definition int.hh:1011
@ IPL_ADVANCED
Use advanced propagation algorithm.
Definition int.hh:1016
@ IPL_DEF
Simple propagation levels.
Definition int.hh:1010
@ IPL_BND
Bounds propagation.
Definition int.hh:1012
@ TE_INIT
Trace init events.
Definition recorder.hpp:43
@ TE_PRUNE
Trace prune events.
Definition recorder.hpp:44
@ TE_FIX
Trace fixpoint events.
Definition recorder.hpp:45
@ TE_FAIL
Trace fail events.
Definition recorder.hpp:46
@ TE_DONE
Trace done events.
Definition recorder.hpp:47
Extensional propagators
Definition int.hh:2335
Symmetry breaking for integer variables.
Definition int.hh:5592
Numerical limits for integer variables.
Definition int.hh:118
const long long int llmin
Smallest allowed long long integer value.
Definition int.hh:128
void positive(int n, const char *l)
Check whether n is in range and strictly positive, otherwise throw out of limits with information l.
Definition limits.hpp:57
const long long int llmax
Largest allowed long long integer value.
Definition int.hh:126
bool overflow_add(int n, int m)
Check whether adding n and m would overflow.
Definition limits.hpp:79
void nonnegative(int n, const char *l)
Check whether n is in range and nonnegative, otherwise throw out of limits with information l.
Definition limits.hpp:68
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Definition limits.hpp:46
const int infinity
Infinity for integers.
Definition int.hh:124
bool overflow_mul(int n, int m)
Check whether multiplying n and m would overflow.
Definition limits.hpp:107
const int min
Smallest allowed integer value.
Definition int.hh:122
bool valid(int n)
Return whether n is in range.
Definition limits.hpp:37
const int max
Largest allowed integer value.
Definition int.hh:120
const long long int llinfinity
Infinity for long long integers.
Definition int.hh:130
bool overflow_sub(int n, int m)
Check whether subtracting m from n would overflow.
Definition limits.hpp:93
Finite domain integers.
Definition lastval.hh:52
Gecode toplevel namespace
ArgArray< IntSet > IntSetArgs
Passing set arguments.
Definition int.hh:643
BoolVarBranch BOOL_VAR_CHB_MIN(BoolCHB c, BranchTbl tbl=nullptr)
Select variable with lowest CHB Q-score.
Definition var.hpp:434
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c.
Definition assign.hpp:75
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
Definition assign.hpp:70
SymmetryHandle ValueSymmetry(const IntArgs &v)
Values in v are interchangeable.
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition val.hpp:75
SymmetryHandle ValueSequenceSymmetry(const IntArgs &v, int ss)
Value sequences in v of size ss are interchangeable.
BoolAssign BOOL_ASSIGN_MAX(void)
Select largest value.
Definition assign.hpp:105
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel ipl=IPL_DEF)
Post propagator for .
IntValBranch INT_VAL_RANGE_MIN(void)
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition val.hpp:85
IntValBranch INT_VAL_RANGE_MAX(void)
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition val.hpp:90
BoolValBranch BOOL_VAL(BoolBranchVal v, BoolBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition val.hpp:145
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
Definition val.hpp:105
IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:236
SymmetryHandle values_reflect(int lower, int upper)
The values from lower to upper (inclusive) can be reflected.
IntVarBranch INT_VAR_CHB_SIZE_MIN(IntCHB c, BranchTbl tbl=nullptr)
Select variable with smallest CHB Q-score divided by domain size.
Definition var.hpp:266
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl=IPL_DEF)
Post propagator for .
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void order(Home home, IntVar s0, int p0, IntVar s1, int p1, BoolVar b, IntPropLevel ipl=IPL_DEF)
Post propagators for ordering two tasks.
IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree.
Definition var.hpp:121
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl=nullptr)
Select variable with smallest min-regret.
Definition var.hpp:286
IntVarBranch INT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with highest action with decay factor d.
Definition var.hpp:156
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel ipl=IPL_DEF)
Post propagator for .
SharedArray< int > IntSharedArray
Arrays of integers that can be shared among several element constraints.
Definition int.hh:1512
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
Definition val.hpp:60
IntValBranch INT_VAL(IntBranchVal v, IntBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition val.hpp:95
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
Definition tiebreak.hpp:80
Archive & operator<<(Archive &e, FloatNumBranch nl)
Definition val-sel.hpp:39
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, IntPropLevel ipl=IPL_DEF)
Post propagator that y is x sorted in increasing order.
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition ipl.hpp:43
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl=nullptr)
Select variable with largest min-regret.
Definition var.hpp:291
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl=IPL_DEF)
Post propagator for for all .
IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest action divided by domain size with decay factor d.
Definition var.hpp:256
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
Definition val.hpp:130
BoolVarBranch BOOL_VAR_MERIT_MIN(BoolBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with least merit according to branch merit function bm.
Definition var.hpp:374
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:96
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
Definition ipl.hpp:37
IntRelType neg(IntRelType irt)
Return negated relation type of irt.
Definition irt.hpp:52
IntVarBranch INT_VAR_CHB_MIN(IntCHB c, BranchTbl tbl=nullptr)
Select variable with lowest CHB Q-score.
Definition var.hpp:166
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
BoolVarBranch BOOL_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:364
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void element(Home home, IntSharedArray n, IntVar x0, IntVar x1, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count with decay factor d.
Definition var.hpp:136
void argmax(Home home, const IntVarArgs &x, IntVar y, bool tiebreak=true, IntPropLevel ipl=IPL_DEF)
Post propagator for .
IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count with decay factor d.
Definition var.hpp:126
IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl=nullptr)
Select variable with largest max-regret.
Definition var.hpp:301
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Definition val.hpp:100
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3, IntPropLevel ipl=IPL_DEF)
Post propagator for .
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.
Definition irt.hpp:37
void path(Home home, const IntVarArgs &x, IntVar s, IntVar e, IntPropLevel ipl=IPL_DEF)
Post propagator such that x forms a Hamiltonian path.
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
IntVarBranch INT_VAR_CHB_MAX(IntCHB c, BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score.
Definition var.hpp:176
IntValBranch INT_VAL_MAX(void)
Select largest value.
Definition val.hpp:65
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
Definition val.hpp:135
BoolVarBranch BOOL_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking).
Definition var.hpp:369
BoolVarBranch BOOL_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with lowest action with decay factor d.
Definition var.hpp:414
void when(Home home, BoolVar x, std::function< void(Space &home)> t, std::function< void(Space &home)> e, IntPropLevel ipl=IPL_DEF)
Execute t (then) when x is assigned one, and e (else) otherwise.
void cumulative(Home home, int c, const TaskTypeArgs &t, const IntVarArgs &flex, const IntArgs &fix, const IntArgs &u, IntPropLevel ipl=IPL_DEF)
Post propagators for scheduling tasks on cumulative resources.
BoolVarBranch BOOL_VAR_DEGREE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree.
Definition var.hpp:384
void cumulatives(Home home, const IntVarArgs &m, const IntVarArgs &s, const IntVarArgs &p, const IntVarArgs &e, const IntVarArgs &u, const IntArgs &c, bool at_most, IntPropLevel ipl=IPL_DEF)
Post propagators for the cumulatives constraint.
BoolAssign BOOL_ASSIGN_RND(Rnd r)
Select random value.
Definition assign.hpp:110
std::function< void(const Space &home, const Brancher &b, unsigned int a, IntVar x, int i, const int &n, std::ostream &o)> IntVarValPrint
Function type for printing branching alternatives for integer variables.
Definition int.hh:4898
IntValBranch INT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition val.hpp:80
IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl=nullptr)
Select variable with smallest max.
Definition var.hpp:196
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition val.hpp:55
SymmetryHandle VariableSymmetry(const IntVarArgs &x)
Variables in x are interchangeable.
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
Definition assign.hpp:60
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
BoolVarBranch BOOL_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count with decay factor d.
Definition var.hpp:394
BoolVarBranch BOOL_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count with decay factor d.
Definition var.hpp:404
BoolAssign BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c.
Definition assign.hpp:115
BoolVarBranch BOOL_VAR_CHB_MAX(BoolCHB c, BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score.
Definition var.hpp:444
IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl=nullptr)
Select variable with largest max.
Definition var.hpp:201
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
Definition assign.hpp:55
IntVarBranch INT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with lowest action with decay factor d.
Definition var.hpp:146
IntVarBranch INT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking).
Definition var.hpp:101
IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:226
void unshare(Home home, IntVarArgs &x, IntPropLevel ipl=IPL_DEF)
Replace multiple variable occurrences in x by fresh variables.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree.
Definition var.hpp:116
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &x, int ss)
Variable sequences in x of size ss are interchangeable.
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
Definition val.hpp:140
IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl=nullptr)
Select variable with smallest max-regret.
Definition var.hpp:296
IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with least merit according to branch merit function bm.
Definition var.hpp:106
IntVarBranch INT_VAR_CHB_SIZE_MAX(IntCHB c, BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score divided by domain size.
Definition var.hpp:276
void argmin(Home home, const IntVarArgs &x, IntVar y, bool tiebreak=true, IntPropLevel ipl=IPL_DEF)
Post propagator for .
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel ipl=IPL_DEF)
Post propagator for .
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree divided by domain size.
Definition var.hpp:221
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntPropLevel ipl=IPL_DEF)
Post propagators for scheduling tasks on unary resources.
void member(Home home, const IntVarArgs &x, IntVar y, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for .
IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with highest merit according to branch merit function bm.
Definition var.hpp:111
void circuit(Home home, const IntVarArgs &x, IntPropLevel ipl=IPL_DEF)
Post propagator such that x forms a circuit.
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest domain size.
Definition var.hpp:206
BoolVarBranch BOOL_VAR_DEGREE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree.
Definition var.hpp:389
std::function< void(const Space &home, const Brancher &b, unsigned int a, BoolVar x, int i, const int &n, std::ostream &o)> BoolVarValPrint
Function type for printing branching alternatives for Boolean variables.
Definition int.hh:4905
IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest action divided by domain size with decay factor d.
Definition var.hpp:246
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for .
BoolVarBranch BOOL_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with highest action with decay factor d.
Definition var.hpp:424
BoolAssign BOOL_ASSIGN_MIN(void)
Select smallest value.
Definition assign.hpp:100
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
Definition assign.hpp:65
IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl=nullptr)
Select variable with largest min.
Definition var.hpp:191
BoolVarBranch BOOL_VAR_MERIT_MAX(BoolBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with highest merit according to branch merit function bm.
Definition var.hpp:379
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree divided by domain size.
Definition var.hpp:216
IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl=nullptr)
Select variable with smallest min.
Definition var.hpp:186
IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest domain size.
Definition var.hpp:211
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Definition val.hpp:70
#define GECODE_VTABLE_EXPORT
Definition support.hh:76