Generated on Sat Feb 7 2015 02:01:23 for Gecode by doxygen 1.8.9.1
gcc.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Patrick Pekczynski <pekczynski@ps.uni-sb.de>
5  *
6  * Contributing authors:
7  * Christian Schulte <schulte@gecode.org>
8  * Guido Tack <tack@gecode.org>
9  *
10  * Copyright:
11  * Patrick Pekczynski, 2004/2005
12  * Christian Schulte, 2009
13  * Guido Tack, 2009
14  *
15  * Last modified:
16  * $Date: 2009-10-12 17:36:53 +0200 (Mon, 12 Oct 2009) $ by $Author: schulte $
17  * $Revision: 9878 $
18  *
19  * This file is part of Gecode, the generic constraint
20  * development environment:
21  * http://www.gecode.org
22  *
23  * Permission is hereby granted, free of charge, to any person obtaining
24  * a copy of this software and associated documentation files (the
25  * "Software"), to deal in the Software without restriction, including
26  * without limitation the rights to use, copy, modify, merge, publish,
27  * distribute, sublicense, and/or sell copies of the Software, and to
28  * permit persons to whom the Software is furnished to do so, subject to
29  * the following conditions:
30  *
31  * The above copyright notice and this permission notice shall be
32  * included in all copies or substantial portions of the Software.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41  *
42  */
43 
44 #ifndef __GECODE_INT_GCC_HH__
45 #define __GECODE_INT_GCC_HH__
46 
47 #include <gecode/int.hh>
48 
54 #include <gecode/int/gcc/view.hpp>
57 
58 namespace Gecode { namespace Int { namespace GCC {
59 
66  template<class Card>
67  class Val : public Propagator {
68  protected:
76  Val(Space& home, bool share, Val<Card>& p);
77  public:
79  virtual Actor* copy(Space& home, bool share);
81  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
83  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
85  virtual size_t dispose(Space& home);
87  static ExecStatus post(Home home,
89  };
90 
114  template<class Card>
115  class Bnd : public Propagator {
116  protected:
143  bool skip_lbc;
145  Bnd(Space& home, bool share, Bnd<Card>& p);
146 
148  ExecStatus pruneCards(Space& home);
149 
168  ExecStatus lbc(Space& home, int& nb, HallInfo hall[], Rank rank[],
169  int mu[], int nu[]);
170 
189  ExecStatus ubc(Space& home, int& nb, HallInfo hall[], Rank rank[],
190  int mu[], int nu[]);
192  Bnd(Home home, ViewArray<IntView>&, ViewArray<Card>&, bool, bool);
193  public:
195  virtual Actor* copy(Space& home, bool share);
197  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
199  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
201  virtual size_t dispose(Space& home);
203  static ExecStatus post(Home home,
205  };
206 
218  template<class Card>
219  class Dom : public Propagator {
220  protected:
240  Dom(Space& home, bool share, Dom<Card>& p);
242  Dom(Home home, ViewArray<IntView>&, ViewArray<Card>&, bool);
243  public:
245  virtual Actor* copy(Space& home, bool share);
247  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
249  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
251  virtual size_t dispose(Space& home);
253  static ExecStatus post(Home home,
255  };
256 
257 }}}
258 
259 #include <gecode/int/gcc/post.hpp>
260 #include <gecode/int/gcc/val.hpp>
261 #include <gecode/int/gcc/bnd.hpp>
262 #include <gecode/int/gcc/dom.hpp>
263 
264 #endif
265 
266 
267 // STATISTICS: int-prop
268 
Bnd(Space &home, bool share, Bnd< Card > &p)
Constructor for cloning p.
Definition: bnd.hpp:60
ViewArray< Card > k
Array containing either fixed cardinalities or CardViews.
Definition: gcc.hh:72
Value consistent global cardinality propagator.
Definition: gcc.hh:67
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: bnd.hpp:79
Container class provding information about the Hall structure of the problem variables.
Definition: bnd-sup.hpp:460
static ExecStatus post(Home home, ViewArray< IntView > &x, ViewArray< Card > &k)
Post propagator for views x and cardinalities k.
Definition: val.hpp:284
bool card_fixed
Stores whether cardinalities are all assigned.
Definition: gcc.hh:238
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost funtion.
Definition: bnd.hpp:85
ViewArray< Card > k
Array containing either fixed cardinalities or CardViews.
Definition: gcc.hh:122
Val(Home home, ViewArray< IntView > &x, ViewArray< Card > &k)
Constructor for posting.
Definition: val.hpp:47
Base-class for propagators.
Definition: core.hpp:755
PartialSum< Card > lps
Data structure storing the sum of the views lower bounds Necessary for reasoning about the interval c...
Definition: gcc.hh:128
ViewArray< Card > k
Array containing either fixed cardinalities or CardViews.
Definition: gcc.hh:229
Computation spaces.
Definition: core.hpp:1362
Base-class for both propagators and branchers.
Definition: core.hpp:666
ViewArray< IntView > x
Views on which to perform value-propagation.
Definition: gcc.hh:70
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: dom.hpp:101
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
virtual size_t dispose(Space &home)
Destructor.
Definition: val.hpp:64
PartialSum< Card > ups
Data structure storing the sum of the views upper bounds.
Definition: gcc.hh:130
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: dom.hpp:107
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost funtion returning high linear.
Definition: val.hpp:79
static ExecStatus post(Home home, ViewArray< IntView > &x, ViewArray< Card > &k)
Post propagator for views x and cardinalities k.
Definition: dom.hpp:296
Domain consistent global cardinality propagator.
Definition: gcc.hh:219
virtual size_t dispose(Space &home)
Destructor.
Definition: bnd.hpp:70
Dom(Space &home, bool share, Dom< Card > &p)
Constructor for cloning p.
Definition: dom.hpp:83
ModEventDelta med
A set of modification events (used during propagation)
Definition: core.hpp:764
ExecStatus ubc(Space &home, int &nb, HallInfo hall[], Rank rank[], int mu[], int nu[])
Upper Bounds constraint (UBC) stating Hence the ubc constraints the variables such that no value occ...
Definition: bnd.hpp:401
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: val.hpp:278
static ExecStatus post(Home home, ViewArray< IntView > &x, ViewArray< Card > &k)
Post propagator for views x and cardinalities k.
Definition: bnd.hpp:805
virtual size_t dispose(Space &home)
Destructor.
Definition: dom.hpp:92
ExecStatus pruneCards(Space &home)
Prune cardinality variables with 0 maximum occurrence.
Definition: bnd.hpp:559
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: val.hpp:73
Maps domain bounds to their position in hall[].bounds.
Definition: bnd-sup.hpp:158
Propagation cost.
Definition: core.hpp:537
ExecStatus
Definition: core.hpp:523
ViewArray< IntView > y
Views used to channel information between x and k ( ).
Definition: gcc.hh:227
Partial sum structure for constant time computation of the maximal capacity of an interval...
Definition: bnd-sup.hpp:241
Variable-value-graph used during propagation.
Definition: dom-sup.hpp:391
ViewArray< IntView > y
Views on which to perform value-propagation (subset of x)
Definition: gcc.hh:120
Gecode toplevel namespace
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: bnd.hpp:593
ViewArray< IntView > x
Views on which to perform bounds-propagation.
Definition: gcc.hh:118
bool skip_lbc
Stores whether the minium required occurences of the cardinalities are all zero. If so...
Definition: gcc.hh:143
int ModEventDelta
Modification event deltas.
Definition: core.hpp:173
Home class for posting propagators
Definition: core.hpp:717
Bounds consistent global cardinality propagator.
Definition: gcc.hh:115
VarValGraph< Card > * vvg
Propagation is performed on a variable-value graph (used as cache)
Definition: gcc.hh:231
bool card_fixed
Stores whether cardinalities are all assigned.
Definition: gcc.hh:137
ExecStatus lbc(Space &home, int &nb, HallInfo hall[], Rank rank[], int mu[], int nu[])
Lower Bounds constraint (LBC) stating Hence the lbc constraints the variables such that every value ...
Definition: bnd.hpp:97
ViewArray< IntView > x
Views on which to perform domain-propagation.
Definition: gcc.hh:222
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: dom.hpp:113