this repo has no description
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 *
7 * Copyright:
8 * Christian Schulte, 2004
9 * Guido Tack, 2004
10 *
11 * This file is part of Gecode, the generic constraint
12 * development environment:
13 * http://www.gecode.org
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining
16 * a copy of this software and associated documentation files (the
17 * "Software"), to deal in the Software without restriction, including
18 * without limitation the rights to use, copy, modify, merge, publish,
19 * distribute, sublicense, and/or sell copies of the Software, and to
20 * permit persons to whom the Software is furnished to do so, subject to
21 * the following conditions:
22 *
23 * The above copyright notice and this permission notice shall be
24 * included in all copies or substantial portions of the Software.
25 *
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 *
34 */
35
36#ifndef GECODE_INT_DOM_HH
37#define GECODE_INT_DOM_HH
38
39#include <gecode/int.hh>
40#include <gecode/int/rel.hh>
41
42/**
43 * \namespace Gecode::Int::Dom
44 * \brief Domain propagators
45 */
46
47namespace Gecode { namespace Int { namespace Dom {
48
49 /**
50 * \brief Reified range dom-propagator
51 *
52 * Requires \code #include <gecode/int/dom.hh> \endcode
53 * \ingroup FuncIntProp
54 */
55 template<class View, ReifyMode rm>
56 class ReRange : public ReUnaryPropagator<View,PC_INT_DOM,BoolView> {
57 protected:
58 using ReUnaryPropagator<View,PC_INT_DOM,BoolView>::x0;
59 using ReUnaryPropagator<View,PC_INT_DOM,BoolView>::b;
60 /// Minimum of range
61 int min;
62 /// Maximum of range
63 int max;
64 /// Constructor for cloning \a p
65 ReRange(Space& home, ReRange& p);
66 /// Constructor for creation
67 ReRange(Home home, View x, int min, int max, BoolView b);
68 public:
69 /// Copy propagator during cloning
70 virtual Actor* copy(Space& home);
71 /// Perform propagation
72 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
73 /// Post propagator for \f$ (l\leq x \leq m) \Leftrightarrow b\f$
74 static ExecStatus post(Home home, View x, int min, int max, BoolView b);
75 };
76
77 /**
78 * \brief Reified domain dom-propagator
79 *
80 * Requires \code #include <gecode/int/dom.hh> \endcode
81 * \ingroup FuncIntProp
82 */
83 template<class View, ReifyMode rm>
84 class ReIntSet : public ReUnaryPropagator<View,PC_INT_DOM,BoolView> {
85 protected:
86 using ReUnaryPropagator<View,PC_INT_DOM,BoolView>::x0;
87 using ReUnaryPropagator<View,PC_INT_DOM,BoolView>::b;
88
89 /// %Domain
90 IntSet is;
91 /// Constructor for cloning \a p
92 ReIntSet(Space& home, ReIntSet& p);
93 /// Constructor for creation
94 ReIntSet(Home home, View x, const IntSet& s, BoolView b);
95 public:
96 /// Copy propagator during cloning
97 virtual Actor* copy(Space& home);
98 /// Perform propagation
99 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
100 /// Post propagator for \f$ (x \in d) \Leftrightarrow b\f$
101 static ExecStatus post(Home home, View x, const IntSet& s, BoolView b);
102 /// Delete propagator and return its size
103 virtual size_t dispose(Space& home);
104 };
105
106}}}
107
108#include <gecode/int/dom/range.hpp>
109#include <gecode/int/dom/set.hpp>
110
111#endif
112
113// STATISTICS: int-prop
114