Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
int.hh
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Guido Tack <tack@gecode.org>
5 * Christian Schulte <schulte@gecode.org>
6 *
7 * Copyright:
8 * Guido Tack, 2004
9 * Christian Schulte, 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_SET_INT_HH__
37#define __GECODE_SET_INT_HH__
38
39#include <gecode/set.hh>
40
41namespace Gecode { namespace Set { namespace Int {
42
47
54 template<class View>
55 class MinElement :
56 public MixBinaryPropagator<View,PC_SET_ANY,
57 Gecode::Int::IntView,Gecode::Int::PC_INT_BND> {
58 protected:
64 MinElement(Space& home, MinElement& p);
67 public:
69 virtual Actor* copy(Space& home);
71 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
74 };
75
82 template<class View>
84 public MixBinaryPropagator<View,PC_SET_ANY,
85 Gecode::Int::IntView,Gecode::Int::PC_INT_DOM> {
86 protected:
95 public:
97 virtual Actor* copy(Space& home);
99 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
102 };
103
110 template<class View, ReifyMode rm>
135
142 template<class View>
144 public MixBinaryPropagator<View,PC_SET_ANY,Gecode::Int::IntView,Gecode::Int::PC_INT_BND> {
145 protected:
151 MaxElement(Space& home, MaxElement& p);
154 public:
156 virtual Actor* copy(Space& home);
158 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
161 };
162
169 template<class View>
171 public MixBinaryPropagator<View,PC_SET_ANY,
172 Gecode::Int::IntView,Gecode::Int::PC_INT_DOM> {
173 protected:
182 public:
184 virtual Actor* copy(Space& home);
186 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
189 };
190
197 template<class View, ReifyMode rm>
221
228 template<class View>
229 class Card :
230 public MixBinaryPropagator<View,PC_SET_CARD,
231 Gecode::Int::IntView,Gecode::Int::PC_INT_BND> {
232 protected:
238 Card(Space& home, Card& p);
241 public:
243 virtual Actor* copy(Space& home);
245 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
248 };
249
256 template<class View>
257 class Weights : public Propagator {
258 protected:
263
268
270 Weights(Space& home, Weights& p);
272 Weights(Home home, const SharedArray<int>&, const SharedArray<int>&,
274 public:
276 virtual Actor* copy(Space& home);
278 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
280 virtual void reschedule(Space& home);
282 virtual size_t dispose(Space& home);
284 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
286 static ExecStatus post(Home home,
290 };
291
292}}}
293
297
298#endif
299
300// STATISTICS: set-prop
Home class for posting propagators
Definition core.hpp:856
Boolean view for Boolean variables.
Definition view.hpp:1380
Integer view for integer variables.
Definition view.hpp:129
Reified mixed binary propagator.
Propagation cost.
Definition core.hpp:486
friend class Space
Definition core.hpp:1068
ModEventDelta med
A set of modification events (used during propagation)
Definition core.hpp:1077
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3505
Card(Space &home, Card &p)
Constructor for cloning p.
Definition card.hpp:60
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition card.hpp:72
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition card.hpp:66
static ExecStatus post(Home home, View s, Gecode::Int::IntView x)
Post propagator for .
Definition card.hpp:51
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition minmax.hpp:417
static ExecStatus post(Home home, View s, Gecode::Int::IntView x)
Post propagator for x is the largest element of s.
Definition minmax.hpp:408
MaxElement(Space &home, MaxElement &p)
Constructor for cloning p.
Definition minmax.hpp:402
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition minmax.hpp:423
MinElement(Space &home, MinElement &p)
Constructor for cloning p.
Definition minmax.hpp:61
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition minmax.hpp:72
static ExecStatus post(Home home, View s, Gecode::Int::IntView x)
Post propagator for x is the minimal element of s.
Definition minmax.hpp:53
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition minmax.hpp:66
NotMaxElement(Space &home, NotMaxElement &p)
Constructor for cloning p.
Definition minmax.hpp:451
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition minmax.hpp:464
static ExecStatus post(Home home, View s, Gecode::Int::IntView x)
Post propagator for x is not the largest element of s.
Definition minmax.hpp:457
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition minmax.hpp:470
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition minmax.hpp:160
NotMinElement(Space &home, NotMinElement &p)
Constructor for cloning p.
Definition minmax.hpp:148
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition minmax.hpp:154
static ExecStatus post(Home home, View s, Gecode::Int::IntView x)
Post propagator for x is not the minimal element of s.
Definition minmax.hpp:141
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition minmax.hpp:580
static ExecStatus post(Home home, View s, Gecode::Int::IntView x, Gecode::Int::BoolView b)
Post reified propagator for b iff x is the largest element of s.
Definition minmax.hpp:565
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition minmax.hpp:574
ReMaxElement(Space &home, ReMaxElement &p)
Constructor for cloning p.
Definition minmax.hpp:558
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition minmax.hpp:290
static ExecStatus post(Home home, View s, Gecode::Int::IntView x, Gecode::Int::BoolView b)
Post reified propagator for b iff x is the minimal element of s.
Definition minmax.hpp:269
ReMinElement(Space &home, ReMinElement &p)
Constructor for cloning p.
Definition minmax.hpp:277
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition minmax.hpp:284
Gecode::Int::IntView y
The integer view.
Definition int.hh:267
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition weights.hpp:247
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition weights.hpp:210
SharedArray< int > weights
Weights for the elements in the upper bound.
Definition int.hh:262
View x
The set view.
Definition int.hh:265
Weights(Space &home, Weights &p)
Constructor for cloning p.
Definition weights.hpp:159
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as PC_LINEAR_LO)
Definition weights.hpp:185
static ExecStatus post(Home home, const SharedArray< int > &elements, const SharedArray< int > &weights, View x, Gecode::Int::IntView y)
Post propagator for .
Definition weights.hpp:167
SharedArray< int > elements
List of elements in the upper bound.
Definition int.hh:260
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition weights.hpp:198
virtual void reschedule(Space &home)
Schedule function.
Definition weights.hpp:191
Shared array with arbitrary number of elements.
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition var-type.hpp:91
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition var-type.hpp:100
Propagators connecting set and int variables.
Definition int.cpp:105
Finite integer sets.
Definition var-imp.hpp:137
const Gecode::PropCond PC_SET_CARD
Propagate when the cardinality of a view changes.
Definition var-type.hpp:216
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Definition var-type.hpp:248
Gecode toplevel namespace
ExecStatus
Definition core.hpp:472
Post propagator for SetVar x
Definition set.hh:773