Generated on Sat Aug 25 2012 03:32:47 for Gecode by doxygen 1.8.1.2
view.hpp
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  *
6  * Copyright:
7  * Christian Schulte, 2005
8  *
9  * Last modified:
10  * $Date: 2011-09-28 22:50:49 +1000 (Wed, 28 Sep 2011) $ by $Author: tack $
11  * $Revision: 12418 $
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 #include <iostream>
39 
40 #if (-17 / 7) == -2
41 #define GECODE_INT_RND_TWDS_ZERO 1
42 #else
43 #define GECODE_INT_RND_TWDS_ZERO 0
44 #endif
45 
46 namespace Gecode { namespace Int {
47 
59  template<class View>
60  class ViewRanges {
61  public:
63 
64 
65  ViewRanges(void);
67  ViewRanges(const View& x);
69  void init(const View& x);
71 
73 
74 
75  bool operator ()(void) const;
77  void operator ++(void);
79 
81 
82 
83  int min(void) const;
85  int max(void) const;
87  unsigned int width(void) const;
89  };
90 
99  template<class View>
100  class ViewValues : public Iter::Ranges::ToValues<ViewRanges<View> > {
101  public:
103 
104 
105  ViewValues(void);
107  ViewValues(const View& x);
109  void init(const View& x);
111  };
112 
113 }}
114 
115 #include <gecode/int/view/iter.hpp>
116 
117 namespace Gecode { namespace Int {
118 
135  class IntView : public VarImpView<IntVar> {
136  protected:
137  using VarImpView<IntVar>::x;
138  public:
140 
141 
142  IntView(void);
144  IntView(const IntVar& y);
146  IntView(IntVarImp* y);
148 
150 
151 
152  int min(void) const;
154  int max(void) const;
156  int med(void) const;
158  int val(void) const;
159 
161  unsigned int size(void) const;
163  unsigned int width(void) const;
165  unsigned int regret_min(void) const;
167  unsigned int regret_max(void) const;
169 
171 
172 
173  bool range(void) const;
174 
176  bool in(int n) const;
178  bool in(double n) const;
180 
182 
183 
184  ModEvent lq(Space& home, int n);
186  ModEvent lq(Space& home, double n);
187 
189  ModEvent le(Space& home, int n);
191  ModEvent le(Space& home, double n);
192 
194  ModEvent gq(Space& home, int n);
196  ModEvent gq(Space& home, double n);
197 
199  ModEvent gr(Space& home, int n);
201  ModEvent gr(Space& home, double n);
203  ModEvent nq(Space& home, int n);
205  ModEvent nq(Space& home, double n);
206 
208  ModEvent eq(Space& home, int n);
210  ModEvent eq(Space& home, double n);
212 
228 
229  template<class I>
230  ModEvent narrow_r(Space& home, I& i, bool depends=true);
232  template<class I>
233  ModEvent inter_r(Space& home, I& i, bool depends=true);
235  template<class I>
236  ModEvent minus_r(Space& home, I& i, bool depends=true);
238  template<class I>
239  ModEvent narrow_v(Space& home, I& i, bool depends=true);
241  template<class I>
242  ModEvent inter_v(Space& home, I& i, bool depends=true);
244  template<class I>
245  ModEvent minus_v(Space& home, I& i, bool depends=true);
247 
249 
250 
251  int min(const Delta& d) const;
253  int max(const Delta& d) const;
255  bool any(const Delta& d) const;
257 
259 
260 
261  static ModEventDelta med(ModEvent me);
263  };
264 
269  template<class Char, class Traits>
270  std::basic_ostream<Char,Traits>&
271  operator <<(std::basic_ostream<Char,Traits>& os, const IntView& x);
272 
273 
281  class MinusView : public DerivedView<IntView> {
282  protected:
284  public:
286 
287 
288  MinusView(void);
290  explicit MinusView(const IntView& y);
292 
294 
295 
296  int min(void) const;
298  int max(void) const;
300  int med(void) const;
302  int val(void) const;
303 
305  unsigned int size(void) const;
307  unsigned int width(void) const;
309  unsigned int regret_min(void) const;
311  unsigned int regret_max(void) const;
313 
315 
316 
317  bool range(void) const;
318 
320  bool in(int n) const;
322  bool in(double n) const;
324 
326 
327 
328  ModEvent lq(Space& home, int n);
330  ModEvent lq(Space& home, double n);
332  ModEvent le(Space& home, int n);
334  ModEvent le(Space& home, double n);
336  ModEvent gq(Space& home, int n);
338  ModEvent gq(Space& home, double n);
340  ModEvent gr(Space& home, int n);
342  ModEvent gr(Space& home, double n);
344  ModEvent nq(Space& home, int n);
346  ModEvent nq(Space& home, double n);
348  ModEvent eq(Space& home, int n);
350  ModEvent eq(Space& home, double n);
352 
368 
369  template<class I>
370  ModEvent narrow_r(Space& home, I& i, bool depends=true);
372  template<class I>
373  ModEvent inter_r(Space& home, I& i, bool depends=true);
375  template<class I>
376  ModEvent minus_r(Space& home, I& i, bool depends=true);
378  template<class I>
379  ModEvent narrow_v(Space& home, I& i, bool depends=true);
381  template<class I>
382  ModEvent inter_v(Space& home, I& i, bool depends=true);
384  template<class I>
385  ModEvent minus_v(Space& home, I& i, bool depends=true);
387 
389 
390 
391  static ModEventDelta med(ModEvent me);
393 
395 
396 
397  int min(const Delta& d) const;
399  int max(const Delta& d) const;
401  bool any(const Delta& d) const;
403  };
404 
409  template<class Char, class Traits>
410  std::basic_ostream<Char,Traits>&
411  operator <<(std::basic_ostream<Char,Traits>& os, const MinusView& x);
412 
413 
422  class OffsetView : public DerivedView<IntView> {
423  protected:
425  int c;
427  public:
429 
430 
431  OffsetView(void);
433  OffsetView(const IntView& y, int c);
435 
437 
438 
439  int offset(void) const;
441  void offset(int n);
443  int min(void) const;
445  int max(void) const;
447  int med(void) const;
449  int val(void) const;
450 
452  unsigned int size(void) const;
454  unsigned int width(void) const;
456  unsigned int regret_min(void) const;
458  unsigned int regret_max(void) const;
460 
462 
463 
464  bool range(void) const;
465 
467  bool in(int n) const;
469  bool in(double n) const;
471 
473 
474 
475  ModEvent lq(Space& home, int n);
477  ModEvent lq(Space& home, double n);
479  ModEvent le(Space& home, int n);
481  ModEvent le(Space& home, double n);
483  ModEvent gq(Space& home, int n);
485  ModEvent gq(Space& home, double n);
487  ModEvent gr(Space& home, int n);
489  ModEvent gr(Space& home, double n);
491  ModEvent nq(Space& home, int n);
493  ModEvent nq(Space& home, double n);
495  ModEvent eq(Space& home, int n);
497  ModEvent eq(Space& home, double n);
499 
515 
516  template<class I>
517  ModEvent narrow_r(Space& home, I& i, bool depends=true);
519  template<class I>
520  ModEvent inter_r(Space& home, I& i, bool depends=true);
522  template<class I>
523  ModEvent minus_r(Space& home, I& i, bool depends=true);
525  template<class I>
526  ModEvent narrow_v(Space& home, I& i, bool depends=true);
528  template<class I>
529  ModEvent inter_v(Space& home, I& i, bool depends=true);
531  template<class I>
532  ModEvent minus_v(Space& home, I& i, bool depends=true);
534 
536 
537 
538  static ModEventDelta med(ModEvent me);
540 
542 
543 
544  int min(const Delta& d) const;
546  int max(const Delta& d) const;
548  bool any(const Delta& d) const;
550 
552 
553 
554  void update(Space& home, bool share, OffsetView& y);
556  };
557 
562  template<class Char, class Traits>
563  std::basic_ostream<Char,Traits>&
564  operator <<(std::basic_ostream<Char,Traits>& os, const OffsetView& x);
565 
570 
571  bool same(const OffsetView& x, const OffsetView& y);
573  bool before(const OffsetView& x, const OffsetView& y);
575 
579  template<class View>
580  class NoOffset {
581  public:
583  typedef View ViewType;
585  View& operator ()(View& x);
587  void update(const NoOffset&);
589  int offset(void) const;
590  };
591 
592  template<class View>
593  forceinline View&
595  return x;
596  }
597 
598  template<class View>
599  forceinline void
601 
602  template<class View>
603  forceinline int
605  return 0;
606  }
607 
608 
612  class Offset {
613  public:
617  int c;
619  Offset(int off = 0);
623  void update(const Offset& o);
625  int offset(void) const;
626  };
627 
629  Offset::Offset(int off) : c(off) {}
630 
631  forceinline void
632  Offset::update(const Offset& o) { c = o.c; }
633 
634  forceinline int
635  Offset::offset(void) const { return c; }
636 
639  return OffsetView(x,c);
640  }
641 
667  template<class Val, class UnsVal>
668  class ScaleView : public DerivedView<IntView> {
669  protected:
672  int a;
674 
675 
676  Val floor_div(double y) const;
678  Val ceil_div(double y) const;
680  Val exact_div(double y, bool& exact) const;
681 #if GECODE_INT_RND_TWDS_ZERO
682 
683  int floor_div(int y) const;
685  int ceil_div(int y) const;
687  int exact_div(int y, bool& exact) const;
688 #endif
689 
690 
691  public:
693 
694 
695  ScaleView(void);
697  ScaleView(int b, const IntView& y);
699 
701 
702 
703  int scale(void) const;
705  Val min(void) const;
707  Val max(void) const;
709  Val med(void) const;
711  Val val(void) const;
712 
714  UnsVal size(void) const;
716  UnsVal width(void) const;
718  UnsVal regret_min(void) const;
720  UnsVal regret_max(void) const;
722 
724 
725 
726  bool range(void) const;
728  bool in(Val n) const;
730 
732 
733 
734  ModEvent lq(Space& home, Val n);
736  ModEvent le(Space& home, Val n);
738  ModEvent gq(Space& home, Val n);
740  ModEvent gr(Space& home, Val n);
742  ModEvent nq(Space& home, Val n);
744  ModEvent eq(Space& home, Val n);
746 
748 
749 
750  static ModEventDelta med(ModEvent me);
752 
754 
755 
756  Val min(const Delta& d) const;
758  Val max(const Delta& d) const;
760  bool any(const Delta& d) const;
762 
764 
765 
766  void update(Space& home, bool share, ScaleView<Val,UnsVal>& y);
768  };
769 
775 
781 
786  template<class Char, class Traits>
787  std::basic_ostream<Char,Traits>&
788  operator <<(std::basic_ostream<Char,Traits>& os, const IntScaleView& x);
789 
794  template<class Char, class Traits>
795  std::basic_ostream<Char,Traits>&
796  operator <<(std::basic_ostream<Char,Traits>& os, const DoubleScaleView& x);
797 
802 
803  template<class Val, class UnsVal>
804  bool same(const ScaleView<Val,UnsVal>& x, const ScaleView<Val,UnsVal>& y);
806  template<class Val, class UnsVal>
807  bool before(const ScaleView<Val,UnsVal>& x, const ScaleView<Val,UnsVal>& y);
809 
810 
811 
819  class ConstIntView : public ConstView<IntView> {
820  protected:
821  int x;
822  public:
824 
825 
826  ConstIntView(void);
828  ConstIntView(int n);
830 
832 
833 
834  int min(void) const;
836  int max(void) const;
838  int med(void) const;
840  int val(void) const;
841 
843  unsigned int size(void) const;
845  unsigned int width(void) const;
847  unsigned int regret_min(void) const;
849  unsigned int regret_max(void) const;
851 
853 
854 
855  bool range(void) const;
857  bool in(int n) const;
859  bool in(double n) const;
861 
863 
864 
865  ModEvent lq(Space& home, int n);
867  ModEvent lq(Space& home, double n);
869  ModEvent le(Space& home, int n);
871  ModEvent le(Space& home, double n);
873  ModEvent gq(Space& home, int n);
875  ModEvent gq(Space& home, double n);
877  ModEvent gr(Space& home, int n);
879  ModEvent gr(Space& home, double n);
881  ModEvent nq(Space& home, int n);
883  ModEvent nq(Space& home, double n);
885  ModEvent eq(Space& home, int n);
887  ModEvent eq(Space& home, double n);
889 
905 
906  template<class I>
907  ModEvent narrow_r(Space& home, I& i, bool depends=true);
909  template<class I>
910  ModEvent inter_r(Space& home, I& i, bool depends=true);
912  template<class I>
913  ModEvent minus_r(Space& home, I& i, bool depends=true);
915  template<class I>
916  ModEvent narrow_v(Space& home, I& i, bool depends=true);
918  template<class I>
919  ModEvent inter_v(Space& home, I& i, bool depends=true);
921  template<class I>
922  ModEvent minus_v(Space& home, I& i, bool depends=true);
924 
926 
927 
928  int min(const Delta& d) const;
930  int max(const Delta& d) const;
932  bool any(const Delta& d) const;
934 
936 
937 
938  void update(Space& home, bool share, ConstIntView& y);
940  };
941 
946  template<class Char, class Traits>
947  std::basic_ostream<Char,Traits>&
948  operator <<(std::basic_ostream<Char,Traits>& os, const ConstIntView& x);
949 
955 
956  bool same(const ConstIntView& x, const ConstIntView& y);
958  bool before(const ConstIntView& x, const ConstIntView& y);
960 
961 
969  class ZeroIntView : public ConstView<IntView> {
970  public:
972 
973 
974  ZeroIntView(void);
976 
978 
979 
980  int min(void) const;
982  int max(void) const;
984  int med(void) const;
986  int val(void) const;
987 
989  unsigned int size(void) const;
991  unsigned int width(void) const;
993  unsigned int regret_min(void) const;
995  unsigned int regret_max(void) const;
997 
999 
1000 
1001  bool range(void) const;
1003  bool in(int n) const;
1005  bool in(double n) const;
1007 
1009 
1010 
1011  ModEvent lq(Space& home, int n);
1013  ModEvent lq(Space& home, double n);
1015  ModEvent le(Space& home, int n);
1017  ModEvent le(Space& home, double n);
1019  ModEvent gq(Space& home, int n);
1021  ModEvent gq(Space& home, double n);
1023  ModEvent gr(Space& home, int n);
1025  ModEvent gr(Space& home, double n);
1027  ModEvent nq(Space& home, int n);
1029  ModEvent nq(Space& home, double n);
1031  ModEvent eq(Space& home, int n);
1033  ModEvent eq(Space& home, double n);
1035 
1051 
1052  template<class I>
1053  ModEvent narrow_r(Space& home, I& i, bool depends=true);
1055  template<class I>
1056  ModEvent inter_r(Space& home, I& i, bool depends=true);
1058  template<class I>
1059  ModEvent minus_r(Space& home, I& i, bool depends=true);
1061  template<class I>
1062  ModEvent narrow_v(Space& home, I& i, bool depends=true);
1064  template<class I>
1065  ModEvent inter_v(Space& home, I& i, bool depends=true);
1067  template<class I>
1068  ModEvent minus_v(Space& home, I& i, bool depends=true);
1070 
1072 
1073 
1074  int min(const Delta& d) const;
1076  int max(const Delta& d) const;
1078  bool any(const Delta& d) const;
1080  };
1081 
1086  template<class Char, class Traits>
1087  std::basic_ostream<Char,Traits>&
1088  operator <<(std::basic_ostream<Char,Traits>& os, const ZeroIntView& x);
1089 
1095 
1096  bool same(const ZeroIntView& x, const ZeroIntView& y);
1098 
1099  template<class View> class ViewDiffRanges;
1100 
1111  template<class View>
1112  class CachedView : public DerivedView<View> {
1113  friend class ViewDiffRanges<View>;
1114  protected:
1115  using DerivedView<View>::x;
1121  unsigned int _size;
1122  public:
1124 
1125 
1126  CachedView(void);
1128  explicit CachedView(const View& y);
1130 
1132 
1133 
1134  int min(void) const;
1136  int max(void) const;
1138  int med(void) const;
1140  int val(void) const;
1141 
1143  unsigned int size(void) const;
1145  unsigned int width(void) const;
1147  unsigned int regret_min(void) const;
1149  unsigned int regret_max(void) const;
1151 
1153 
1154 
1155  bool range(void) const;
1156 
1158  bool in(int n) const;
1160  bool in(double n) const;
1162 
1164 
1165 
1166  ModEvent lq(Space& home, int n);
1168  ModEvent lq(Space& home, double n);
1170  ModEvent le(Space& home, int n);
1172  ModEvent le(Space& home, double n);
1174  ModEvent gq(Space& home, int n);
1176  ModEvent gq(Space& home, double n);
1178  ModEvent gr(Space& home, int n);
1180  ModEvent gr(Space& home, double n);
1182  ModEvent nq(Space& home, int n);
1184  ModEvent nq(Space& home, double n);
1186  ModEvent eq(Space& home, int n);
1188  ModEvent eq(Space& home, double n);
1190 
1206 
1207  template<class I>
1208  ModEvent narrow_r(Space& home, I& i, bool depends=true);
1210  template<class I>
1211  ModEvent inter_r(Space& home, I& i, bool depends=true);
1213  template<class I>
1214  ModEvent minus_r(Space& home, I& i, bool depends=true);
1216  template<class I>
1217  ModEvent narrow_v(Space& home, I& i, bool depends=true);
1219  template<class I>
1220  ModEvent inter_v(Space& home, I& i, bool depends=true);
1222  template<class I>
1223  ModEvent minus_v(Space& home, I& i, bool depends=true);
1225 
1227 
1228 
1229  static ModEventDelta med(ModEvent me);
1231 
1233 
1234 
1235  int min(const Delta& d) const;
1237  int max(const Delta& d) const;
1239  bool any(const Delta& d) const;
1241 
1243 
1244 
1245  void initCache(Space& home, const IntSet& s);
1247  void cache(Space& home);
1249  bool modified(void) const;
1251 
1253 
1254 
1255  void update(Space& home, bool share, CachedView<View>& y);
1257  };
1258 
1263  template<class Char, class Traits, class View>
1264  std::basic_ostream<Char,Traits>&
1265  operator <<(std::basic_ostream<Char,Traits>& os, const CachedView<View>& x);
1266 
1271 
1272  template<class View>
1273  bool same(const CachedView<View>& x, const CachedView<View>& y);
1275  template<class View>
1276  bool before(const CachedView<View>& x, const CachedView<View>& y);
1278 
1287  template<class View>
1289  : public Iter::Ranges::Diff<Iter::Ranges::RangeList,ViewRanges<View> > {
1291  Super;
1292  protected:
1297  public:
1299 
1300 
1301  ViewDiffRanges(void);
1303  ViewDiffRanges(const CachedView<View>& x);
1305  void init(const CachedView<View>& x);
1307  };
1308 
1315  class BoolView : public VarImpView<BoolVar> {
1316  protected:
1317  using VarImpView<BoolVar>::x;
1318  public:
1320 
1321 
1322  BoolView(void);
1324  BoolView(const BoolVar& y);
1326  BoolView(BoolVarImp* y);
1328 
1330 
1331 
1332  static const int BITS = BoolVarImp::BITS;
1340  BoolStatus status(void) const;
1342 
1344 
1345 
1346  int min(void) const;
1348  int max(void) const;
1350  int med(void) const;
1352  int val(void) const;
1353 
1355  unsigned int size(void) const;
1357  unsigned int width(void) const;
1359  unsigned int regret_min(void) const;
1361  unsigned int regret_max(void) const;
1363 
1365 
1366 
1367  bool range(void) const;
1369  bool in(int n) const;
1371  bool in(double n) const;
1373 
1375 
1376 
1377  bool zero(void) const;
1379  bool one(void) const;
1381  bool none(void) const;
1383 
1385 
1386 
1387  ModEvent one(Space& home);
1389  ModEvent zero(Space& home);
1391  ModEvent one_none(Space& home);
1393  ModEvent zero_none(Space& home);
1395 
1397 
1398 
1399  ModEvent lq(Space& home, int n);
1401  ModEvent lq(Space& home, double n);
1402 
1404  ModEvent le(Space& home, int n);
1406  ModEvent le(Space& home, double n);
1407 
1409  ModEvent gq(Space& home, int n);
1411  ModEvent gq(Space& home, double n);
1412 
1414  ModEvent gr(Space& home, int n);
1416  ModEvent gr(Space& home, double n);
1417 
1419  ModEvent nq(Space& home, int n);
1421  ModEvent nq(Space& home, double n);
1422 
1424  ModEvent eq(Space& home, int n);
1426  ModEvent eq(Space& home, double n);
1428 
1444 
1445  template<class I>
1446  ModEvent narrow_r(Space& home, I& i, bool depends=true);
1448  template<class I>
1449  ModEvent inter_r(Space& home, I& i, bool depends=true);
1451  template<class I>
1452  ModEvent minus_r(Space& home, I& i, bool depends=true);
1454  template<class I>
1455  ModEvent narrow_v(Space& home, I& i, bool depends=true);
1457  template<class I>
1458  ModEvent inter_v(Space& home, I& i, bool depends=true);
1460  template<class I>
1461  ModEvent minus_v(Space& home, I& i, bool depends=true);
1463 
1465 
1466 
1467  int min(const Delta& d) const;
1469  int max(const Delta& d) const;
1471  bool any(const Delta& d) const;
1473  static bool zero(const Delta& d);
1475  static bool one(const Delta& d);
1477 
1479 
1480 
1481  static ModEventDelta med(ModEvent me);
1483  };
1484 
1489  template<class Char, class Traits>
1490  std::basic_ostream<Char,Traits>&
1491  operator <<(std::basic_ostream<Char,Traits>& os, const BoolView& x);
1492 
1493 
1494 
1503  class NegBoolView : public DerivedView<BoolView> {
1504  protected:
1506  public:
1508 
1509 
1510  NegBoolView(void);
1512  explicit NegBoolView(const BoolView& y);
1514 
1516 
1517 
1518  static const int BITS = BoolView::BITS;
1526  BoolStatus status(void) const;
1528 
1530 
1531 
1532  bool zero(void) const;
1534  bool one(void) const;
1536  bool none(void) const;
1538 
1540 
1541 
1542  ModEvent one(Space& home);
1544  ModEvent zero(Space& home);
1546  ModEvent one_none(Space& home);
1548  ModEvent zero_none(Space& home);
1550 
1552 
1553 
1554  int min(void) const;
1556  int max(void) const;
1558  int val(void) const;
1560 
1562 
1563 
1564  int min(const Delta& d) const;
1566  int max(const Delta& d) const;
1568  bool any(const Delta& d) const;
1570  static bool zero(const Delta& d);
1572  static bool one(const Delta& d);
1574  };
1575 
1580  template<class Char, class Traits>
1581  std::basic_ostream<Char,Traits>&
1582  operator <<(std::basic_ostream<Char,Traits>& os, const NegBoolView& x);
1583 
1584 }}
1585 
1586 #include <gecode/int/var/int.hpp>
1587 #include <gecode/int/var/bool.hpp>
1588 
1589 #include <gecode/int/view/int.hpp>
1590 
1592 #include <gecode/int/view/zero.hpp>
1593 #include <gecode/int/view/minus.hpp>
1594 #include <gecode/int/view/offset.hpp>
1595 #include <gecode/int/view/scale.hpp>
1596 #include <gecode/int/view/cached.hpp>
1597 
1598 #include <gecode/int/view/bool.hpp>
1599 
1601 
1602 #include <gecode/int/view/print.hpp>
1603 #include <gecode/int/var/print.hpp>
1604 
1605 namespace Gecode { namespace Int {
1606 
1613 
1614  enum RelTest {
1615  RT_FALSE = 0,
1616  RT_MAYBE = 1,
1617  RT_TRUE = 2
1618  };
1619 
1621  template<class View> RelTest rtest_eq_bnd(View x, View y);
1623  template<class View> RelTest rtest_eq_dom(View x, View y);
1625  template<class View> RelTest rtest_eq_bnd(View x, int n);
1627  template<class View> RelTest rtest_eq_dom(View x, int n);
1628 
1630  template<class View> RelTest rtest_nq_bnd(View x, View y);
1632  template<class View> RelTest rtest_nq_dom(View x, View y);
1634  template<class View> RelTest rtest_nq_bnd(View x, int n);
1636  template<class View> RelTest rtest_nq_dom(View x, int n);
1637 
1639  template<class View> RelTest rtest_lq(View x, View y);
1641  template<class View> RelTest rtest_lq(View x, int n);
1642 
1644  template<class View> RelTest rtest_le(View x, View y);
1646  template<class View> RelTest rtest_le(View x, int n);
1647 
1649  template<class View> RelTest rtest_gq(View x, View y);
1651  template<class View> RelTest rtest_gq(View x, int n);
1652 
1654  template<class View> RelTest rtest_gr(View x, View y);
1656  template<class View> RelTest rtest_gr(View x, int n);
1658 
1659 
1664  enum BoolTest {
1668  };
1669 
1675 
1676  BoolTest bool_test(const BoolView& b0, const BoolView& b1);
1678  BoolTest bool_test(const BoolView& b0, const NegBoolView& b1);
1680  BoolTest bool_test(const NegBoolView& b0, const BoolView& b1);
1682  BoolTest bool_test(const NegBoolView& b0, const NegBoolView& b1);
1684 
1685 }}
1686 
1689 
1690 // STATISTICS: int-var