Generated on Mon May 5 05:53:52 2008 for Gecode by doxygen 1.5.5

view.icc

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Christian Schulte, 2005
00008  *
00009  *  Last modified:
00010  *     $Date: 2008-01-24 13:05:13 +0100 (Thu, 24 Jan 2008) $ by $Author: tack $
00011  *     $Revision: 5974 $
00012  *
00013  *  This file is part of Gecode, the generic constraint
00014  *  development environment:
00015  *     http://www.gecode.org
00016  *
00017  *  Permission is hereby granted, free of charge, to any person obtaining
00018  *  a copy of this software and associated documentation files (the
00019  *  "Software"), to deal in the Software without restriction, including
00020  *  without limitation the rights to use, copy, modify, merge, publish,
00021  *  distribute, sublicense, and/or sell copies of the Software, and to
00022  *  permit persons to whom the Software is furnished to do so, subject to
00023  *  the following conditions:
00024  *
00025  *  The above copyright notice and this permission notice shall be
00026  *  included in all copies or substantial portions of the Software.
00027  *
00028  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00029  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00030  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00031  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00032  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00033  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00034  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00035  *
00036  */
00037 
00038 #include <iostream>
00039 
00040 #if (-17 / 7) == -2
00041 #define GECODE_INT_RND_TWDS_ZERO 1
00042 #else
00043 #define GECODE_INT_RND_TWDS_ZERO 0
00044 #endif
00045 
00046 namespace Gecode { namespace Int {
00047 
00059   template <class View>
00060   class ViewRanges {
00061   public:
00063 
00064 
00065     ViewRanges(void);
00067     ViewRanges(const View& x);
00069     void init(const View& x);
00071 
00073 
00074 
00075     bool operator()(void) const;
00077     void operator++(void);
00079 
00081 
00082 
00083     int min(void) const;
00085     int max(void) const;
00087     unsigned int width(void) const;
00089   };
00090 
00099   template <class View>
00100   class ViewValues : public Iter::Ranges::ToValues<ViewRanges<View> > {
00101   public:
00103 
00104 
00105     ViewValues(void);
00107     ViewValues(const View& x);
00109     void init(const View& x);
00111   };
00112 
00113 }}
00114 
00115 #include "gecode/int/view/iter.icc"
00116 
00117 namespace Gecode {
00118 
00119   namespace Int {
00120 
00137     class IntView : public VarViewBase<IntVarImp> {
00138     protected:
00139       using VarViewBase<IntVarImp>::varimp;
00140     public:
00142 
00143 
00144       IntView(void);
00146       IntView(const IntVar& x);
00148       IntView(IntVarImp* x);
00150       IntView(Space* home, const Reflection::VarMap& vars,
00151               Reflection::Arg* arg);
00153 
00155 
00156 
00157       int min(void) const;
00159       int max(void) const;
00161       int med(void) const;
00163       int val(void) const;
00164 
00166       unsigned int size(void) const;
00168       unsigned int width(void) const;
00170       unsigned int regret_min(void) const;
00172       unsigned int regret_max(void) const;
00174 
00176 
00177 
00178       bool range(void) const;
00180       bool assigned(void) const;
00181 
00183       bool in(int n) const;
00185       bool in(double n) const;
00187 
00189 
00190 
00191       ModEvent lq(Space* home, int n);
00193       ModEvent lq(Space* home, double n);
00194 
00196       ModEvent le(Space* home, int n);
00198       ModEvent le(Space* home, double n);
00199 
00201       ModEvent gq(Space* home, int n);
00203       ModEvent gq(Space* home, double n);
00204 
00206       ModEvent gr(Space* home, int n);
00208       ModEvent gr(Space* home, double n);
00210       ModEvent nq(Space* home, int n);
00212       ModEvent nq(Space* home, double n);
00213 
00215       ModEvent eq(Space* home, int n);
00217       ModEvent eq(Space* home, double n);
00219 
00235 
00236       template <class I> 
00237       ModEvent narrow_r(Space* home, I& i, bool depends=true);
00239       template <class I> 
00240       ModEvent inter_r(Space* home, I& i, bool depends=true);
00242       template <class I> 
00243       ModEvent minus_r(Space* home, I& i, bool depends=true);
00245       template <class I> 
00246       ModEvent narrow_v(Space* home, I& i, bool depends=true);
00248       template <class I> 
00249       ModEvent inter_v(Space* home, I& i, bool depends=true);
00251       template <class I> 
00252       ModEvent minus_v(Space* home, I& i, bool depends=true);
00254 
00256 
00257 
00258       static ModEvent modevent(const Delta* d);
00260       int min(const Delta* d) const;
00262       int max(const Delta* d) const;
00264       bool any(const Delta* d) const;
00266 
00268 
00269 
00270       static ModEventDelta med(ModEvent me);
00272 
00274 
00275 
00276       void update(Space* home, bool share, IntView& x);
00278       
00280 
00281 
00282       Reflection::Arg* spec(const Space* home, Reflection::VarMap& m) const;
00283       static Support::Symbol type(void);
00285       
00286     };
00287 
00288   }
00289 
00296   template<>
00297   class ViewVarImpTraits<Int::IntView> {
00298   public:
00300     typedef Int::IntVarImp VarImp;
00301   };
00302 
00308   template<>
00309   class VarViewTraits<IntVar> {
00310   public:
00312     typedef Int::IntView View;
00313   };
00314 
00315   namespace Int {
00316 
00324     class MinusView : public DerivedViewBase<IntView> {
00325     protected:
00326       using DerivedViewBase<IntView>::view;
00327     public:
00329 
00330 
00331       MinusView(void);
00333       MinusView(const IntView& x);
00335       MinusView(Space* home, const Reflection::VarMap& vars,
00336                 Reflection::Arg* arg);
00338       void init(const IntView& x);
00340 
00342 
00343 
00344       int min(void) const;
00346       int max(void) const;
00348       int med(void) const;
00350       int val(void) const;
00351 
00353       unsigned int size(void) const;
00355       unsigned int width(void) const;
00357       unsigned int regret_min(void) const;
00359       unsigned int regret_max(void) const;
00361 
00363 
00364 
00365       bool range(void) const;
00367       bool assigned(void) const;
00368 
00370       bool in(int n) const;
00372       bool in(double n) const;
00374 
00376 
00377 
00378       ModEvent lq(Space* home, int n);
00380       ModEvent lq(Space* home, double n);
00382       ModEvent le(Space* home, int n);
00384       ModEvent le(Space* home, double n);
00386       ModEvent gq(Space* home, int n);
00388       ModEvent gq(Space* home, double n);
00390       ModEvent gr(Space* home, int n);
00392       ModEvent gr(Space* home, double n);
00394       ModEvent nq(Space* home, int n);
00396       ModEvent nq(Space* home, double n);
00398       ModEvent eq(Space* home, int n);
00400       ModEvent eq(Space* home, double n);
00402 
00418 
00419       template <class I> 
00420       ModEvent narrow_r(Space* home, I& i, bool depends=true);
00422       template <class I> 
00423       ModEvent inter_r(Space* home, I& i, bool depends=true);
00425       template <class I> 
00426       ModEvent minus_r(Space* home, I& i, bool depends=true);
00428       template <class I> 
00429       ModEvent narrow_v(Space* home, I& i, bool depends=true);
00431       template <class I> 
00432       ModEvent inter_v(Space* home, I& i, bool depends=true);
00434       template <class I> 
00435       ModEvent minus_v(Space* home, I& i, bool depends=true);
00437 
00439 
00440 
00441       static void schedule(Space* home, Propagator* p, ModEvent me);
00443       static ModEvent me(ModEventDelta med);
00445       static ModEventDelta med(ModEvent me);
00447 
00449 
00450 
00457       void subscribe(Space* home, Propagator* p, PropCond pc, bool process=true);
00459       void cancel(Space* home, Propagator* p, PropCond pc);
00461       void subscribe(Space* home, Advisor* a);
00463       void cancel(Space* home, Advisor* a);
00465 
00467 
00468 
00469       static ModEvent modevent(const Delta* d);
00471       int min(const Delta* d) const;
00473       int max(const Delta* d) const;
00475       bool any(const Delta* d) const;
00477 
00479 
00480 
00481       void update(Space* home, bool share, MinusView& x);
00483       
00485 
00486 
00487       Reflection::Arg* spec(const Space* home, Reflection::VarMap& m) const;
00488       static Support::Symbol type(void);
00490     };
00491 
00492   }
00493 
00498 
00499   bool same(const Int::MinusView& x, const Int::MinusView& y);
00501   bool before(const Int::MinusView& x, const Int::MinusView& y);
00503 
00510   template<>
00511   class ViewVarImpTraits<Int::MinusView> {
00512   public:
00514     typedef Int::IntVarImp VarImp;
00515   };
00516 
00517 
00518   namespace Int {
00519 
00528     class OffsetView : public DerivedViewBase<IntView> {
00529     protected:
00531       int c;
00532       using DerivedViewBase<IntView>::view;
00533     public:
00535 
00536 
00537       OffsetView(void);
00539       OffsetView(const IntView& x, int c);
00541       OffsetView(Space* home, const Reflection::VarMap& vars,
00542                  Reflection::Arg* arg);
00544       void init(const IntView& x, int c);
00546       int offset(void) const;
00548 
00550 
00551 
00552       int min(void) const;
00554       int max(void) const;
00556       int med(void) const;
00558       int val(void) const;
00559 
00561       unsigned int size(void) const;
00563       unsigned int width(void) const;
00565       unsigned int regret_min(void) const;
00567       unsigned int regret_max(void) const;
00569 
00571 
00572 
00573       bool range(void) const;
00575       bool assigned(void) const;
00576 
00578       bool in(int n) const;
00580       bool in(double n) const;
00582 
00584 
00585 
00586       ModEvent lq(Space* home, int n);
00588       ModEvent lq(Space* home, double n);
00590       ModEvent le(Space* home, int n);
00592       ModEvent le(Space* home, double n);
00594       ModEvent gq(Space* home, int n);
00596       ModEvent gq(Space* home, double n);
00598       ModEvent gr(Space* home, int n);
00600       ModEvent gr(Space* home, double n);
00602       ModEvent nq(Space* home, int n);
00604       ModEvent nq(Space* home, double n);
00606       ModEvent eq(Space* home, int n);
00608       ModEvent eq(Space* home, double n);
00610 
00626 
00627       template <class I> 
00628       ModEvent narrow_r(Space* home, I& i, bool depends=true);
00630       template <class I> 
00631       ModEvent inter_r(Space* home, I& i, bool depends=true);
00633       template <class I> 
00634       ModEvent minus_r(Space* home, I& i, bool depends=true);
00636       template <class I> 
00637       ModEvent narrow_v(Space* home, I& i, bool depends=true);
00639       template <class I> 
00640       ModEvent inter_v(Space* home, I& i, bool depends=true);
00642       template <class I> 
00643       ModEvent minus_v(Space* home, I& i, bool depends=true);
00645 
00647 
00648 
00649       static void schedule(Space* home, Propagator* p, ModEvent me);
00651       static ModEvent me(ModEventDelta med);
00653       static ModEventDelta med(ModEvent me);
00655 
00657 
00658 
00665       void subscribe(Space* home, Propagator* p, PropCond pc, bool process=true);
00667       void cancel(Space* home, Propagator* p, PropCond pc);
00669       void subscribe(Space* home, Advisor* a);
00671       void cancel(Space* home, Advisor* a);
00673 
00675 
00676 
00677       static ModEvent modevent(const Delta* d);
00679       int min(const Delta* d) const;
00681       int max(const Delta* d) const;
00683       bool any(const Delta* d) const;
00685 
00687 
00688 
00689       void update(Space* home, bool share, OffsetView& x);
00691       
00693 
00694 
00695       Reflection::Arg* spec(const Space* home, Reflection::VarMap& m) const;
00696       static Support::Symbol type(void);
00698     };
00699 
00700   }
00701 
00706 
00707   bool same(const Int::OffsetView& x, const Int::OffsetView& y);
00709   bool before(const Int::OffsetView& x, const Int::OffsetView& y);
00711 
00718   template<>
00719   class ViewVarImpTraits<Int::OffsetView> {
00720   public:
00722     typedef Int::IntVarImp VarImp;
00723   };
00724 
00725 
00726 
00727   namespace Int {
00728 
00754     template <class Val, class UnsVal>
00755     class ScaleView : public DerivedViewBase<IntView> {
00756     protected:
00758       int a;
00759       using DerivedViewBase<IntView>::view;
00760 
00762 
00763 
00764       int floor_div(double x) const;
00766       int ceil_div(double x) const;
00768       int exact_div(double x, bool& exact) const;
00769 #if GECODE_INT_RND_TWDS_ZERO
00771       int floor_div(int) const;
00773       int ceil_div(int) const;
00775       int exact_div(int, bool&) const;
00776 #endif
00777 
00778 
00779     public:
00781 
00782 
00783       ScaleView(void);
00785       ScaleView(int b, const IntView& y);
00787       ScaleView(Space* home, const Reflection::VarMap& vars,
00788                 Reflection::Arg* arg);
00790       void init(int b, const IntView& y);
00792       int scale(void) const;
00794 
00795 
00797 
00798 
00799       Val min(void) const;
00801       Val max(void) const;
00803       Val med(void) const;
00805       Val val(void) const;
00806 
00808       UnsVal size(void) const;
00810       UnsVal width(void) const;
00812       UnsVal regret_min(void) const;
00814       UnsVal regret_max(void) const;
00816 
00818 
00819 
00820       bool range(void) const;
00822       bool assigned(void) const;
00824       bool in(Val n) const;
00826 
00828 
00829 
00830       ModEvent lq(Space* home, Val n);
00832       ModEvent le(Space* home, Val n);
00834       ModEvent gq(Space* home, Val n);
00836       ModEvent gr(Space* home, Val n);
00838       ModEvent nq(Space* home, Val n);
00840       ModEvent eq(Space* home, Val n);
00842 
00844 
00845 
00846       static void schedule(Space* home, Propagator* p, ModEvent me);
00848       static ModEvent me(ModEventDelta med);
00850       static ModEventDelta med(ModEvent me);
00852 
00854 
00855 
00862       void subscribe(Space* home, Propagator* p, PropCond pc, bool process=true);
00864       void cancel(Space* home, Propagator* p, PropCond pc);
00866       void subscribe(Space* home, Advisor* a);
00868       void cancel(Space* home, Advisor* a);
00870 
00872 
00873 
00874       static ModEvent modevent(const Delta* d);
00876       Val min(const Delta* d) const;
00878       Val max(const Delta* d) const;
00880       bool any(const Delta* d) const;
00882 
00884 
00885 
00886       void update(Space* home, bool share, ScaleView<Val,UnsVal>& x);
00888       
00890 
00891 
00892       Reflection::Arg* spec(const Space* home, Reflection::VarMap& m) const;
00893       static Support::Symbol type(void);
00895     };
00896 
00901     typedef ScaleView<int,unsigned int> IntScaleView;
00902 
00907     typedef ScaleView<double,double> DoubleScaleView;
00908 
00909   }
00910 
00915 
00916   template <class Val, class UnsVal>
00917   bool same(const Int::ScaleView<Val,UnsVal>& x,
00918             const Int::ScaleView<Val,UnsVal>& y);
00920   template <class Val, class UnsVal>
00921   bool before(const Int::ScaleView<Val,UnsVal>& x,
00922               const Int::ScaleView<Val,UnsVal>& y);
00924 
00925 
00932   template <class Val, class UnsVal>
00933   class ViewVarImpTraits<Int::ScaleView<Val,UnsVal> > {
00934   public:
00936     typedef Int::IntVarImp VarImp;
00937   };
00938 
00939 
00940 
00941   namespace Int {
00942 
00950     class ConstIntView : public ConstViewBase {
00951     protected:
00952       int x;
00953     public:
00955 
00956 
00957       ConstIntView(void);
00959       ConstIntView(int n);
00961       void init(int n);
00963       ConstIntView(Space* home, const Reflection::VarMap& vars,
00964                    Reflection::Arg* arg);
00966 
00968 
00969 
00970       int min(void) const;
00972       int max(void) const;
00974       int med(void) const;
00976       int val(void) const;
00977 
00979       unsigned int size(void) const;
00981       unsigned int width(void) const;
00983       unsigned int regret_min(void) const;
00985       unsigned int regret_max(void) const;
00987 
00989 
00990 
00991       bool range(void) const;
00993       bool assigned(void) const;
00994 
00996       bool in(int n) const;
00998       bool in(double n) const;
01000 
01002 
01003 
01004       ModEvent lq(Space* home, int n);
01006       ModEvent lq(Space* home, double n);
01008       ModEvent le(Space* home, int n);
01010       ModEvent le(Space* home, double n);
01012       ModEvent gq(Space* home, int n);
01014       ModEvent gq(Space* home, double n);
01016       ModEvent gr(Space* home, int n);
01018       ModEvent gr(Space* home, double n);
01020       ModEvent nq(Space* home, int n);
01022       ModEvent nq(Space* home, double n);
01024       ModEvent eq(Space* home, int n);
01026       ModEvent eq(Space* home, double n);
01028 
01044 
01045       template <class I> 
01046       ModEvent narrow_r(Space* home, I& i, bool depends=true);
01048       template <class I> 
01049       ModEvent inter_r(Space* home, I& i, bool depends=true);
01051       template <class I> 
01052       ModEvent minus_r(Space* home, I& i, bool depends=true);
01054       template <class I> 
01055       ModEvent narrow_v(Space* home, I& i, bool depends=true);
01057       template <class I> 
01058       ModEvent inter_v(Space* home, I& i, bool depends=true);
01060       template <class I> 
01061       ModEvent minus_v(Space* home, I& i, bool depends=true);
01063 
01065 
01066 
01067       static void schedule(Space* home, Propagator* p, ModEvent me);
01069       static ModEvent me(ModEventDelta med);
01071       static ModEventDelta med(ModEvent me);
01073 
01075 
01076 
01083       void subscribe(Space* home, Propagator* p, PropCond pc, bool process=true);
01085       void cancel(Space* home, Propagator* p, PropCond pc);
01087       void subscribe(Space* home, Advisor* a);
01089       void cancel(Space* home, Advisor* a);
01091 
01093 
01094 
01095       static ModEvent modevent(const Delta* d);
01097       int min(const Delta* d) const;
01099       int max(const Delta* d) const;
01101       bool any(const Delta* d) const;
01103 
01105 
01106 
01107       void update(Space* home, bool share, ConstIntView& x);
01109       
01111 
01112 
01113       Reflection::Arg* spec(const Space* home, Reflection::VarMap& m) const;
01114       static Support::Symbol type(void);
01116     };
01117 
01118   }
01119 
01125 
01126   bool same(const Int::ConstIntView& x, const Int::ConstIntView& y);
01128   bool before(const Int::ConstIntView& x, const Int::ConstIntView& y);
01130 
01137   template<>
01138   class ViewVarImpTraits<Int::ConstIntView> {
01139   public:
01141     typedef VarImpBase VarImp;
01142   };
01143 
01144   namespace Int {
01145 
01153     class ZeroIntView : public ConstViewBase {
01154     public:
01156 
01157 
01158       ZeroIntView(void);
01160       void init(void);
01162       ZeroIntView(Space* home, const Reflection::VarMap& vars,
01163                   Reflection::Arg* arg);
01165 
01167 
01168 
01169       int min(void) const;
01171       int max(void) const;
01173       int med(void) const;
01175       int val(void) const;
01176 
01178       unsigned int size(void) const;
01180       unsigned int width(void) const;
01182       unsigned int regret_min(void) const;
01184       unsigned int regret_max(void) const;
01186 
01188 
01189 
01190       bool range(void) const;
01192       bool assigned(void) const;
01193 
01195       bool in(int n) const;
01197       bool in(double n) const;
01199 
01201 
01202 
01203       ModEvent lq(Space* home, int n);
01205       ModEvent lq(Space* home, double n);
01207       ModEvent le(Space* home, int n);
01209       ModEvent le(Space* home, double n);
01211       ModEvent gq(Space* home, int n);
01213       ModEvent gq(Space* home, double n);
01215       ModEvent gr(Space* home, int n);
01217       ModEvent gr(Space* home, double n);
01219       ModEvent nq(Space* home, int n);
01221       ModEvent nq(Space* home, double n);
01223       ModEvent eq(Space* home, int n);
01225       ModEvent eq(Space* home, double n);
01227 
01243 
01244       template <class I> 
01245       ModEvent narrow_r(Space* home, I& i, bool depends=true);
01247       template <class I> 
01248       ModEvent inter_r(Space* home, I& i, bool depends=true);
01250       template <class I> 
01251       ModEvent minus_r(Space* home, I& i, bool depends=true);
01253       template <class I> 
01254       ModEvent narrow_v(Space* home, I& i, bool depends=true);
01256       template <class I> 
01257       ModEvent inter_v(Space* home, I& i, bool depends=true);
01259       template <class I> 
01260       ModEvent minus_v(Space* home, I& i, bool depends=true);
01262 
01264 
01265 
01266       static void schedule(Space* home, Propagator* p, ModEvent me);
01268       static ModEvent me(ModEventDelta med);
01270       static ModEventDelta med(ModEvent me);
01272 
01274 
01275 
01282       void subscribe(Space* home, Propagator* p, PropCond pc, bool process=true);
01284       void cancel(Space* home, Propagator* p, PropCond pc);
01286       void subscribe(Space* home, Advisor* a);
01288       void cancel(Space* home, Advisor* a);
01290 
01292 
01293 
01294       static ModEvent modevent(const Delta* d);
01296       int min(const Delta* d) const;
01298       int max(const Delta* d) const;
01300       bool any(const Delta* d) const;
01302 
01304 
01305 
01306       void update(Space* home, bool share, ZeroIntView& x);
01308       
01310 
01311 
01312       Reflection::Arg* spec(const Space* home, Reflection::VarMap& m) const;
01313       static Support::Symbol type(void);
01315     };
01316 
01317   }
01318 
01324 
01325   bool same(const Int::ZeroIntView& x, const Int::ZeroIntView& y);
01327   bool before(const Int::ZeroIntView& x, const Int::ZeroIntView& y);
01329 
01336   template<>
01337   class ViewVarImpTraits<Int::ZeroIntView> {
01338   public:
01340     typedef VarImpBase VarImp;
01341   };
01342 
01343   namespace Int {
01344 
01351     class BoolView : public VarViewBase<BoolVarImp> {
01352     protected:
01353       using VarViewBase<BoolVarImp>::varimp;
01354     public:
01356 
01357 
01358       BoolView(void);
01360       BoolView(const BoolVar& x);
01362       BoolView(BoolVarImp* x);
01364       BoolView(Space* home, const Reflection::VarMap& vars,
01365                Reflection::Arg* arg);
01367 
01369 
01370 
01371       static const int BITS = BoolVarImp::BITS;
01373       static const BoolStatus ZERO = BoolVarImp::ZERO;
01375       static const BoolStatus ONE  = BoolVarImp::ONE;
01377       static const BoolStatus NONE = BoolVarImp::NONE;
01379       BoolStatus status(void) const;
01381 
01383 
01384 
01385       int min(void) const;
01387       int max(void) const;
01389       int med(void) const;
01391       int val(void) const;
01392 
01394       unsigned int size(void) const;
01396       unsigned int width(void) const;
01398       unsigned int regret_min(void) const;
01400       unsigned int regret_max(void) const;
01402 
01404 
01405 
01406       bool range(void) const;
01408       bool assigned(void) const;
01409 
01411       bool in(int n) const;
01413       bool in(double n) const;
01415 
01417 
01418 
01419       bool zero(void) const;
01421       bool one(void) const;
01423       bool none(void) const;
01425 
01427 
01428 
01429       ModEvent one(Space* home);
01431       ModEvent zero(Space* home);
01433       ModEvent one_none(Space* home);
01435       ModEvent zero_none(Space* home);
01437 
01439 
01440 
01441       ModEvent lq(Space* home, int n);
01443       ModEvent lq(Space* home, double n);
01444 
01446       ModEvent le(Space* home, int n);
01448       ModEvent le(Space* home, double n);
01449 
01451       ModEvent gq(Space* home, int n);
01453       ModEvent gq(Space* home, double n);
01454 
01456       ModEvent gr(Space* home, int n);
01458       ModEvent gr(Space* home, double n);
01459 
01461       ModEvent nq(Space* home, int n);
01463       ModEvent nq(Space* home, double n);
01464 
01466       ModEvent eq(Space* home, int n);
01468       ModEvent eq(Space* home, double n);
01470 
01486 
01487       template <class I> 
01488       ModEvent narrow_r(Space* home, I& i, bool depends=true);
01490       template <class I> 
01491       ModEvent inter_r(Space* home, I& i, bool depends=true);
01493       template <class I> 
01494       ModEvent minus_r(Space* home, I& i, bool depends=true);
01496       template <class I> 
01497       ModEvent narrow_v(Space* home, I& i, bool depends=true);
01499       template <class I> 
01500       ModEvent inter_v(Space* home, I& i, bool depends=true);
01502       template <class I> 
01503       ModEvent minus_v(Space* home, I& i, bool depends=true);
01505 
01507 
01508 
01509       static ModEvent modevent(const Delta* d);
01511       int min(const Delta* d) const;
01513       int max(const Delta* d) const;
01515       bool any(const Delta* d) const;
01517 
01519 
01520 
01521       static ModEventDelta med(ModEvent me);
01523 
01525 
01526 
01527       void update(Space* home, bool share, BoolView& x);
01529       
01531 
01532 
01533       Reflection::Arg* spec(const Space* home, Reflection::VarMap& m) const;
01534       static Support::Symbol type(void);
01536     };
01537 
01538   }
01539 
01546   template<>
01547   class ViewVarImpTraits<Int::BoolView> {
01548   public:
01550     typedef Int::BoolVarImp VarImp;
01551   };
01552 
01558   template<>
01559   class VarViewTraits<BoolVar> {
01560   public:
01562     typedef Int::BoolView View;
01563   };
01564 
01565   namespace Int {
01566 
01575     class NegBoolView : public DerivedViewBase<BoolView> {
01576     protected:
01577       using DerivedViewBase<BoolView>::view;
01578     public:
01580 
01581 
01582       NegBoolView(void);
01584       NegBoolView(const BoolView& b);
01586       void init(const BoolView& b);
01588       NegBoolView(Space* home, const Reflection::VarMap& vars,
01589                   Reflection::Arg* arg);
01591 
01593 
01594 
01595       static const int BITS = BoolView::BITS;
01597       static const BoolStatus ZERO = BoolView::ONE;
01599       static const BoolStatus ONE  = BoolView::ZERO;
01601       static const BoolStatus NONE = BoolView::NONE;
01603       BoolStatus status(void) const;
01605 
01607 
01608 
01609       bool zero(void) const;
01611       bool one(void) const;
01613       bool none(void) const;
01615 
01617 
01618 
01619       ModEvent one(Space* home);
01621       ModEvent zero(Space* home);
01623       ModEvent one_none(Space* home);
01625       ModEvent zero_none(Space* home);
01627 
01629 
01630 
01631       int min(void) const;
01633       int max(void) const;
01635       int val(void) const;
01637 
01639 
01640 
01641       bool assigned(void) const;
01643 
01645 
01646 
01647       static void schedule(Space* home, Propagator* p, ModEvent me);
01649       static ModEvent me(ModEventDelta med);
01651       static ModEventDelta med(ModEvent me);
01653 
01655 
01656 
01663       void subscribe(Space* home, Propagator* p, PropCond pc, bool process=true);
01665       void cancel(Space* home, Propagator* p, PropCond pc);
01667       void subscribe(Space* home, Advisor* a);
01669       void cancel(Space* home, Advisor* a);
01671 
01673 
01674 
01675       static ModEvent modevent(const Delta* d);
01677       int min(const Delta* d) const;
01679       int max(const Delta* d) const;
01681       bool any(const Delta* d) const;
01683 
01685 
01686 
01687       void update(Space* home, bool share, NegBoolView& x);
01689       
01691 
01692 
01693       Reflection::Arg* spec(const Space* home, Reflection::VarMap& m) const;
01694       static Support::Symbol type(void);
01696     };
01697 
01702     enum BoolTest {
01703       BT_NONE, 
01704       BT_SAME, 
01705       BT_COMP  
01706     };
01707 
01713 
01714     BoolTest bool_test(const BoolView& b0, const BoolView& b1);
01716     BoolTest bool_test(const BoolView& b0, const NegBoolView& b1);
01718     BoolTest bool_test(const NegBoolView& b0, const BoolView& b1);
01720     BoolTest bool_test(const NegBoolView& b0, const NegBoolView& b1);
01722 
01723   }
01724 
01729 
01730   bool same(const Int::NegBoolView& x, const Int::NegBoolView& y);
01732   bool before(const Int::NegBoolView& x, const Int::NegBoolView& y);
01734 
01741   template<>
01742   class ViewVarImpTraits<Int::NegBoolView> {
01743   public:
01745     typedef Int::BoolVarImp VarImp;
01746   };
01747 
01748 }
01749 
01750 #include "gecode/int/var/int.icc"
01751 #include "gecode/int/var/bool.icc"
01752 
01753 #include "gecode/int/view/int.icc"
01754 #include "gecode/int/view/bool.icc"
01755 
01756 #include "gecode/int/view/constint.icc"
01757 #include "gecode/int/view/zero.icc"
01758 
01759 #include "gecode/int/view/minus.icc"
01760 #include "gecode/int/view/offset.icc"
01761 #include "gecode/int/view/scale.icc"
01762 
01767 GECODE_INT_EXPORT std::ostream&
01768 operator<<(std::ostream&, const Gecode::Int::IntView&);
01773 GECODE_INT_EXPORT std::ostream&
01774 operator<<(std::ostream&, const Gecode::Int::MinusView&);
01779 GECODE_INT_EXPORT std::ostream&
01780 operator<<(std::ostream&, const Gecode::Int::OffsetView&);
01785 GECODE_INT_EXPORT std::ostream&
01786 operator<<(std::ostream&, const Gecode::Int::ConstIntView&);
01791 GECODE_INT_EXPORT std::ostream&
01792 operator<<(std::ostream&, const Gecode::Int::ZeroIntView&);
01797 GECODE_INT_EXPORT std::ostream&
01798 operator<<(std::ostream&, const Gecode::Int::IntScaleView&);
01803 GECODE_INT_EXPORT std::ostream&
01804 operator<<(std::ostream&, const Gecode::Int::DoubleScaleView&);
01805 
01810 GECODE_INT_EXPORT std::ostream&
01811 operator<<(std::ostream&, const Gecode::Int::BoolView&);
01816 GECODE_INT_EXPORT std::ostream&
01817 operator<<(std::ostream&, const Gecode::Int::NegBoolView&);
01818 
01819 
01820 inline std::ostream&
01821 operator<<(std::ostream& os, const Gecode::IntVar& x) {
01822   Gecode::Int::IntView vx(x);
01823   return os << vx;
01824 }
01825 
01826 inline std::ostream&
01827 operator<<(std::ostream& os, const Gecode::BoolVar& x) {
01828   Gecode::Int::BoolView vx(x);
01829   return os << vx;
01830 }
01831 
01832 namespace Gecode {
01833 
01834   namespace Int {
01835 
01842 
01843     enum RelTest {
01844       RT_FALSE = 0, 
01845       RT_MAYBE = 1, 
01846       RT_TRUE  = 2   
01847     };
01848 
01850     template <class View> RelTest rtest_eq_bnd(View x, View y);
01852     template <class View> RelTest rtest_eq_dom(View x, View y);
01854     template <class View> RelTest rtest_eq_bnd(View x, int n);
01856     template <class View> RelTest rtest_eq_dom(View x, int n);
01857 
01859     template <class View> RelTest rtest_nq_bnd(View x, View y);
01861     template <class View> RelTest rtest_nq_dom(View x, View y);
01863     template <class View> RelTest rtest_nq_bnd(View x, int n);
01865     template <class View> RelTest rtest_nq_dom(View x, int n);
01866 
01868     template <class View> RelTest rtest_lq(View x, View y);
01870     template <class View> RelTest rtest_lq(View x, int n);
01871 
01873     template <class View> RelTest rtest_le(View x, View y);
01875     template <class View> RelTest rtest_le(View x, int n);
01876 
01878     template <class View> RelTest rtest_gq(View x, View y);
01880     template <class View> RelTest rtest_gq(View x, int n);
01881 
01883     template <class View> RelTest rtest_gr(View x, View y);
01885     template <class View> RelTest rtest_gr(View x, int n);
01887 
01888   }
01889 
01890 }
01891 
01892 #include "gecode/int/view/rtest.icc"
01893 
01894 // STATISTICS: int-var