Generated on Tue Jan 28 2020 00:00:00 for Gecode by doxygen 1.8.17
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  * Last modified:
14  * $Date: 2016-06-29 17:28:17 +0200 (Wed, 29 Jun 2016) $ by $Author: schulte $
15  * $Revision: 15137 $
16  *
17  * This file is part of Gecode, the generic constraint
18  * development environment:
19  * http://www.gecode.org
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining
22  * a copy of this software and associated documentation files (the
23  * "Software"), to deal in the Software without restriction, including
24  * without limitation the rights to use, copy, modify, merge, publish,
25  * distribute, sublicense, and/or sell copies of the Software, and to
26  * permit persons to whom the Software is furnished to do so, subject to
27  * the following conditions:
28  *
29  * The above copyright notice and this permission notice shall be
30  * included in all copies or substantial portions of the Software.
31  *
32  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39  *
40  */
41 
42 #ifndef __GECODE_INT_LINEAR_HH__
43 #define __GECODE_INT_LINEAR_HH__
44 
45 #include <gecode/int.hh>
46 
52 namespace Gecode { namespace Int { namespace Linear {
53 
54  /*
55  * Binary propagators
56  *
57  */
58 
68  template<class Val, class A, class B, PropCond pc>
69  class LinBin : public Propagator {
70  protected:
72  A x0;
74  B x1;
76  Val c;
78  LinBin(Space& home, bool share, LinBin& p);
80  LinBin(Space& home, bool share, Propagator& p, A x0, B x1, Val c);
82  LinBin(Home home, A x0, B x1, Val c);
83  public:
85  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
87  virtual void reschedule(Space& home);
89  virtual size_t dispose(Space& home);
90  };
91 
101  template<class Val, class A, class B, PropCond pc, class Ctrl>
102  class ReLinBin : public Propagator {
103  protected:
105  A x0;
107  B x1;
109  Val c;
111  Ctrl b;
113  ReLinBin(Space& home, bool share, ReLinBin& p);
115  ReLinBin(Home home, A x0, B x1, Val c, Ctrl b);
116  public:
118  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
120  virtual void reschedule(Space& home);
122  virtual size_t dispose(Space& home);
123  };
124 
137  template<class Val, class A, class B>
138  class EqBin : public LinBin<Val,A,B,PC_INT_BND> {
139  protected:
143 
145  EqBin(Space& home, bool share, EqBin& p);
147  EqBin(Home home, A x0, B x1, Val c);
148  public:
150  EqBin(Space& home, bool share, Propagator& p, A x0, B x1, Val c);
152  virtual Actor* copy(Space& home, bool share);
154  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
156  static ExecStatus post(Home home, A x0, B x1, Val c);
157  };
158 
171  template<class Val, class A, class B, class Ctrl, ReifyMode rm>
172  class ReEqBin : public ReLinBin<Val,A,B,PC_INT_BND,Ctrl> {
173  protected:
178 
180  ReEqBin(Space& home, bool share, ReEqBin& p);
182  ReEqBin(Home home,A,B,Val,Ctrl);
183  public:
185  virtual Actor* copy(Space& home, bool share);
187  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
189  static ExecStatus post(Home home, A x0, B x1, Val c, Ctrl b);
190  };
191 
204  template<class Val, class A, class B>
205  class NqBin : public LinBin<Val,A,B,PC_INT_VAL> {
206  protected:
210 
212  NqBin(Space& home, bool share, NqBin& p);
214  NqBin(Home home, A x0, B x1, Val c);
215  public:
217  NqBin(Space& home, bool share, Propagator& p, A x0, B x1, Val c);
219  virtual Actor* copy(Space& home, bool share);
221  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
223  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
225  static ExecStatus post(Home home, A x0, B x1, Val c);
226  };
227 
240  template<class Val, class A, class B>
241  class LqBin : public LinBin<Val,A,B,PC_INT_BND> {
242  protected:
246 
248  LqBin(Space& home, bool share, LqBin& p);
250  LqBin(Home home, A x0, B x1, Val c);
251  public:
253  LqBin(Space& home, bool share, Propagator& p, A x0, B x1, Val c);
255  virtual Actor* copy(Space& home, bool share);
257  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
259  static ExecStatus post(Home home, A x0, B x1, Val c);
260  };
261 
274  template<class Val, class A, class B>
275  class GqBin : public LinBin<Val,A,B,PC_INT_BND> {
276  protected:
280 
282  GqBin(Space& home, bool share, GqBin& p);
284  GqBin(Home home, A x0, B x1, Val c);
285  public:
287  GqBin(Space& home, bool share, Propagator& p, A x0, B x1, Val c);
289  virtual Actor* copy(Space& home, bool share);
291  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
293  static ExecStatus post(Home home, A x0, B x1, Val c);
294  };
295 
308  template<class Val, class A, class B, ReifyMode rm>
309  class ReLqBin : public ReLinBin<Val,A,B,PC_INT_BND,BoolView> {
310  protected:
315 
317  ReLqBin(Space& home, bool share, ReLqBin& p);
319  ReLqBin(Home home, A x0, B x1, Val c, BoolView b);
320  public:
322  virtual Actor* copy(Space& home, bool share);
324  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
326  static ExecStatus post(Home home, A x0, B x1, Val c, BoolView b);
327  };
328 
329 }}}
330 
332 
333 namespace Gecode { namespace Int { namespace Linear {
334 
335  /*
336  * Ternary propagators
337  *
338  */
339 
349  template<class Val, class A, class B, class C, PropCond pc>
350  class LinTer : public Propagator {
351  protected:
353  A x0;
355  B x1;
357  C x2;
359  Val c;
361  LinTer(Space& home, bool share, LinTer& p);
363  LinTer(Home home, A x0, B x1, C x2, Val c);
365  LinTer(Space& home, bool share, Propagator& p, A x0, B x1, C x2, Val c);
366  public:
368  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
370  virtual void reschedule(Space& home);
372  virtual size_t dispose(Space& home);
373  };
374 
387  template<class Val, class A, class B, class C>
388  class EqTer : public LinTer<Val,A,B,C,PC_INT_BND> {
389  protected:
394 
396  EqTer(Space& home, bool share, EqTer& p);
398  EqTer(Home home, A x0, B x1, C x2, Val c);
399  public:
401  EqTer(Space& home, bool share, Propagator& p, A x0, B x1, C x2, Val c);
403  virtual Actor* copy(Space& home, bool share);
405  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
407  static ExecStatus post(Home home, A x0, B x1, C x2, Val c);
408  };
409 
422  template<class Val, class A, class B, class C>
423  class NqTer : public LinTer<Val,A,B,C,PC_INT_VAL> {
424  protected:
429 
431  NqTer(Space& home, bool share, NqTer& p);
433  NqTer(Home home, A x0, B x1, C x2, Val c);
434  public:
436  NqTer(Space& home, bool share, Propagator& p, A x0, B x1, C x2, Val c);
438  virtual Actor* copy(Space& home, bool share);
440  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
442  static ExecStatus post(Home home, A x0, B x1, C x2, Val c);
443  };
444 
457  template<class Val, class A, class B, class C>
458  class LqTer : public LinTer<Val,A,B,C,PC_INT_BND> {
459  protected:
464 
466  LqTer(Space& home, bool share, LqTer& p);
468  LqTer(Home home, A x0, B x1, C x2, Val c);
469  public:
471  LqTer(Space& home, bool share, Propagator& p, A x0, B x1, C x2, Val c);
473  virtual Actor* copy(Space& home, bool share);
475  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
477  static ExecStatus post(Home home, A x0, B x1, C x2, Val c);
478  };
479 
480 }}}
481 
483 
484 namespace Gecode { namespace Int { namespace Linear {
485 
486  /*
487  * n-ary propagators
488  *
489  */
490 
500  template<class Val, class P, class N, PropCond pc>
501  class Lin : public Propagator {
502  protected:
508  Val c;
509 
511  Lin(Space& home, bool share, Lin<Val,P,N,pc>& p);
513  Lin(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
514  public:
516  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
518  virtual void reschedule(Space& home);
520  virtual size_t dispose(Space& home);
521  };
522 
532  template<class Val, class P, class N, PropCond pc, class Ctrl>
533  class ReLin : public Lin<Val,P,N,pc> {
534  protected:
535  using Lin<Val,P,N,pc>::x;
536  using Lin<Val,P,N,pc>::y;
538  Ctrl b;
540  ReLin(Space& home, bool share, ReLin& p);
542  ReLin(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, Ctrl b);
543  public:
545  virtual void reschedule(Space& home);
547  virtual size_t dispose(Space& home);
548  };
549 
555  template<class Val, class View>
557  Val& c, Val& sl, Val& su);
558 
564  template<class Val, class View>
566  Val& c, Val& sl, Val& su);
567 
580  template<class Val, class P, class N>
581  class Eq : public Lin<Val,P,N,PC_INT_BND> {
582  protected:
586 
588  Eq(Space& home, bool share, Eq& p);
589  public:
591  Eq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
593  virtual Actor* copy(Space& home, bool share);
595  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
597  static ExecStatus
598  post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
599  };
600 
611  template<class Val, class View>
612  class DomEq
613  : public Lin<Val,View,View,PC_INT_DOM> {
614  protected:
618 
620  DomEq(Space& home, bool share, DomEq& p);
621  public:
623  DomEq(Home home, ViewArray<View>& x, ViewArray<View>& y, Val c);
625  virtual Actor* copy(Space& home, bool share);
632  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
634  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
636  static ExecStatus
637  post(Home home, ViewArray<View>& x, ViewArray<View>& y, Val c);
638  };
639 
652  template<class Val, class P, class N, class Ctrl, ReifyMode rm>
653  class ReEq : public ReLin<Val,P,N,PC_INT_BND,Ctrl> {
654  protected:
659 
661  ReEq(Space& home, bool share, ReEq& p);
662  public:
664  ReEq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, Ctrl b);
666  virtual Actor* copy(Space& home, bool share);
668  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
670  static ExecStatus
671  post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, Ctrl b);
672  };
673 
686  template<class Val, class P, class N>
687  class Nq : public Lin<Val,P,N,PC_INT_VAL> {
688  protected:
692 
694  Nq(Space& home, bool share, Nq& p);
695  public:
697  Nq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
699  virtual Actor* copy(Space& home, bool share);
701  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
703  static ExecStatus
704  post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
705  };
706 
719  template<class Val, class P, class N>
720  class Lq : public Lin<Val,P,N,PC_INT_BND> {
721  protected:
725 
727  Lq(Space& home, bool share, Lq& p);
728  public:
730  Lq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
732  virtual Actor* copy(Space& home, bool share);
734  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
736  static ExecStatus
737  post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
738  };
739 
752  template<class Val, class P, class N, ReifyMode rm>
753  class ReLq : public ReLin<Val,P,N,PC_INT_BND,BoolView> {
754  protected:
759 
761  ReLq(Space& home, bool share, ReLq& p);
762  public:
764  ReLq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, BoolView b);
766  virtual Actor* copy(Space& home, bool share);
768  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
770  static ExecStatus
771  post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, BoolView b);
772  };
773 
774 }}}
775 
778 
779 namespace Gecode { namespace Int { namespace Linear {
780 
781  /*
782  * Boolean linear propagators
783  *
784  */
785 
790  template<class VX>
791  class LinBoolInt : public Propagator {
792  protected:
798  int n_as;
800  int n_hs;
802  int c;
804  void normalize(void);
806  LinBoolInt(Space& home, bool share, LinBoolInt& p);
808  LinBoolInt(Home home, ViewArray<VX>& x, int n_s, int c);
809  public:
811  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
813  virtual size_t dispose(Space& home);
814  };
815 
822  template<class VX>
823  class EqBoolInt : public LinBoolInt<VX> {
824  protected:
825  using LinBoolInt<VX>::co;
826  using LinBoolInt<VX>::x;
827  using LinBoolInt<VX>::n_as;
828  using LinBoolInt<VX>::n_hs;
829  using LinBoolInt<VX>::c;
832  EqBoolInt(Space& home, bool share, EqBoolInt& p);
834  EqBoolInt(Home home, ViewArray<VX>& x, int c);
835  public:
837  virtual Actor* copy(Space& home, bool share);
839  virtual void reschedule(Space& home);
841  virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
843  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
845  static ExecStatus post(Home home, ViewArray<VX>& x, int c);
846  };
847 
854  template<class VX>
855  class GqBoolInt : public LinBoolInt<VX> {
856  protected:
857  using LinBoolInt<VX>::co;
858  using LinBoolInt<VX>::x;
859  using LinBoolInt<VX>::n_as;
860  using LinBoolInt<VX>::n_hs;
861  using LinBoolInt<VX>::c;
864  GqBoolInt(Space& home, bool share, GqBoolInt& p);
866  GqBoolInt(Home home, ViewArray<VX>& x, int c);
867  public:
869  virtual Actor* copy(Space& home, bool share);
871  virtual void reschedule(Space& home);
873  virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
875  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
877  static ExecStatus post(Home home, ViewArray<VX>& x, int c);
878  };
879 
886  template<class VX>
887  class NqBoolInt : public BinaryPropagator<VX,PC_INT_VAL> {
888  protected:
894  int c;
896  bool resubscribe(Space& home, VX& y);
898  NqBoolInt(Home home, ViewArray<VX>& b, int c);
900  NqBoolInt(Space& home, bool share, NqBoolInt<VX>& p);
901  public:
903  virtual Actor* copy(Space& home, bool share);
905  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
907  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
909  static ExecStatus post(Home home, ViewArray<VX>& b, int c);
911  virtual size_t dispose(Space& home);
912  };
913 
914 
919  template<class VX, class VB>
920  class ReLinBoolInt : public Propagator {
921  protected:
927  int n_s;
929  int c;
931  VB b;
933  void normalize(void);
935  ReLinBoolInt(Space& home, bool share, ReLinBoolInt& p);
937  ReLinBoolInt(Home home, ViewArray<VX>& x, int c, VB b);
938  public:
940  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
942  virtual size_t dispose(Space& home);
943  };
944 
945 
949  template<class BV>
950  class BoolNegTraits {};
951 
958  template<class VX, class VB, ReifyMode rm>
959  class ReGqBoolInt : public ReLinBoolInt<VX,VB> {
960  protected:
968  ReGqBoolInt(Space& home, bool share, ReGqBoolInt& p);
970  ReGqBoolInt(Home home, ViewArray<VX>& x, int c, VB b);
971  public:
973  virtual Actor* copy(Space& home, bool share);
975  virtual void reschedule(Space& home);
977  virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
979  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
981  static ExecStatus post(Home home, ViewArray<VX>& x, int c, VB b);
982  };
983 
990  template<class VX, class VB, ReifyMode rm>
991  class ReEqBoolInt : public ReLinBoolInt<VX,VB> {
992  protected:
1000  ReEqBoolInt(Space& home, bool share, ReEqBoolInt& p);
1002  ReEqBoolInt(Home home, ViewArray<VX>& x, int c, VB b);
1003  public:
1005  virtual Actor* copy(Space& home, bool share);
1007  virtual void reschedule(Space& home);
1009  virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
1011  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1013  static ExecStatus post(Home home, ViewArray<VX>& x, int c, VB b);
1014  };
1015 
1016 }}}
1017 
1019 
1020 namespace Gecode { namespace Int { namespace Linear {
1021 
1026  template<class XV, class YV>
1027  class LinBoolView : public Propagator {
1028  protected:
1032  YV y;
1034  int c;
1036  LinBoolView(Space& home, bool share, LinBoolView& p);
1038  LinBoolView(Home home, ViewArray<XV>& x, YV y, int c);
1039  public:
1041  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
1043  virtual void reschedule(Space& home);
1045  virtual size_t dispose(Space& home);
1046  };
1047 
1048 
1055  template<class XV, class YV>
1056  class EqBoolView : public LinBoolView<XV,YV> {
1057  protected:
1058  using LinBoolView<XV,YV>::x;
1059  using LinBoolView<XV,YV>::y;
1060  using LinBoolView<XV,YV>::c;
1061 
1063  EqBoolView(Space& home, bool share, EqBoolView& p);
1065  EqBoolView(Home home, ViewArray<XV>& x, YV y, int c);
1066  public:
1068  virtual Actor* copy(Space& home, bool share);
1070  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1072  static ExecStatus post(Home home, ViewArray<XV>& x, YV y, int c);
1073  };
1074 
1081  template<class XV, class YV>
1082  class NqBoolView : public LinBoolView<XV,YV> {
1083  protected:
1084  using LinBoolView<XV,YV>::x;
1085  using LinBoolView<XV,YV>::y;
1086  using LinBoolView<XV,YV>::c;
1087 
1089  NqBoolView(Space& home, bool share, NqBoolView& p);
1091  NqBoolView(Home home, ViewArray<XV>& x, YV y, int c);
1092  public:
1094  virtual Actor* copy(Space& home, bool share);
1096  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1098  static ExecStatus post(Home home, ViewArray<XV>& x, YV y, int c);
1099  };
1100 
1107  template<class XV, class YV>
1108  class GqBoolView : public LinBoolView<XV,YV> {
1109  protected:
1110  using LinBoolView<XV,YV>::x;
1111  using LinBoolView<XV,YV>::y;
1112  using LinBoolView<XV,YV>::c;
1113 
1115  GqBoolView(Space& home, bool share, GqBoolView& p);
1117  GqBoolView(Home home, ViewArray<XV>& x, YV y, int c);
1118  public:
1120  virtual Actor* copy(Space& home, bool share);
1122  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1124  static ExecStatus post(Home home, ViewArray<XV>& x, YV y, int c);
1125  };
1126 
1127 }}}
1128 
1130 
1131 namespace Gecode { namespace Int { namespace Linear {
1132 
1134  class ScaleBool {
1135  public:
1137  int a;
1140  };
1141 
1144  private:
1146  ScaleBool* _fst;
1148  ScaleBool* _lst;
1149  public:
1151  ScaleBoolArray(void);
1153  ScaleBoolArray(Space& home, int n);
1155  void subscribe(Space& home, Propagator& p);
1157  void cancel(Space& home, Propagator& p);
1159  void reschedule(Space& home, Propagator& p);
1161  void update(Space& home, bool share, ScaleBoolArray& sba);
1163  ScaleBool* fst(void) const;
1165  ScaleBool* lst(void) const;
1167  void fst(ScaleBool* f);
1169  void lst(ScaleBool* l);
1171  bool empty(void) const;
1173  int size(void) const;
1174  private:
1176  class ScaleDec {
1177  public:
1178  bool
1179  operator ()(const ScaleBool& x, const ScaleBool& y);
1180  };
1181  public:
1183  void sort(void);
1184  };
1185 
1186 
1189  public:
1191  EmptyScaleBoolArray(void);
1193  EmptyScaleBoolArray(Space& home, int n);
1195  void subscribe(Space& home, Propagator& p);
1197  void cancel(Space& home, Propagator& p);
1199  void reschedule(Space& home, Propagator& p);
1201  void update(Space& home, bool share, EmptyScaleBoolArray& esba);
1203  ScaleBool* fst(void) const;
1205  ScaleBool* lst(void) const;
1207  void fst(ScaleBool* f);
1209  void lst(ScaleBool* l);
1211  bool empty(void) const;
1213  int size(void) const;
1215  void sort(void);
1216  };
1217 
1218 
1223  template<class SBAP, class SBAN, class VX, PropCond pcx>
1224  class LinBoolScale : public Propagator {
1225  protected:
1227  SBAP p;
1229  SBAN n;
1231  VX x;
1233  int c;
1234  public:
1236  LinBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
1238  LinBoolScale(Space& home, bool share, Propagator& pr,
1239  SBAP& p, SBAN& n, VX x, int c);
1241  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
1243  virtual void reschedule(Space& home);
1245  virtual size_t dispose(Space& home);
1246  };
1247 
1254  template<class SBAP, class SBAN, class VX>
1255  class EqBoolScale : public LinBoolScale<SBAP,SBAN,VX,PC_INT_BND> {
1256  protected:
1261  public:
1263  EqBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
1265  EqBoolScale(Space& home, bool share, Propagator& pr,
1266  SBAP& p, SBAN& n, VX x, int c);
1268  virtual Actor* copy(Space& home, bool share);
1270  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1272  static ExecStatus post(Home home, SBAP& p, SBAN& n, VX x, int c);
1273  };
1274 
1281  template<class SBAP, class SBAN, class VX>
1282  class LqBoolScale : public LinBoolScale<SBAP,SBAN,VX,PC_INT_BND> {
1283  protected:
1288  public:
1290  LqBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
1292  LqBoolScale(Space& home, bool share, Propagator& pr,
1293  SBAP& p, SBAN& n, VX x, int c);
1295  virtual Actor* copy(Space& home, bool share);
1297  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1299  static ExecStatus post(Home home, SBAP& p, SBAN& n, VX x, int c);
1300  };
1301 
1308  template<class SBAP, class SBAN, class VX>
1309  class NqBoolScale : public LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL> {
1310  protected:
1315  public:
1317  NqBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
1319  NqBoolScale(Space& home, bool share, Propagator& pr,
1320  SBAP& p, SBAN& n, VX x, int c);
1322  virtual Actor* copy(Space& home, bool share);
1324  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
1326  static ExecStatus post(Home home, SBAP& p, SBAN& n, VX x, int c);
1327  };
1328 
1329 }}}
1330 
1332 
1333 namespace Gecode { namespace Int { namespace Linear {
1334 
1339  template<class View>
1340  class Term {
1341  public:
1343  int a;
1345  View x;
1346  };
1347 
1362  template<class View>
1363  void estimate(Term<View>* t, int n, int c,
1364  int& l, int& u);
1365 
1393  GECODE_INT_EXPORT void
1394  post(Home home, Term<IntView>* t, int n, IntRelType irt, int c,
1396 
1426  GECODE_INT_EXPORT void
1427  post(Home home, Term<IntView>* t, int n, IntRelType irt, int c, Reify r,
1429 
1457  GECODE_INT_EXPORT void
1458  post(Home home, Term<BoolView>* t, int n, IntRelType irt, int c,
1460 
1489  GECODE_INT_EXPORT void
1490  post(Home home, Term<BoolView>* t, int n, IntRelType irt, int c, Reify r,
1492 
1521  GECODE_INT_EXPORT void
1522  post(Home home, Term<BoolView>* t, int n, IntRelType irt, IntView y, int c=0,
1524 
1553  GECODE_INT_EXPORT void
1554  post(Home home, Term<BoolView>* t, int n, IntRelType irt, IntView y,
1556 
1557 }}}
1558 
1559 #include <gecode/int/linear/post.hpp>
1560 
1561 #endif
1562 
1563 // STATISTICS: int-prop
static ExecStatus post(Home home, A x0, B x1, Val c, Ctrl b)
Post propagator for .
Definition: int-bin.hpp:221
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Definition: int-nary.hpp:487
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-bin.hpp:235
ReLin(Space &home, bool share, ReLin &p)
Constructor for cloning p.
Definition: int-nary.hpp:116
Propagator for bounds consistent binary linear less or equal
Definition: linear.hh:241
Post propagator for SetVar x
Definition: set.hh:784
int a
Integer coefficient.
Definition: linear.hh:1137
IntRelType
Relation types for integers.
Definition: int.hh:906
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-dom.hpp:395
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
Definition: bool-scale.hpp:402
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
Definition: bool-view.hpp:95
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: bool-view.hpp:55
Propagator for reified integer equal to Boolean sum (cardinality)
Definition: linear.hh:991
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-ter.hpp:201
Baseclass for integer Boolean sum.
Definition: linear.hh:791
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:784
Propagator for integer disequal to Boolean sum (cardinality)
Definition: linear.hh:887
Propagator for reified integer less or equal to Boolean sum (cardinality)
Definition: linear.hh:959
ReGqBoolInt(Space &home, bool share, ReGqBoolInt &p)
Constructor for cloning p.
Definition: bool-int.hpp:584
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Definition: int-nary.hpp:284
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-bin.hpp:441
ScaleBool * fst(void) const
Return pointer to first element.
Definition: bool-scale.hpp:138
Class for describing linear term .
Definition: linear.hh:1340
int c
Righthandside.
Definition: linear.hh:894
View x
View.
Definition: linear.hh:1345
NqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
Definition: bool-scale.hpp:582
LqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
Definition: bool-scale.hpp:428
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Definition: bool-scale.hpp:171
Lq(Space &home, bool share, Lq &p)
Constructor for cloning p.
Definition: int-nary.hpp:651
virtual void reschedule(Space &home)
Schedule function.
Definition: int-nary.hpp:87
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
Definition: bool-view.hpp:181
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Definition: bool-view.hpp:72
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-int.hpp:129
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
Definition: bool-scale.hpp:557
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-bin.hpp:192
ScaleBool * lst(void) const
Return pointer after last element.
Definition: bool-scale.hpp:89
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Definition: int-ter.hpp:244
bool empty(void) const
Test whether array is empty.
Definition: bool-scale.hpp:146
ReLinBoolInt(Space &home, bool share, ReLinBoolInt &p)
Constructor for cloning p.
Definition: bool-int.hpp:522
void cancel(Space &home, Propagator &p)
Cancel propagator p.
Definition: bool-scale.hpp:132
Propagator for bounds consistent n-ary linear less or equal
Definition: linear.hh:720
void bounds_n(ModEventDelta med, ViewArray< View > &y, Val &c, Val &sl, Val &su)
Definition: int-nary.hpp:165
ReEqBoolInt(Space &home, bool share, ReEqBoolInt &p)
Constructor for cloning p.
Definition: bool-int.hpp:694
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: int-nary.hpp:94
virtual void reschedule(Space &home)
Schedule function.
Definition: bool-int.hpp:608
Base-class for ternary linear propagators.
Definition: linear.hh:350
Propagator for inequality to Boolean sum with coefficients
Definition: linear.hh:1282
int c
Righthandside.
Definition: linear.hh:802
Base-class for n-ary linear propagators.
Definition: linear.hh:501
void cancel(Space &home, Propagator &p)
Cancel propagator p.
Definition: bool-scale.hpp:61
C x2
View of type C.
Definition: linear.hh:357
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-ter.hpp:128
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-ter.hpp:270
NodeType t
Type of node.
Definition: bool-expr.cpp:234
int c
Integer constant on right-hand side.
Definition: linear.hh:1233
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-bin.hpp:293
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-scale.hpp:443
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: int-ter.hpp:89
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-scale.hpp:625
GqBoolInt(Space &home, bool share, GqBoolInt &p)
Constructor for cloning p.
Definition: bool-int.hpp:124
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:955
Computation spaces.
Definition: core.hpp:1748
NqBin(Space &home, bool share, NqBin &p)
Constructor for cloning p.
Definition: int-bin.hpp:288
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: bool-int.hpp:104
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition: int-bin.hpp:280
Base-class for both propagators and branchers.
Definition: core.hpp:696
LinBoolInt(Space &home, bool share, LinBoolInt &p)
Constructor for cloning p.
Definition: bool-int.hpp:88
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-nary.hpp:437
LqBin(Space &home, bool share, LqBin &p)
Constructor for cloning p.
Definition: int-bin.hpp:344
Base-class for binary linear propagators.
Definition: linear.hh:69
EqBoolView(Space &home, bool share, EqBoolView &p)
Constructor for cloning p.
Definition: bool-view.hpp:128
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-ter.hpp:152
virtual void reschedule(Space &home)
Schedule function.
Definition: int-bin.hpp:77
void sort(void)
Sort array in decreasing order of coefficients.
Definition: bool-scale.hpp:115
SBAN n
Negative Boolean views with coefficients on left-hand side.
Definition: linear.hh:1229
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-int.hpp:252
void sort(void)
Sort array in decreasing order of coefficients.
Definition: bool-scale.hpp:150
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: int-nary.hpp:131
ViewArray< N > y
Array of negative views.
Definition: linear.hh:506
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-nary.hpp:854
EqBoolInt(Space &home, bool share, EqBoolInt &p)
Constructor for cloning p.
Definition: bool-int.hpp:247
Propagator for integer less or equal to Boolean sum (cardinality)
Definition: linear.hh:855
Propagator for integer equal to Boolean sum (cardinality)
Definition: linear.hh:823
virtual void reschedule(Space &home)
Schedule function.
Definition: bool-int.hpp:719
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-bin.hpp:395
ReLq(Space &home, bool share, ReLq &p)
Constructor for cloning p.
Definition: int-nary.hpp:849
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: bool-int.hpp:706
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, Val c)
Post propagator for .
Definition: int-dom.hpp:366
ViewArray< VX > x
Boolean views.
Definition: linear.hh:796
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: int-bin.hpp:131
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
Definition: bool-int.hpp:751
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-nary.hpp:443
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: bool-scale.hpp:186
static ExecStatus post(Home home, ViewArray< VX > &b, int c)
Post propagator for .
Definition: bool-int.hpp:398
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-nary.hpp:601
Propagator for bounds consistent ternary linear disquality
Definition: linear.hh:423
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-bin.hpp:313
EmptyScaleBoolArray(void)
Default constructor.
Definition: bool-scale.hpp:126
Boolean view for Boolean variables.
Definition: view.hpp:1315
Gecode toplevel namespace
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: bool-int.hpp:533
Propagator for bounds consistent n-ary linear equality
Definition: linear.hh:581
Base-class for propagators.
Definition: core.hpp:1092
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: bool-int.hpp:425
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-int.hpp:462
NqBoolView(Space &home, bool share, NqBoolView &p)
Constructor for cloning p.
Definition: bool-view.hpp:214
Base-class for reified binary linear propagators.
Definition: linear.hh:102
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
Definition: bool-int.hpp:544
ReEq(Space &home, bool share, ReEq &p)
Constructor for cloning p.
Definition: int-nary.hpp:431
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-view.hpp:302
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-nary.hpp:385
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-view.hpp:133
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-nary.hpp:398
Ctrl b
Control view for reification.
Definition: linear.hh:538
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Definition: bool-int.hpp:325
Traits for Boolean negation view.
Definition: linear.hh:950
Generic domain change information to be supplied to advisors.
Definition: core.hpp:281
Propagator for equality to Boolean sum (cardinality)
Definition: linear.hh:1056
Reification specification.
Definition: int.hh:857
#define GECODE_INT_EXPORT
Definition: int.hh:81
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-scale.hpp:471
B x1
View of type B.
Definition: linear.hh:74
Propagator for bounds consistent n-ary linear disequality
Definition: linear.hh:687
Home class for posting propagators
Definition: core.hpp:922
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
ReLqBin(Space &home, bool share, ReLqBin &p)
Constructor for cloning p.
Definition: int-bin.hpp:436
ReEqBin(Space &home, bool share, ReEqBin &p)
Constructor for cloning p.
Definition: int-bin.hpp:229
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
ReLinBin(Space &home, bool share, ReLinBin &p)
Constructor for cloning p.
Definition: int-bin.hpp:107
Propagator for equality to Boolean sum with coefficients
Definition: linear.hh:1255
EqTer(Space &home, bool share, EqTer &p)
Constructor for cloning p.
Definition: int-ter.hpp:117
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition: int-bin.hpp:336
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition: int-bin.hpp:382
Propagator for greater or equal to Boolean sum (cardinality)
Definition: linear.hh:1108
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-view.hpp:219
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
Definition: int-bin.hpp:117
int c
Righthandside (constant part from Boolean views assigned to 1)
Definition: linear.hh:1034
ViewArray< VX > x
Views.
Definition: linear.hh:925
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-int.hpp:727
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Definition: bool-int.hpp:431
void update(Space &home, bool share, EmptyScaleBoolArray &esba)
Update sba during copying.
Definition: bool-scale.hpp:136
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Definition: int-nary.hpp:81
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-int.hpp:590
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-ter.hpp:257
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:784
LinBoolView(Space &home, bool share, LinBoolView &p)
Constructor for cloning p.
Definition: bool-view.hpp:64
A x0
View of type A.
Definition: linear.hh:353
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
Definition: bool-scale.hpp:56
Nq(Space &home, bool share, Nq &p)
Constructor for cloning p.
Definition: int-nary.hpp:502
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
Definition: bool-scale.hpp:134
B x1
View of type B.
Definition: linear.hh:107
Lin(Space &home, bool share, Lin< Val, P, N, pc > &p)
Constructor for cloning p.
Definition: int-nary.hpp:73
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Definition: int-ter.hpp:109
ModEventDelta med
A set of modification events (used during propagation)
Definition: core.hpp:1103
YV y
View to compare number of assigned Boolean views to.
Definition: linear.hh:1032
Array of scale Boolean views.
Definition: linear.hh:1143
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: bool-int.hpp:135
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-bin.hpp:407
Propagator for reified bounds consistent n-ary linear less or equal
Definition: linear.hh:753
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
Definition: bool-scale.hpp:690
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, Ctrl b)
Post propagator for .
Definition: int-nary.hpp:415
ViewArray< P > x
Array of positive views.
Definition: linear.hh:504
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-nary.hpp:588
Baseclass for reified integer Boolean sum.
Definition: linear.hh:920
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-int.hpp:184
virtual void reschedule(Space &home)
Schedule function.
Definition: bool-view.hpp:78
Base class for linear Boolean constraints with coefficients.
Definition: linear.hh:1224
Propagator for bounds consistent binary linear disequality
Definition: linear.hh:205
LqTer(Space &home, bool share, LqTer &p)
Constructor for cloning p.
Definition: int-ter.hpp:252
ScaleBoolArray(void)
Default constructor.
Definition: bool-scale.hpp:45
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-nary.hpp:860
EqBin(Space &home, bool share, EqBin &p)
Constructor for cloning p.
Definition: int-bin.hpp:159
Base-class for Boolean linear propagators.
Definition: linear.hh:1027
LinBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
Definition: bool-scale.hpp:160
Eq(Space &home, bool share, Eq &p)
Constructor for cloning p.
Definition: int-nary.hpp:299
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-scale.hpp:256
NqBoolInt(Home home, ViewArray< VX > &b, int c)
Constructor for posting.
Definition: bool-int.hpp:362
virtual void reschedule(Space &home)
Schedule function.
Definition: int-bin.hpp:123
Propagator for reified bounds consistent binary linear equality
Definition: linear.hh:172
Propagator for domain consistent n-ary linear equality
Definition: linear.hh:612
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-bin.hpp:349
VX x
Integer view on right-hand side.
Definition: linear.hh:1231
int n_s
Number of subscriptions.
Definition: linear.hh:927
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Definition: bool-int.hpp:202
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-view.hpp:225
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, BoolView b)
Post propagator for .
Definition: int-nary.hpp:833
static ExecStatus post(Home home, A x0, B x1, Val c, BoolView b)
Post propagator for .
Definition: int-bin.hpp:428
Propagator for bounds consistent ternary linear equality
Definition: linear.hh:388
virtual void reschedule(Space &home)
Schedule function.
Definition: int-nary.hpp:123
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low unary)
Definition: int-bin.hpp:307
void normalize(void)
Normalize by removing unused views.
Definition: bool-int.hpp:509
int size(void) const
Return number of elements.
Definition: bool-scale.hpp:105
void bounds_p(ModEventDelta med, ViewArray< View > &x, Val &c, Val &sl, Val &su)
Definition: int-nary.hpp:144
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: bool-int.hpp:258
Propagator for bounds consistent binary linear greater or equal
Definition: linear.hh:275
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-nary.hpp:750
void normalize(void)
Normalize by removing unused views.
Definition: bool-int.hpp:62
int n_as
Number of active subscriptions.
Definition: linear.hh:798
Val c
Value of type Val.
Definition: linear.hh:359
void update(Space &home, bool share, ScaleBoolArray &sba)
Update sba during copying.
Definition: bool-scale.hpp:71
Propagation cost.
Definition: core.hpp:554
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
Definition: bool-view.hpp:264
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-view.hpp:139
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: int-bin.hpp:84
Val c
Constant value.
Definition: linear.hh:508
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: bool-int.hpp:596
Council of advisors
Definition: core.hpp:232
Val c
Value of type Val.
Definition: linear.hh:109
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
Definition: int-bin.hpp:71
EqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
Definition: bool-scale.hpp:213
@ IPL_DEF
Simple propagation levels.
Definition: int.hh:957
B x1
View of type B.
Definition: linear.hh:355
Propagator for disequality to Boolean sum with coefficients
Definition: linear.hh:1309
ScaleBool * lst(void) const
Return pointer after last element.
Definition: bool-scale.hpp:140
int size(void) const
Return number of elements.
Definition: bool-scale.hpp:148
Gecode::IntSet d(v, 7)
int n_hs
Number of views that have or had subscriptions.
Definition: linear.hh:800
Base-class for advisors.
Definition: core.hpp:1294
NqTer(Space &home, bool share, NqTer &p)
Constructor for cloning p.
Definition: int-ter.hpp:196
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Definition: int-nary.hpp:636
bool empty(void) const
Test whether array is empty.
Definition: bool-scale.hpp:101
Base-class for reified n-ary linear propagators.
Definition: linear.hh:533
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-int.hpp:616
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: bool-int.hpp:372
Integer view for integer variables.
Definition: view.hpp:129
LinBin(Space &home, bool share, LinBin &p)
Constructor for cloning p.
Definition: int-bin.hpp:54
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-bin.hpp:447
Val c
Value of type Val.
Definition: linear.hh:76
Propagator for reified bounds consistent n-ary linear equality
Definition: linear.hh:653
ViewArray< XV > x
Boolean views.
Definition: linear.hh:1030
bool resubscribe(Space &home, VX &y)
Update subscription.
Definition: bool-int.hpp:437
A x0
View of type A.
Definition: linear.hh:105
Ctrl b
Control view for reification.
Definition: linear.hh:111
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Definition: int-ter.hpp:188
GqBin(Space &home, bool share, GqBin &p)
Constructor for cloning p.
Definition: int-bin.hpp:390
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-scale.hpp:228
void estimate(Term< View > *t, int n, int c, int &l, int &u)
Estimate lower and upper bounds.
Definition: post.hpp:45
Propagator for bounds consistent ternary linear less or equal
Definition: linear.hh:458
int a
Coefficient.
Definition: linear.hh:1343
Propagator for reified bounds consistent binary linear less or equal
Definition: linear.hh:309
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-int.hpp:700
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-bin.hpp:170
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bool-int.hpp:301
Empty array of scale Boolean views.
Definition: linear.hh:1188
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-bin.hpp:361
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
Definition: bool-int.hpp:98
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-dom.hpp:380
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
Definition: bool-scale.hpp:66
Propagator for bounds consistent binary linear equality
Definition: linear.hh:138
Council< Advisor > co
Council for single advisor.
Definition: linear.hh:923
LinTer(Space &home, bool share, LinTer &p)
Constructor for cloning p.
Definition: int-ter.hpp:55
void post(Home home, Term< BoolView > *t, int n, IntRelType irt, IntView x, int c, IntPropLevel)
Post propagator for linear constraint over Booleans.
Definition: bool-post.cpp:593
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
VB b
Control variable.
Definition: linear.hh:931
virtual void reschedule(Space &home)
Schedule function.
Definition: bool-scale.hpp:178
Gecode::FloatVal c(-8, 8)
virtual void reschedule(Space &home)
Schedule function.
Definition: int-ter.hpp:81
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
Definition: bool-scale.hpp:130
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: int-nary.hpp:737
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
ScaleBool * fst(void) const
Return pointer to first element.
Definition: bool-scale.hpp:85
Coefficient and Boolean view.
Definition: linear.hh:1134
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-scale.hpp:597
Binary propagator.
Definition: propagator.hpp:89
DomEq(Space &home, bool share, DomEq &p)
Constructor for cloning p.
Definition: int-dom.hpp:375
int ModEventDelta
Modification event deltas.
Definition: core.hpp:169
A x0
View of type A.
Definition: linear.hh:72
Council< Advisor > co
Council for managing single advisor.
Definition: linear.hh:794
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Definition: bool-view.hpp:296
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low ternary)
Definition: int-ter.hpp:75
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
Definition: bool-int.hpp:645
int c
Righthandside.
Definition: linear.hh:929
BoolView x
Boolean view.
Definition: linear.hh:1139
ViewArray< VX > x
Views not yet subscribed to.
Definition: linear.hh:892
virtual void reschedule(Space &home)
Schedule function.
Definition: bool-int.hpp:176
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: int-dom.hpp:386
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-bin.hpp:241
Propagator for disequality to Boolean sum (cardinality)
Definition: linear.hh:1082
virtual void reschedule(Space &home)
Schedule function.
Definition: bool-int.hpp:293
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: int-ter.hpp:214
GqBoolView(Space &home, bool share, GqBoolView &p)
Constructor for cloning p.
Definition: bool-view.hpp:291
ExecStatus
Definition: core.hpp:540
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition: int-bin.hpp:151
SBAP p
Positive Boolean views with coefficients on left-hand side.
Definition: linear.hh:1227