Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
linear.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.org>
5 * Guido Tack <tack@gecode.org>
6 * Tias Guns <tias.guns@cs.kuleuven.be>
7 *
8 * Copyright:
9 * Christian Schulte, 2002
10 * Guido Tack, 2004
11 * Tias Guns, 2009
12 *
13 * This file is part of Gecode, the generic constraint
14 * development environment:
15 * http://www.gecode.org
16 *
17 * Permission is hereby granted, free of charge, to any person obtaining
18 * a copy of this software and associated documentation files (the
19 * "Software"), to deal in the Software without restriction, including
20 * without limitation the rights to use, copy, modify, merge, publish,
21 * distribute, sublicense, and/or sell copies of the Software, and to
22 * permit persons to whom the Software is furnished to do so, subject to
23 * the following conditions:
24 *
25 * The above copyright notice and this permission notice shall be
26 * included in all copies or substantial portions of the Software.
27 *
28 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 *
36 */
37
38#ifndef __GECODE_INT_LINEAR_HH__
39#define __GECODE_INT_LINEAR_HH__
40
41#include <gecode/int.hh>
42
47
48namespace Gecode { namespace Int { namespace Linear {
49
50 /*
51 * Binary propagators
52 *
53 */
54
64 template<class Val, class A, class B, PropCond pc>
65 class LinBin : public Propagator {
66 protected:
68 A x0;
70 B x1;
74 LinBin(Space& home, LinBin& p);
76 LinBin(Space& home, Propagator& p, A x0, B x1, Val c);
78 LinBin(Home home, A x0, B x1, Val c);
79 public:
81 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
83 virtual void reschedule(Space& home);
85 virtual size_t dispose(Space& home);
86 };
87
97 template<class Val, class A, class B, PropCond pc, class Ctrl>
98 class ReLinBin : public Propagator {
99 protected:
101 A x0;
103 B x1;
107 Ctrl b;
111 ReLinBin(Home home, A x0, B x1, Val c, Ctrl b);
112 public:
114 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
116 virtual void reschedule(Space& home);
118 virtual size_t dispose(Space& home);
119 };
120
133 template<class Val, class A, class B>
134 class EqBin : public LinBin<Val,A,B,PC_INT_BND> {
135 protected:
136 using LinBin<Val,A,B,PC_INT_BND>::x0;
137 using LinBin<Val,A,B,PC_INT_BND>::x1;
138 using LinBin<Val,A,B,PC_INT_BND>::c;
139
141 EqBin(Space& home, EqBin& p);
143 EqBin(Home home, A x0, B x1, Val c);
144 public:
146 EqBin(Space& home, Propagator& p, A x0, B x1, Val c);
148 virtual Actor* copy(Space& home);
150 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
152 static ExecStatus post(Home home, A x0, B x1, Val c);
153 };
154
167 template<class Val, class A, class B, class Ctrl, ReifyMode rm>
168 class ReEqBin : public ReLinBin<Val,A,B,PC_INT_BND,Ctrl> {
169 protected:
170 using ReLinBin<Val,A,B,PC_INT_BND,Ctrl>::x0;
171 using ReLinBin<Val,A,B,PC_INT_BND,Ctrl>::x1;
172 using ReLinBin<Val,A,B,PC_INT_BND,Ctrl>::c;
173 using ReLinBin<Val,A,B,PC_INT_BND,Ctrl>::b;
174
178 ReEqBin(Home home,A,B,Val,Ctrl);
179 public:
181 virtual Actor* copy(Space& home);
183 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
185 static ExecStatus post(Home home, A x0, B x1, Val c, Ctrl b);
186 };
187
200 template<class Val, class A, class B>
201 class NqBin : public LinBin<Val,A,B,PC_INT_VAL> {
202 protected:
203 using LinBin<Val,A,B,PC_INT_VAL>::x0;
204 using LinBin<Val,A,B,PC_INT_VAL>::x1;
205 using LinBin<Val,A,B,PC_INT_VAL>::c;
206
208 NqBin(Space& home, NqBin& p);
210 NqBin(Home home, A x0, B x1, Val c);
211 public:
213 NqBin(Space& home, Propagator& p, A x0, B x1, Val c);
215 virtual Actor* copy(Space& home);
217 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
219 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
221 static ExecStatus post(Home home, A x0, B x1, Val c);
222 };
223
236 template<class Val, class A, class B>
237 class LqBin : public LinBin<Val,A,B,PC_INT_BND> {
238 protected:
239 using LinBin<Val,A,B,PC_INT_BND>::x0;
240 using LinBin<Val,A,B,PC_INT_BND>::x1;
241 using LinBin<Val,A,B,PC_INT_BND>::c;
242
244 LqBin(Space& home, LqBin& p);
246 LqBin(Home home, A x0, B x1, Val c);
247 public:
249 LqBin(Space& home, Propagator& p, A x0, B x1, Val c);
251 virtual Actor* copy(Space& home);
253 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
255 static ExecStatus post(Home home, A x0, B x1, Val c);
256 };
257
270 template<class Val, class A, class B>
271 class GqBin : public LinBin<Val,A,B,PC_INT_BND> {
272 protected:
273 using LinBin<Val,A,B,PC_INT_BND>::x0;
274 using LinBin<Val,A,B,PC_INT_BND>::x1;
275 using LinBin<Val,A,B,PC_INT_BND>::c;
276
278 GqBin(Space& home, GqBin& p);
280 GqBin(Home home, A x0, B x1, Val c);
281 public:
283 GqBin(Space& home, Propagator& p, A x0, B x1, Val c);
285 virtual Actor* copy(Space& home);
287 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
289 static ExecStatus post(Home home, A x0, B x1, Val c);
290 };
291
304 template<class Val, class A, class B, ReifyMode rm>
305 class ReLqBin : public ReLinBin<Val,A,B,PC_INT_BND,BoolView> {
306 protected:
311
315 ReLqBin(Home home, A x0, B x1, Val c, BoolView b);
316 public:
318 virtual Actor* copy(Space& home);
320 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
322 static ExecStatus post(Home home, A x0, B x1, Val c, BoolView b);
323 };
324
325}}}
326
328
329namespace Gecode { namespace Int { namespace Linear {
330
331 /*
332 * Ternary propagators
333 *
334 */
335
345 template<class Val, class A, class B, class C, PropCond pc>
346 class LinTer : public Propagator {
347 protected:
349 A x0;
351 B x1;
353 C x2;
357 LinTer(Space& home, LinTer& p);
359 LinTer(Home home, A x0, B x1, C x2, Val c);
361 LinTer(Space& home, Propagator& p, A x0, B x1, C x2, Val c);
362 public:
364 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
366 virtual void reschedule(Space& home);
368 virtual size_t dispose(Space& home);
369 };
370
383 template<class Val, class A, class B, class C>
384 class EqTer : public LinTer<Val,A,B,C,PC_INT_BND> {
385 protected:
386 using LinTer<Val,A,B,C,PC_INT_BND>::x0;
387 using LinTer<Val,A,B,C,PC_INT_BND>::x1;
388 using LinTer<Val,A,B,C,PC_INT_BND>::x2;
389 using LinTer<Val,A,B,C,PC_INT_BND>::c;
390
392 EqTer(Space& home, EqTer& p);
394 EqTer(Home home, A x0, B x1, C x2, Val c);
395 public:
397 EqTer(Space& home, Propagator& p, A x0, B x1, C x2, Val c);
399 virtual Actor* copy(Space& home);
401 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
403 static ExecStatus post(Home home, A x0, B x1, C x2, Val c);
404 };
405
418 template<class Val, class A, class B, class C>
419 class NqTer : public LinTer<Val,A,B,C,PC_INT_VAL> {
420 protected:
421 using LinTer<Val,A,B,C,PC_INT_VAL>::x0;
422 using LinTer<Val,A,B,C,PC_INT_VAL>::x1;
423 using LinTer<Val,A,B,C,PC_INT_VAL>::x2;
424 using LinTer<Val,A,B,C,PC_INT_VAL>::c;
425
427 NqTer(Space& home, NqTer& p);
429 NqTer(Home home, A x0, B x1, C x2, Val c);
430 public:
432 NqTer(Space& home, Propagator& p, A x0, B x1, C x2, Val c);
434 virtual Actor* copy(Space& home);
436 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
438 static ExecStatus post(Home home, A x0, B x1, C x2, Val c);
439 };
440
453 template<class Val, class A, class B, class C>
454 class LqTer : public LinTer<Val,A,B,C,PC_INT_BND> {
455 protected:
456 using LinTer<Val,A,B,C,PC_INT_BND>::x0;
457 using LinTer<Val,A,B,C,PC_INT_BND>::x1;
458 using LinTer<Val,A,B,C,PC_INT_BND>::x2;
459 using LinTer<Val,A,B,C,PC_INT_BND>::c;
460
462 LqTer(Space& home, LqTer& p);
464 LqTer(Home home, A x0, B x1, C x2, Val c);
465 public:
467 LqTer(Space& home, Propagator& p, A x0, B x1, C x2, Val c);
469 virtual Actor* copy(Space& home);
471 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
473 static ExecStatus post(Home home, A x0, B x1, C x2, Val c);
474 };
475
476}}}
477
479
480namespace Gecode { namespace Int { namespace Linear {
481
482 /*
483 * n-ary propagators
484 *
485 */
486
496 template<class Val, class P, class N, PropCond pc>
497 class Lin : public Propagator {
498 protected:
505
507 Lin(Space& home, Lin<Val,P,N,pc>& p);
510 public:
512 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
514 virtual void reschedule(Space& home);
516 virtual size_t dispose(Space& home);
517 };
518
528 template<class Val, class P, class N, PropCond pc, class Ctrl>
529 class ReLin : public Lin<Val,P,N,pc> {
530 protected:
531 using Lin<Val,P,N,pc>::x;
532 using Lin<Val,P,N,pc>::y;
534 Ctrl b;
536 ReLin(Space& home, ReLin& p);
538 ReLin(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, Ctrl b);
539 public:
541 virtual void reschedule(Space& home);
543 virtual size_t dispose(Space& home);
544 };
545
551 template<class Val, class View>
553 Val& c, Val& sl, Val& su);
554
560 template<class Val, class View>
562 Val& c, Val& sl, Val& su);
563
576 template<class Val, class P, class N>
577 class Eq : public Lin<Val,P,N,PC_INT_BND> {
578 protected:
579 using Lin<Val,P,N,PC_INT_BND>::x;
580 using Lin<Val,P,N,PC_INT_BND>::y;
581 using Lin<Val,P,N,PC_INT_BND>::c;
582
584 Eq(Space& home, Eq& p);
585 public:
587 Eq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
589 virtual Actor* copy(Space& home);
591 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
593 static ExecStatus
595 };
596
607 template<class Val, class View>
608 class DomEq
609 : public Lin<Val,View,View,PC_INT_DOM> {
610 protected:
614
616 DomEq(Space& home, DomEq& p);
617 public:
621 virtual Actor* copy(Space& home);
628 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
630 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
632 static ExecStatus
634 };
635
648 template<class Val, class P, class N, class Ctrl, ReifyMode rm>
649 class ReEq : public ReLin<Val,P,N,PC_INT_BND,Ctrl> {
650 protected:
651 using ReLin<Val,P,N,PC_INT_BND,Ctrl>::x;
652 using ReLin<Val,P,N,PC_INT_BND,Ctrl>::y;
653 using ReLin<Val,P,N,PC_INT_BND,Ctrl>::c;
654 using ReLin<Val,P,N,PC_INT_BND,Ctrl>::b;
655
657 ReEq(Space& home, ReEq& p);
658 public:
660 ReEq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, Ctrl b);
662 virtual Actor* copy(Space& home);
664 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
666 static ExecStatus
667 post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, Ctrl b);
668 };
669
682 template<class Val, class P, class N>
683 class Nq : public Lin<Val,P,N,PC_INT_VAL> {
684 protected:
685 using Lin<Val,P,N,PC_INT_VAL>::x;
686 using Lin<Val,P,N,PC_INT_VAL>::y;
687 using Lin<Val,P,N,PC_INT_VAL>::c;
688
690 Nq(Space& home, Nq& p);
691 public:
693 Nq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
695 virtual Actor* copy(Space& home);
697 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
699 static ExecStatus
701 };
702
715 template<class Val, class P, class N>
716 class Lq : public Lin<Val,P,N,PC_INT_BND> {
717 protected:
718 using Lin<Val,P,N,PC_INT_BND>::x;
719 using Lin<Val,P,N,PC_INT_BND>::y;
720 using Lin<Val,P,N,PC_INT_BND>::c;
721
723 Lq(Space& home, Lq& p);
724 public:
726 Lq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
728 virtual Actor* copy(Space& home);
730 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
732 static ExecStatus
734 };
735
748 template<class Val, class P, class N, ReifyMode rm>
749 class ReLq : public ReLin<Val,P,N,PC_INT_BND,BoolView> {
750 protected:
751 using ReLin<Val,P,N,PC_INT_BND,BoolView>::x;
752 using ReLin<Val,P,N,PC_INT_BND,BoolView>::y;
753 using ReLin<Val,P,N,PC_INT_BND,BoolView>::c;
754 using ReLin<Val,P,N,PC_INT_BND,BoolView>::b;
755
757 ReLq(Space& home, ReLq& p);
758 public:
762 virtual Actor* copy(Space& home);
764 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
766 static ExecStatus
768 };
769
770}}}
771
774
775namespace Gecode { namespace Int { namespace Linear {
776
777 /*
778 * Boolean linear propagators
779 *
780 */
781
786 template<class VX>
787 class LinBoolInt : public Propagator {
788 protected:
794 int n_as;
796 int n_hs;
798 int c;
800 void normalize(void);
802 LinBoolInt(Space& home, LinBoolInt& p);
804 LinBoolInt(Home home, ViewArray<VX>& x, int n_s, int c);
805 public:
807 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
809 virtual size_t dispose(Space& home);
810 };
811
818 template<class VX>
819 class EqBoolInt : public LinBoolInt<VX> {
820 protected:
821 using LinBoolInt<VX>::co;
822 using LinBoolInt<VX>::x;
823 using LinBoolInt<VX>::n_as;
824 using LinBoolInt<VX>::n_hs;
825 using LinBoolInt<VX>::c;
826 using LinBoolInt<VX>::disabled;
828 EqBoolInt(Space& home, EqBoolInt& p);
830 EqBoolInt(Home home, ViewArray<VX>& x, int c);
831 public:
833 virtual Actor* copy(Space& home);
835 virtual void reschedule(Space& home);
837 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
839 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
841 static ExecStatus post(Home home, ViewArray<VX>& x, int c);
842 };
843
850 template<class VX>
851 class GqBoolInt : public LinBoolInt<VX> {
852 protected:
853 using LinBoolInt<VX>::co;
854 using LinBoolInt<VX>::x;
855 using LinBoolInt<VX>::n_as;
856 using LinBoolInt<VX>::n_hs;
857 using LinBoolInt<VX>::c;
858 using LinBoolInt<VX>::disabled;
860 GqBoolInt(Space& home, GqBoolInt& p);
862 GqBoolInt(Home home, ViewArray<VX>& x, int c);
863 public:
865 virtual Actor* copy(Space& home);
867 virtual void reschedule(Space& home);
869 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
871 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
873 static ExecStatus post(Home home, ViewArray<VX>& x, int c);
874 };
875
882 template<class VX>
883 class NqBoolInt : public BinaryPropagator<VX,PC_INT_VAL> {
884 protected:
890 int c;
892 bool resubscribe(Space& home, VX& y);
894 NqBoolInt(Home home, ViewArray<VX>& b, int c);
896 NqBoolInt(Space& home, NqBoolInt<VX>& p);
897 public:
899 virtual Actor* copy(Space& home);
901 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
903 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
905 static ExecStatus post(Home home, ViewArray<VX>& b, int c);
907 virtual size_t dispose(Space& home);
908 };
909
910
915 template<class VX, class VB>
916 class ReLinBoolInt : public Propagator {
917 protected:
923 int n_s;
925 int c;
927 VB b;
929 void normalize(void);
933 ReLinBoolInt(Home home, ViewArray<VX>& x, int c, VB b);
934 public:
936 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
938 virtual size_t dispose(Space& home);
939 };
940
941
945 template<class BV>
947
954 template<class VX, class VB, ReifyMode rm>
955 class ReGqBoolInt : public ReLinBoolInt<VX,VB> {
956 protected:
957 using ReLinBoolInt<VX,VB>::co;
958 using ReLinBoolInt<VX,VB>::x;
959 using ReLinBoolInt<VX,VB>::c;
960 using ReLinBoolInt<VX,VB>::b;
961 using ReLinBoolInt<VX,VB>::n_s;
962 using ReLinBoolInt<VX,VB>::normalize;
964 ReGqBoolInt(Space& home, ReGqBoolInt& p);
966 ReGqBoolInt(Home home, ViewArray<VX>& x, int c, VB b);
967 public:
969 virtual Actor* copy(Space& home);
971 virtual void reschedule(Space& home);
973 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
975 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
977 static ExecStatus post(Home home, ViewArray<VX>& x, int c, VB b);
978 };
979
986 template<class VX, class VB, ReifyMode rm>
987 class ReEqBoolInt : public ReLinBoolInt<VX,VB> {
988 protected:
989 using ReLinBoolInt<VX,VB>::co;
990 using ReLinBoolInt<VX,VB>::x;
991 using ReLinBoolInt<VX,VB>::c;
992 using ReLinBoolInt<VX,VB>::b;
993 using ReLinBoolInt<VX,VB>::n_s;
994 using ReLinBoolInt<VX,VB>::normalize;
996 ReEqBoolInt(Space& home, ReEqBoolInt& p);
998 ReEqBoolInt(Home home, ViewArray<VX>& x, int c, VB b);
999 public:
1001 virtual Actor* copy(Space& home);
1003 virtual void reschedule(Space& home);
1005 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
1007 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1009 static ExecStatus post(Home home, ViewArray<VX>& x, int c, VB b);
1010 };
1011
1012}}}
1013
1015
1016namespace Gecode { namespace Int { namespace Linear {
1017
1022 template<class XV, class YV>
1023 class LinBoolView : public Propagator {
1024 protected:
1028 YV y;
1030 int c;
1032 LinBoolView(Space& home, LinBoolView& p);
1034 LinBoolView(Home home, ViewArray<XV>& x, YV y, int c);
1035 public:
1037 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
1039 virtual void reschedule(Space& home);
1041 virtual size_t dispose(Space& home);
1042 };
1043
1044
1051 template<class XV, class YV>
1052 class EqBoolView : public LinBoolView<XV,YV> {
1053 protected:
1054 using LinBoolView<XV,YV>::x;
1055 using LinBoolView<XV,YV>::y;
1056 using LinBoolView<XV,YV>::c;
1057
1059 EqBoolView(Space& home, EqBoolView& p);
1061 EqBoolView(Home home, ViewArray<XV>& x, YV y, int c);
1062 public:
1064 virtual Actor* copy(Space& home);
1066 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1068 static ExecStatus post(Home home, ViewArray<XV>& x, YV y, int c);
1069 };
1070
1077 template<class XV, class YV>
1078 class NqBoolView : public LinBoolView<XV,YV> {
1079 protected:
1080 using LinBoolView<XV,YV>::x;
1081 using LinBoolView<XV,YV>::y;
1082 using LinBoolView<XV,YV>::c;
1083
1085 NqBoolView(Space& home, NqBoolView& p);
1087 NqBoolView(Home home, ViewArray<XV>& x, YV y, int c);
1088 public:
1090 virtual Actor* copy(Space& home);
1092 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1094 static ExecStatus post(Home home, ViewArray<XV>& x, YV y, int c);
1095 };
1096
1103 template<class XV, class YV>
1104 class GqBoolView : public LinBoolView<XV,YV> {
1105 protected:
1106 using LinBoolView<XV,YV>::x;
1107 using LinBoolView<XV,YV>::y;
1108 using LinBoolView<XV,YV>::c;
1109
1111 GqBoolView(Space& home, GqBoolView& p);
1113 GqBoolView(Home home, ViewArray<XV>& x, YV y, int c);
1114 public:
1116 virtual Actor* copy(Space& home);
1118 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1120 static ExecStatus post(Home home, ViewArray<XV>& x, YV y, int c);
1121 };
1122
1123}}}
1124
1126
1127namespace Gecode { namespace Int { namespace Linear {
1128
1131 public:
1133 int a;
1136 };
1137
1140 private:
1142 ScaleBool* _fst;
1144 ScaleBool* _lst;
1145 public:
1147 ScaleBoolArray(void);
1149 ScaleBoolArray(Space& home, int n);
1151 void subscribe(Space& home, Propagator& p);
1153 void cancel(Space& home, Propagator& p);
1155 void reschedule(Space& home, Propagator& p);
1157 void update(Space& home, ScaleBoolArray& sba);
1159 ScaleBool* fst(void) const;
1161 ScaleBool* lst(void) const;
1163 void fst(ScaleBool* f);
1165 void lst(ScaleBool* l);
1167 bool empty(void) const;
1169 int size(void) const;
1170 private:
1172 class ScaleDec {
1173 public:
1174 bool
1175 operator ()(const ScaleBool& x, const ScaleBool& y);
1176 };
1177 public:
1179 void sort(void);
1180 };
1181
1182
1185 public:
1187 EmptyScaleBoolArray(void);
1189 EmptyScaleBoolArray(Space& home, int n);
1191 void subscribe(Space& home, Propagator& p);
1193 void cancel(Space& home, Propagator& p);
1195 void reschedule(Space& home, Propagator& p);
1197 void update(Space& home, EmptyScaleBoolArray& esba);
1199 ScaleBool* fst(void) const;
1201 ScaleBool* lst(void) const;
1203 void fst(ScaleBool* f);
1205 void lst(ScaleBool* l);
1207 bool empty(void) const;
1209 int size(void) const;
1211 void sort(void);
1212 };
1213
1214
1219 template<class SBAP, class SBAN, class VX, PropCond pcx>
1220 class LinBoolScale : public Propagator {
1221 protected:
1223 SBAP p;
1225 SBAN n;
1227 VX x;
1229 int c;
1230 public:
1232 LinBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
1234 LinBoolScale(Space& home, Propagator& pr,
1235 SBAP& p, SBAN& n, VX x, int c);
1237 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
1239 virtual void reschedule(Space& home);
1241 virtual size_t dispose(Space& home);
1242 };
1243
1250 template<class SBAP, class SBAN, class VX>
1251 class EqBoolScale : public LinBoolScale<SBAP,SBAN,VX,PC_INT_BND> {
1252 protected:
1253 using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::p;
1254 using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::n;
1255 using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::x;
1256 using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::c;
1257 public:
1259 EqBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
1261 EqBoolScale(Space& home, Propagator& pr,
1262 SBAP& p, SBAN& n, VX x, int c);
1264 virtual Actor* copy(Space& home);
1266 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1268 static ExecStatus post(Home home, SBAP& p, SBAN& n, VX x, int c);
1269 };
1270
1277 template<class SBAP, class SBAN, class VX>
1278 class LqBoolScale : public LinBoolScale<SBAP,SBAN,VX,PC_INT_BND> {
1279 protected:
1280 using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::p;
1281 using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::n;
1282 using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::x;
1283 using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::c;
1284 public:
1286 LqBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
1288 LqBoolScale(Space& home, Propagator& pr,
1289 SBAP& p, SBAN& n, VX x, int c);
1291 virtual Actor* copy(Space& home);
1293 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1295 static ExecStatus post(Home home, SBAP& p, SBAN& n, VX x, int c);
1296 };
1297
1304 template<class SBAP, class SBAN, class VX>
1305 class NqBoolScale : public LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL> {
1306 protected:
1307 using LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL>::p;
1308 using LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL>::n;
1309 using LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL>::x;
1310 using LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL>::c;
1311 public:
1313 NqBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
1315 NqBoolScale(Space& home, Propagator& pr,
1316 SBAP& p, SBAN& n, VX x, int c);
1318 virtual Actor* copy(Space& home);
1320 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1322 static ExecStatus post(Home home, SBAP& p, SBAN& n, VX x, int c);
1323 };
1324
1325}}}
1326
1328
1329namespace Gecode { namespace Int { namespace Linear {
1330
1335 template<class View>
1336 class Term {
1337 public:
1339 int a;
1343 int p;
1344 };
1345
1360 template<class View>
1361 void estimate(Term<View>* t, int n, int c,
1362 int& l, int& u);
1363
1392 post(Home home, Term<IntView>* t, int n, IntRelType irt, int c,
1394
1425 post(Home home, Term<IntView>* t, int n, IntRelType irt, int c, Reify r,
1427
1456 post(Home home, Term<BoolView>* t, int n, IntRelType irt, int c,
1458
1488 post(Home home, Term<BoolView>* t, int n, IntRelType irt, int c, Reify r,
1490
1520 post(Home home, Term<BoolView>* t, int n, IntRelType irt, IntView y, int c=0,
1522
1552 post(Home home, Term<BoolView>* t, int n, IntRelType irt, IntView y,
1554
1555}}}
1556
1558
1559#endif
1560
1561// STATISTICS: int-prop
BinaryPropagator(Space &home, BinaryPropagator &p)
Generic domain change information to be supplied to advisors.
Definition core.hpp:204
Home class for posting propagators
Definition core.hpp:856
Boolean view for Boolean variables.
Definition view.hpp:1380
Integer view for integer variables.
Definition view.hpp:129
Traits for Boolean negation view.
Definition linear.hh:946
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition int-dom.hpp:382
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-dom.hpp:376
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-dom.hpp:391
DomEq(Space &home, DomEq &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, Val c)
Post propagator for .
Definition int-dom.hpp:362
ScaleBool * fst(void) const
Return pointer to first element.
void sort(void)
Sort array in decreasing order of coefficients.
int size(void) const
Return number of elements.
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
void update(Space &home, EmptyScaleBoolArray &esba)
Update sba during copying.
void cancel(Space &home, Propagator &p)
Cancel propagator p.
EmptyScaleBoolArray(void)
Default constructor.
bool empty(void) const
Test whether array is empty.
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
ScaleBool * lst(void) const
Return pointer after last element.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:188
EqBin(Space &home, EqBin &p)
Constructor for cloning p.
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition int-bin.hpp:147
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:166
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:297
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition bool-int.hpp:254
virtual void reschedule(Space &home)
Schedule function.
Definition bool-int.hpp:289
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Definition bool-int.hpp:321
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-int.hpp:248
EqBoolInt(Space &home, EqBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:243
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
virtual Actor * copy(Space &home)
Create copy during cloning.
EqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
EqBoolView(Space &home, EqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
Definition bool-view.hpp:91
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
EqTer(Space &home, EqTer &p)
Constructor for cloning p.
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Definition int-ter.hpp:104
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-ter.hpp:147
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-ter.hpp:123
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:381
Eq(Space &home, Eq &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:394
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Definition int-nary.hpp:280
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition int-bin.hpp:378
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:391
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:403
GqBin(Space &home, GqBin &p)
Constructor for cloning p.
virtual void reschedule(Space &home)
Schedule function.
Definition bool-int.hpp:172
GqBoolInt(Space &home, GqBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:120
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-int.hpp:125
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition bool-int.hpp:131
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:180
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Definition bool-int.hpp:198
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
GqBoolView(Space &home, GqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-bin.hpp:80
Val c
Value of type Val.
Definition linear.hh:72
B x1
View of type B.
Definition linear.hh:70
A x0
View of type A.
Definition linear.hh:68
virtual void reschedule(Space &home)
Schedule function.
Definition int-bin.hpp:73
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
Definition int-bin.hpp:67
LinBin(Space &home, LinBin &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
Definition bool-int.hpp:94
int n_as
Number of active subscriptions.
Definition linear.hh:794
void normalize(void)
Normalize by removing unused views.
Definition bool-int.hpp:58
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition bool-int.hpp:100
Council< Advisor > co
Council for managing single advisor.
Definition linear.hh:790
int n_hs
Number of views that have or had subscriptions.
Definition linear.hh:796
ViewArray< VX > x
Boolean views.
Definition linear.hh:792
LinBoolInt(Space &home, LinBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:84
LinBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
SBAP p
Positive Boolean views with coefficients on left-hand side.
Definition linear.hh:1223
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
VX x
Integer view on right-hand side.
Definition linear.hh:1227
int c
Integer constant on right-hand side.
Definition linear.hh:1229
virtual void reschedule(Space &home)
Schedule function.
SBAN n
Negative Boolean views with coefficients on left-hand side.
Definition linear.hh:1225
LinBoolView(Space &home, LinBoolView &p)
Constructor for cloning p.
Definition bool-view.hpp:60
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition bool-view.hpp:51
virtual void reschedule(Space &home)
Schedule function.
Definition bool-view.hpp:74
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Definition bool-view.hpp:68
YV y
View to compare number of assigned Boolean views to.
Definition linear.hh:1028
ViewArray< XV > x
Boolean views.
Definition linear.hh:1026
int c
Righthandside (constant part from Boolean views assigned to 1)
Definition linear.hh:1030
C x2
View of type C.
Definition linear.hh:353
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low ternary)
Definition int-ter.hpp:70
LinTer(Space &home, LinTer &p)
Constructor for cloning p.
A x0
View of type A.
Definition linear.hh:349
Val c
Value of type Val.
Definition linear.hh:355
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-ter.hpp:84
virtual void reschedule(Space &home)
Schedule function.
Definition int-ter.hpp:76
B x1
View of type B.
Definition linear.hh:351
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-nary.hpp:90
Lin(Space &home, Lin< Val, P, N, pc > &p)
Constructor for cloning p.
Definition int-nary.hpp:69
ViewArray< N > y
Array of negative views.
Definition linear.hh:502
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Definition int-nary.hpp:77
ViewArray< P > x
Array of positive views.
Definition linear.hh:500
virtual void reschedule(Space &home)
Schedule function.
Definition int-nary.hpp:83
Val c
Constant value.
Definition linear.hh:504
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition int-bin.hpp:332
LqBin(Space &home, LqBin &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:345
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:357
LqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-ter.hpp:252
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Definition int-ter.hpp:239
LqTer(Space &home, LqTer &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-ter.hpp:265
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:732
Lq(Space &home, Lq &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Definition int-nary.hpp:631
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:745
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:309
NqBin(Space &home, NqBin &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low unary)
Definition int-bin.hpp:303
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition int-bin.hpp:276
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:289
static ExecStatus post(Home home, ViewArray< VX > &b, int c)
Post propagator for .
Definition bool-int.hpp:394
bool resubscribe(Space &home, VX &y)
Update subscription.
Definition bool-int.hpp:433
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Definition bool-int.hpp:427
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition bool-int.hpp:368
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:458
NqBoolInt(Home home, ViewArray< VX > &b, int c)
Constructor for posting.
Definition bool-int.hpp:358
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition bool-int.hpp:421
ViewArray< VX > x
Views not yet subscribed to.
Definition linear.hh:888
virtual Actor * copy(Space &home)
Create copy during cloning.
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
NqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NqBoolView(Space &home, NqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-ter.hpp:196
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Definition int-ter.hpp:183
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-ter.hpp:209
NqTer(Space &home, NqTer &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:583
Nq(Space &home, Nq &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:596
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Definition int-nary.hpp:482
static ExecStatus post(Home home, A x0, B x1, Val c, Ctrl b)
Post propagator for .
Definition int-bin.hpp:217
ReEqBin(Space &home, ReEqBin &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:237
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:231
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-int.hpp:693
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
Definition bool-int.hpp:744
virtual void reschedule(Space &home)
Schedule function.
Definition bool-int.hpp:712
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:720
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition bool-int.hpp:699
ReEqBoolInt(Space &home, ReEqBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:688
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:438
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, Ctrl b)
Post propagator for .
Definition int-nary.hpp:411
ReEq(Space &home, ReEq &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:432
virtual void reschedule(Space &home)
Schedule function.
Definition bool-int.hpp:602
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
Definition bool-int.hpp:639
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition bool-int.hpp:590
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-int.hpp:584
ReGqBoolInt(Space &home, ReGqBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:579
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:610
Ctrl b
Control view for reification.
Definition linear.hh:107
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-bin.hpp:127
Val c
Value of type Val.
Definition linear.hh:105
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
Definition int-bin.hpp:113
ReLinBin(Space &home, ReLinBin &p)
Constructor for cloning p.
virtual void reschedule(Space &home)
Schedule function.
Definition int-bin.hpp:119
Council< Advisor > co
Council for single advisor.
Definition linear.hh:919
void normalize(void)
Normalize by removing unused views.
Definition bool-int.hpp:505
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
Definition bool-int.hpp:539
int n_s
Number of subscriptions.
Definition linear.hh:923
ReLinBoolInt(Space &home, ReLinBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:518
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition bool-int.hpp:528
ViewArray< VX > x
Views.
Definition linear.hh:921
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-nary.hpp:127
virtual void reschedule(Space &home)
Schedule function.
Definition int-nary.hpp:119
ReLin(Space &home, ReLin &p)
Constructor for cloning p.
Ctrl b
Control view for reification.
Definition linear.hh:534
static ExecStatus post(Home home, A x0, B x1, Val c, BoolView b)
Post propagator for .
Definition int-bin.hpp:424
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:443
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:437
ReLqBin(Space &home, ReLqBin &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, BoolView b)
Post propagator for .
Definition int-nary.hpp:828
ReLq(Space &home, ReLq &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:849
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:855
void cancel(Space &home, Propagator &p)
Cancel propagator p.
void sort(void)
Sort array in decreasing order of coefficients.
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
ScaleBool * lst(void) const
Return pointer after last element.
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
int size(void) const
Return number of elements.
ScaleBool * fst(void) const
Return pointer to first element.
ScaleBoolArray(void)
Default constructor.
bool empty(void) const
Test whether array is empty.
void update(Space &home, ScaleBoolArray &sba)
Update sba during copying.
Coefficient and Boolean view.
Definition linear.hh:1130
int a
Integer coefficient.
Definition linear.hh:1133
BoolView x
Boolean view.
Definition linear.hh:1135
Class for describing linear term .
Definition linear.hh:1336
int a
Coefficient.
Definition linear.hh:1339
int p
Original position in array (for sorting into canonical order)
Definition linear.hh:1343
Propagation cost.
Definition core.hpp:486
Base-class for propagators.
Definition core.hpp:1066
friend class Space
Definition core.hpp:1068
friend class Advisor
Definition core.hpp:1070
friend class Council
Definition core.hpp:1071
bool disabled(void) const
Whether propagator is currently disabled.
Definition core.hpp:3483
ModEventDelta med
A set of modification events (used during propagation)
Definition core.hpp:1077
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3505
Reification specification.
Definition int.hh:891
Computation spaces.
Definition core.hpp:1744
View arrays.
Definition array.hpp:253
#define GECODE_INT_EXPORT
Definition int.hh:81
void post(Home home, Term< IntView > *t, int n, IntRelType irt, int c, IntPropLevel=IPL_DEF)
Post propagator for linear constraint over integers.
Definition int-post.cpp:219
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
IntRelType
Relation types for integers.
Definition int.hh:940
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:989
@ IPL_DEF
Simple propagation levels.
Definition int.hh:991
Linear propagators
void estimate(Term< View > *t, int n, int c, int &l, int &u)
Estimate lower and upper bounds.
Definition post.hpp:41
void bounds_n(ModEventDelta med, ViewArray< View > &y, Val &c, Val &sl, Val &su)
Definition int-nary.hpp:161
void bounds_p(ModEventDelta med, ViewArray< View > &x, Val &c, Val &sl, Val &su)
Definition int-nary.hpp:140
Finite domain integers.
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
Definition var-type.hpp:82
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition var-type.hpp:91
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition var-type.hpp:100
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition set.hh:773
Post propagator for SetVar SetOpType SetVar y
Definition set.hh:773
ExecStatus
Definition core.hpp:472
Post propagator for SetVar x
Definition set.hh:773