dom.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
* Guido Tack <tack@gecode.org>
*
* Copyright:
* Christian Schulte, 2004
* Guido Tack, 2004
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __GECODE_INT_DOM_HH__
#define __GECODE_INT_DOM_HH__
#include <gecode/int.hh>
#include <gecode/int/rel.hh>
namespace Gecode { namespace Int { namespace Dom {
template<class View, ReifyMode rm>
class ReRange : public ReUnaryPropagator<View,PC_INT_DOM,BoolView> {
protected:
using ReUnaryPropagator<View,PC_INT_DOM,BoolView>::x0;
using ReUnaryPropagator<View,PC_INT_DOM,BoolView>::b;
int min;
int max;
ReRange(Space& home, ReRange& p);
ReRange(Home home, View x, int min, int max, BoolView b);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, View x, int min, int max, BoolView b);
};
template<class View, ReifyMode rm>
class ReIntSet : public ReUnaryPropagator<View,PC_INT_DOM,BoolView> {
protected:
using ReUnaryPropagator<View,PC_INT_DOM,BoolView>::x0;
using ReUnaryPropagator<View,PC_INT_DOM,BoolView>::b;
IntSet is;
ReIntSet(Space& home, ReIntSet& p);
ReIntSet(Home home, View x, const IntSet& s, BoolView b);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, View x, const IntSet& s, BoolView b);
virtual size_t dispose(Space& home);
};
}}}
#include <gecode/int/dom/range.hpp>
#include <gecode/int/dom/set.hpp>
#endif
// STATISTICS: int-prop
Gecode::ActorLink::Actor
friend class Actor
Definition core.hpp:590
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::IntSet
Integer sets.
Definition int.hh:174
Gecode::Int::BoolView
Boolean view for Boolean variables.
Definition view.hpp:1380
Gecode::Int::Dom::ReIntSet::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition set.hpp:93
Gecode::Int::Dom::ReIntSet::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition set.hpp:87
Gecode::Int::Dom::ReIntSet::ReIntSet
ReIntSet(Space &home, ReIntSet &p)
Constructor for cloning p.
Definition set.hpp:81
Gecode::Int::Dom::ReIntSet::is
IntSet is
Domain
Definition dom.hh:90
Gecode::Int::Dom::ReIntSet::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition set.hpp:46
Gecode::Int::Dom::ReIntSet::post
static ExecStatus post(Home home, View x, const IntSet &s, BoolView b)
Post propagator for .
Definition set.hpp:55
Gecode::Int::Dom::ReRange::min
int min
Minimum of range.
Definition dom.hh:61
Gecode::Int::Dom::ReRange::max
int max
Maximum of range.
Definition dom.hh:63
Gecode::Int::Dom::ReRange::post
static ExecStatus post(Home home, View x, int min, int max, BoolView b)
Post propagator for .
Definition range.hpp:46
Gecode::Int::Dom::ReRange::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition range.hpp:88
Gecode::Int::Dom::ReRange::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition range.hpp:82
Gecode::Int::Dom::ReRange::ReRange
ReRange(Space &home, ReRange &p)
Constructor for cloning p.
Definition range.hpp:76
Gecode::Int::ReUnaryPropagator< View, PC_INT_DOM, BoolView >::b
BoolView b
Definition propagator.hpp:59
Gecode::Int::ReUnaryPropagator< View, PC_INT_DOM, BoolView >::ReUnaryPropagator
ReUnaryPropagator(Space &home, ReUnaryPropagator &p)
Gecode::Int::ReUnaryPropagator< View, PC_INT_DOM, BoolView >::x0
View x0
Definition propagator.hpp:57
Gecode::Propagator::Space
friend class Space
Definition core.hpp:1066
Gecode::Propagator::med
ModEventDelta med
A set of modification events (used during propagation).
Definition core.hpp:1075
Gecode::View
set.hpp
int.hh
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
rel.hh
Gecode::Int::Dom
Domain propagators.
Gecode::Int
Finite domain integers.
Gecode::Int::PC_INT_DOM
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition var-type.hpp:100
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
range.hpp