rel-op.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
* Christian Schulte <schulte@gecode.org>
*
* Contributing authors:
* Gabor Szokoli <szokoli@gecode.org>
*
* Copyright:
* Guido Tack, 2004
* Christian Schulte, 2004
* Gabor Szokoli, 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_SET_RELOP_HH__
#define __GECODE_SET_RELOP_HH__
#include <gecode/set.hh>
#include <gecode/set/rel.hh>
namespace Gecode { namespace Set { namespace RelOp {
template<class View0, class View1, class View2>
class SuperOfInter :
public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_CLUB> {
protected:
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_CLUB>::x0;
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_CLUB>::x1;
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_CLUB>::x2;
SuperOfInter(Space& home, SuperOfInter& p);
SuperOfInter(Home home, View0, View1, View2);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, View0 x, View1 y, View2 z);
};
template<class View0, class View1, class View2>
class SubOfUnion :
public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY> {
protected:
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY>::x0;
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY>::x1;
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY>::x2;
SubOfUnion(Space& home, SubOfUnion& p);
SubOfUnion(Home home, View0, View1, View2);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home,View0 x,View1 y,View2 z);
};
template<class View0, class View1, class View2>
class Intersection:
public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY> {
protected:
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY>::x0;
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY>::x1;
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY>::x2;
Intersection(Space& home, Intersection& p);
Intersection(Home home,View0,View1,View2);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home,View0 x,View1 y,View2 z);
};
template<class View0, class View1, class View2>
class Union:
public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY> {
protected:
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY>::x0;
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY>::x1;
using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
View2,PC_SET_ANY>::x2;
Union(Space& home, Union& p);
Union(Home home, View0, View1, View2);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home,View0 x,View1 y,View2 z);
};
template<class View0, class View1>
class IntersectionN :
public MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY> {
protected:
using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
bool shared;
LUBndSet intOfDets;
IntersectionN(Space& home, IntersectionN& p);
IntersectionN(Home home, ViewArray<View0>&, View1);
IntersectionN(Home home, ViewArray<View0>&, const IntSet&, View1);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
static ExecStatus post(Home home,ViewArray<View0>& y,
const IntSet& z,View1 x);
};
template<class View0, class View1>
class UnionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
View1,PC_SET_ANY> {
protected:
using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
bool shared;
GLBndSet unionOfDets;
UnionN(Space& home, UnionN& p);
UnionN(Home home,ViewArray<View0>&,View1);
UnionN(Home home,ViewArray<View0>&,const IntSet&,View1);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
static ExecStatus post(Home home,ViewArray<View0>& y,
const IntSet& z,View1 x);
};
template<class View0, class View1>
class PartitionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
View1,PC_SET_ANY> {
protected:
using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
bool shared;
GLBndSet unionOfDets;
PartitionN(Space& home, PartitionN& p);
PartitionN(Home home, ViewArray<View0>&, View1);
PartitionN(Home home, ViewArray<View0>&, const IntSet&, View1);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
static ExecStatus post(Home home,ViewArray<View0>& y,
const IntSet& z,View1 x);
};
}}}
#include <gecode/set/rel-op/common.hpp>
#include <gecode/set/rel-op/superofinter.hpp>
#include <gecode/set/rel-op/subofunion.hpp>
#include <gecode/set/rel-op/inter.hpp>
#include <gecode/set/rel-op/union.hpp>
#include <gecode/set/rel-op/partition.hpp>
#include <gecode/set/rel-op/post.hpp>
#endif
// STATISTICS: set-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::MixNaryOnePropagator< View0, PC_SET_ANY, View1, PC_SET_ANY >::MixNaryOnePropagator
MixNaryOnePropagator(Space &home, MixNaryOnePropagator &p)
Definition pattern.hpp:733
Gecode::MixNaryOnePropagator< View0, PC_SET_ANY, View1, PC_SET_ANY >::x
ViewArray< View0 > x
Definition pattern.hpp:275
Gecode::MixNaryOnePropagator< View0, PC_SET_ANY, View1, PC_SET_ANY >::y
View1 y
Definition pattern.hpp:277
Gecode::MixTernaryPropagator< View0, PC_SET_ANY, View1, PC_SET_ANY, View2, PC_SET_CLUB >::x0
View0 x0
Definition pattern.hpp:240
Gecode::MixTernaryPropagator< View0, PC_SET_ANY, View1, PC_SET_ANY, View2, PC_SET_CLUB >::x1
View1 x1
Definition pattern.hpp:242
Gecode::MixTernaryPropagator< View0, PC_SET_ANY, View1, PC_SET_ANY, View2, PC_SET_CLUB >::x2
View2 x2
Definition pattern.hpp:244
Gecode::MixTernaryPropagator< View0, PC_SET_ANY, View1, PC_SET_ANY, View2, PC_SET_CLUB >::MixTernaryPropagator
MixTernaryPropagator(Space &home, MixTernaryPropagator &p)
Definition pattern.hpp:661
Gecode::PropCost
Propagation cost.
Definition core.hpp:486
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::Set::GLBndSet
Growing sets of integers.
Definition var-imp.hpp:205
Gecode::Set::LUBndSet
Shrinking sets of integers.
Definition var-imp.hpp:243
Gecode::Set::RelOp::IntersectionN::intOfDets
LUBndSet intOfDets
Intersection of the determined (which are dropped).
Definition rel-op.hh:190
Gecode::Set::RelOp::IntersectionN::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition inter.hpp:267
Gecode::Set::RelOp::IntersectionN::post
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
Definition inter.hpp:235
Gecode::Set::RelOp::IntersectionN::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition inter.hpp:261
Gecode::Set::RelOp::IntersectionN::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition inter.hpp:273
Gecode::Set::RelOp::IntersectionN::shared
bool shared
Whether the any views share a variable implementation.
Definition rel-op.hh:188
Gecode::Set::RelOp::IntersectionN::IntersectionN
IntersectionN(Space &home, IntersectionN &p)
Constructor for cloning p.
Definition inter.hpp:225
Gecode::Set::RelOp::Intersection::post
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
Definition inter.hpp:48
Gecode::Set::RelOp::Intersection::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition inter.hpp:56
Gecode::Set::RelOp::Intersection::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition inter.hpp:62
Gecode::Set::RelOp::Intersection::Intersection
Intersection(Space &home, Intersection &p)
Constructor for cloning p.
Definition inter.hpp:193
Gecode::Set::RelOp::PartitionN::shared
bool shared
Whether the any views share a variable implementation.
Definition rel-op.hh:261
Gecode::Set::RelOp::PartitionN::PartitionN
PartitionN(Space &home, PartitionN &p)
Constructor for cloning p.
Definition partition.hpp:66
Gecode::Set::RelOp::PartitionN::unionOfDets
GLBndSet unionOfDets
Union of the determined (which are dropped).
Definition rel-op.hh:263
Gecode::Set::RelOp::PartitionN::post
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
Definition partition.hpp:79
Gecode::Set::RelOp::PartitionN::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition partition.hpp:74
Gecode::Set::RelOp::PartitionN::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition partition.hpp:107
Gecode::Set::RelOp::PartitionN::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition partition.hpp:101
Gecode::Set::RelOp::SubOfUnion::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition subofunion.hpp:50
Gecode::Set::RelOp::SubOfUnion::SubOfUnion
SubOfUnion(Space &home, SubOfUnion &p)
Constructor for cloning p.
Definition subofunion.hpp:149
Gecode::Set::RelOp::SubOfUnion::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition subofunion.hpp:44
Gecode::Set::RelOp::SubOfUnion::post
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
Definition subofunion.hpp:155
Gecode::Set::RelOp::SuperOfInter::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition superofinter.hpp:66
Gecode::Set::RelOp::SuperOfInter::post
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
Definition superofinter.hpp:58
Gecode::Set::RelOp::SuperOfInter::SuperOfInter
SuperOfInter(Space &home, SuperOfInter &p)
Constructor for cloning p.
Definition superofinter.hpp:52
Gecode::Set::RelOp::SuperOfInter::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition superofinter.hpp:72
Gecode::Set::RelOp::UnionN::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition union.hpp:260
Gecode::Set::RelOp::UnionN::post
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
Definition union.hpp:235
Gecode::Set::RelOp::UnionN::unionOfDets
GLBndSet unionOfDets
Union of the determined (which are dropped).
Definition rel-op.hh:226
Gecode::Set::RelOp::UnionN::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition union.hpp:266
Gecode::Set::RelOp::UnionN::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition union.hpp:229
Gecode::Set::RelOp::UnionN::shared
bool shared
Whether the any views share a variable implementation.
Definition rel-op.hh:224
Gecode::Set::RelOp::UnionN::UnionN
UnionN(Space &home, UnionN &p)
Constructor for cloning p.
Definition union.hpp:221
Gecode::Set::RelOp::Union::post
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
Definition union.hpp:61
Gecode::Set::RelOp::Union::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition union.hpp:69
Gecode::Set::RelOp::Union::Union
Union(Space &home, Union &p)
Constructor for cloning p.
Definition union.hpp:55
Gecode::Set::RelOp::Union::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition union.hpp:75
Gecode::ViewArray
View arrays.
Definition array.hpp:253
set.hh
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode::Set::RelOp
Standard set operation propagators.
Definition rel-op.hh:46
Gecode::Set
Finite integer sets.
Definition var-imp.hpp:137
Gecode::Set::PC_SET_CLUB
const Gecode::PropCond PC_SET_CLUB
Propagate when the cardinality or the least upper bound of a view changes.
Definition var-type.hpp:227
Gecode::Set::PC_SET_ANY
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Definition var-type.hpp:248
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
partition.hpp
common.hpp
inter.hpp
union.hpp
post.hpp
rel.hh
subofunion.hpp
superofinter.hpp