view.hpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
*
* Contributing authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Guido Tack, 2004
* Christian Schulte, 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.
*
*/
#include <iostream>
namespace Gecode { namespace Set {
class SetView : public VarImpView<SetVar> {
protected:
using VarImpView<SetVar>::x;
public:
SetView(void);
SetView(const SetVar& y);
SetView(SetVarImp* y);
unsigned int cardMin(void) const;
unsigned int cardMax(void) const;
int lubMin(void) const;
int lubMax(void) const;
int lubMinN(unsigned int n) const;
int glbMin(void) const;
int glbMax(void) const;
unsigned int glbSize(void) const;
unsigned int lubSize(void) const;
unsigned int unknownSize(void) const;
bool contains(int i) const;
bool notContains(int i) const;
ModEvent cardMin(Space& home, unsigned int m);
ModEvent cardMax(Space& home, unsigned int m);
ModEvent include(Space& home,int i,int j);
ModEvent exclude(Space& home,int i,int j);
ModEvent include(Space& home,int i);
ModEvent exclude(Space& home,int i);
ModEvent intersect(Space& home,int i,int j);
ModEvent intersect(Space& home,int i);
template<class I> ModEvent excludeI(Space& home, I& i);
template<class I> ModEvent includeI(Space& home, I& i);
template<class I> ModEvent intersectI(Space& home, I& iter);
static ModEvent modevent(const Delta& d);
int glbMin(const Delta& d) const;
int glbMax(const Delta& d) const;
bool glbAny(const Delta& d) const;
int lubMin(const Delta& d) const;
int lubMax(const Delta& d) const;
bool lubAny(const Delta& d) const;
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const SetView& x);
// Forward declarations for friends
class ConstSetView;
bool operator ==(const ConstSetView&, const ConstSetView&);
bool operator !=(const ConstSetView&, const ConstSetView&);
class ConstSetView : public ConstView<SetView> {
friend class LubRanges<ConstSetView>;
friend class GlbRanges<ConstSetView>;
friend bool Gecode::Set::operator ==(const Gecode::Set::ConstSetView&,
const Gecode::Set::ConstSetView&);
friend bool Gecode::Set::operator !=(const Gecode::Set::ConstSetView&,
const Gecode::Set::ConstSetView&);
private:
int *ranges;
int size;
unsigned int domSize;
public:
ConstSetView(void);
ConstSetView(Space& home, const IntSet& s);
unsigned int cardMin(void) const;
unsigned int cardMax(void) const;
int lubMin(void) const;
int lubMax(void) const;
int lubMinN(unsigned int n) const;
int glbMin(void) const;
int glbMax(void) const;
unsigned int glbSize(void) const;
unsigned int lubSize(void) const;
unsigned int unknownSize(void) const;
bool contains(int i) const;
bool notContains(int i) const;
ModEvent cardMin(Space& home, unsigned int m);
ModEvent cardMax(Space& home, unsigned int m);
ModEvent include(Space& home,int i,int j);
ModEvent exclude(Space& home,int i,int j);
ModEvent include(Space& home,int i);
ModEvent exclude(Space& home,int i);
ModEvent intersect(Space& home,int i,int j);
ModEvent intersect(Space& home,int i);
template<class I> ModEvent excludeI(Space& home, I& i);
template<class I> ModEvent includeI(Space& home, I& i);
template<class I> ModEvent intersectI(Space& home, I& iter);
void update(Space& home, ConstSetView& y);
int glbMin(const Delta& d) const;
int glbMax(const Delta& d) const;
bool glbAny(const Delta& d) const;
int lubMin(const Delta& d) const;
int lubMax(const Delta& d) const;
bool lubAny(const Delta& d) const;
bool operator <(const ConstSetView& y) const;
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const ConstSetView& x);
bool operator ==(const ConstSetView& x, const ConstSetView& y);
bool operator !=(const ConstSetView& x, const ConstSetView& y);
class EmptyView : public ConstView<SetView> {
public:
EmptyView(void);
unsigned int cardMin(void) const;
unsigned int cardMax(void) const;
int lubMin(void) const;
int lubMax(void) const;
int lubMinN(unsigned int n) const;
int glbMin(void) const;
int glbMax(void) const;
unsigned int glbSize(void) const;
unsigned int lubSize(void) const;
unsigned int unknownSize(void) const;
bool contains(int i) const;
bool notContains(int i) const;
ModEvent cardMin(Space& home, unsigned int m);
ModEvent cardMax(Space& home, unsigned int m);
ModEvent include(Space& home,int i,int j);
ModEvent exclude(Space& home,int i,int j);
ModEvent include(Space& home,int i);
ModEvent exclude(Space& home,int i);
ModEvent intersect(Space& home,int i,int j);
ModEvent intersect(Space& home,int i);
template<class I> ModEvent excludeI(Space& home, I& i);
template<class I> ModEvent includeI(Space& home, I& i);
template<class I> ModEvent intersectI(Space& home, I& iter);
int glbMin(const Delta& d) const;
int glbMax(const Delta& d) const;
bool glbAny(const Delta& d) const;
int lubMin(const Delta& d) const;
int lubMax(const Delta& d) const;
bool lubAny(const Delta& d) const;
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const EmptyView& x);
bool operator ==(const EmptyView& x, const EmptyView& y);
bool operator !=(const EmptyView& x, const EmptyView& y);
class UniverseView : public ConstView<SetView> {
public:
UniverseView(void);
unsigned int cardMin(void) const;
unsigned int cardMax(void) const;
int lubMin(void) const;
int lubMax(void) const;
int lubMinN(unsigned int n) const;
int glbMin(void) const;
int glbMax(void) const;
unsigned int glbSize(void) const;
unsigned int lubSize(void) const;
unsigned int unknownSize(void) const;
bool contains(int i) const;
bool notContains(int i) const;
ModEvent cardMin(Space& home, unsigned int m);
ModEvent cardMax(Space& home, unsigned int m);
ModEvent include(Space& home,int i,int j);
ModEvent exclude(Space& home,int i,int j);
ModEvent include(Space& home,int i);
ModEvent exclude(Space& home,int i);
ModEvent intersect(Space& home,int i,int j);
ModEvent intersect(Space& home,int i);
template<class I> ModEvent excludeI(Space& home, I& i);
template<class I> ModEvent includeI(Space& home, I& i);
template<class I> ModEvent intersectI(Space& home, I& iter);
int glbMin(const Delta& d) const;
int glbMax(const Delta& d) const;
bool glbAny(const Delta& d) const;
int lubMin(const Delta& d) const;
int lubMax(const Delta& d) const;
bool lubAny(const Delta& d) const;
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const UniverseView& x);
bool operator ==(const UniverseView& x, const UniverseView& y);
bool operator !=(const UniverseView& x, const UniverseView& y);
class SingletonView : public DerivedView<Gecode::Int::IntView> {
protected:
using DerivedView<Gecode::Int::IntView>::x;
static PropCond pc_settoint(PropCond pc);
static ModEvent me_inttoset(ModEvent me);
static ModEvent me_settoint(ModEvent me);
public:
SingletonView(void);
SingletonView(Gecode::Int::IntView& y);
SingletonView(const Gecode::IntVar& y);
unsigned int cardMin(void) const;
unsigned int cardMax(void) const;
int lubMin(void) const;
int lubMax(void) const;
int lubMinN(unsigned int n) const;
int glbMin(void) const;
int glbMax(void) const;
unsigned int glbSize(void) const;
unsigned int lubSize(void) const;
unsigned int unknownSize(void) const;
bool contains(int i) const;
bool notContains(int i) const;
ModEvent cardMin(Space& home, unsigned int m);
ModEvent cardMax(Space& home, unsigned int m);
ModEvent include(Space& home,int i,int j);
ModEvent exclude(Space& home,int i,int j);
ModEvent include(Space& home,int i);
ModEvent exclude(Space& home,int i);
ModEvent intersect(Space& home,int i,int j);
ModEvent intersect(Space& home,int i);
template<class I> ModEvent excludeI(Space& home, I& i);
template<class I> ModEvent includeI(Space& home, I& i);
template<class I> ModEvent intersectI(Space& home, I& iter);
static void schedule(Space& home, Propagator& p, ModEvent me);
static ModEvent me(const ModEventDelta& med);
static ModEventDelta med(ModEvent);
void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
void cancel(Space& home, Propagator& p, PropCond pc);
void reschedule(Space& home, Propagator& p, PropCond pc);
void subscribe(Space& home, Advisor& a);
void cancel(Space& home, Advisor& a);
static ModEvent modevent(const Delta& d);
int glbMin(const Delta& d) const;
int glbMax(const Delta& d) const;
bool glbAny(const Delta& d) const;
int lubMin(const Delta& d) const;
int lubMax(const Delta& d) const;
bool lubAny(const Delta& d) const;
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const SingletonView& x);
bool operator ==(const SingletonView& x, const SingletonView& y);
bool operator !=(const SingletonView& x, const SingletonView& y);
template<class View>
class ComplementView : public DerivedView<View> {
protected:
using DerivedView<View>::x;
public:
static PropCond pc_negateset(PropCond pc);
static ModEvent me_negateset(ModEvent me);
ComplementView(void);
explicit ComplementView(View& y);
unsigned int cardMin(void) const;
unsigned int cardMax(void) const;
int lubMin(void) const;
int lubMax(void) const;
int lubMinN(unsigned int n) const;
int glbMin(void) const;
int glbMax(void) const;
unsigned int glbSize(void) const;
unsigned int lubSize(void) const;
unsigned int unknownSize(void) const;
bool contains(int i) const;
bool notContains(int i) const;
ModEvent cardMin(Space& home, unsigned int m);
ModEvent cardMax(Space& home, unsigned int m);
ModEvent include(Space& home,int i,int j);
ModEvent exclude(Space& home,int i,int j);
ModEvent include(Space& home,int i);
ModEvent exclude(Space& home,int i);
ModEvent intersect(Space& home,int i,int j);
ModEvent intersect(Space& home,int i);
template<class I> ModEvent excludeI(Space& home, I& i);
template<class I> ModEvent includeI(Space& home, I& i);
template<class I> ModEvent intersectI(Space& home, I& iter);
static void schedule(Space& home, Propagator& p, ModEvent me);
static ModEvent me(const ModEventDelta& med);
static ModEventDelta med(ModEvent);
void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
void cancel(Space& home, Propagator& p, PropCond pc);
void subscribe(Space& home, Advisor& a);
void cancel(Space& home, Advisor& a);
static ModEvent modevent(const Delta& d);
int glbMin(const Delta& d) const;
int glbMax(const Delta& d) const;
bool glbAny(const Delta& d) const;
int lubMin(const Delta& d) const;
int lubMax(const Delta& d) const;
bool lubAny(const Delta& d) const;
};
template<class Char, class Traits, class View>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os,
const ComplementView<View>& x);
template<class View>
bool operator ==(const ComplementView<View>& x,
const ComplementView<View>& y);
template<class View>
bool operator !=(const ComplementView<View>& x,
const ComplementView<View>& y);
template<class View> class LubDiffRanges;
template<class View> class GlbDiffRanges;
template<class View>
class CachedView : public DerivedView<View> {
friend class LubDiffRanges<View>;
friend class GlbDiffRanges<View>;
protected:
using DerivedView<View>::x;
LUBndSet lubCache;
GLBndSet glbCache;
public:
CachedView(void);
explicit CachedView(const View& y);
unsigned int cardMin(void) const;
unsigned int cardMax(void) const;
int lubMin(void) const;
int lubMax(void) const;
int lubMinN(unsigned int n) const;
int glbMin(void) const;
int glbMax(void) const;
unsigned int glbSize(void) const;
unsigned int lubSize(void) const;
unsigned int unknownSize(void) const;
bool contains(int i) const;
bool notContains(int i) const;
ModEvent cardMin(Space& home, unsigned int m);
ModEvent cardMax(Space& home, unsigned int m);
ModEvent include(Space& home,int i,int j);
ModEvent exclude(Space& home,int i,int j);
ModEvent include(Space& home,int i);
ModEvent exclude(Space& home,int i);
ModEvent intersect(Space& home,int i,int j);
ModEvent intersect(Space& home,int i);
template<class I> ModEvent excludeI(Space& home, I& i);
template<class I> ModEvent includeI(Space& home, I& i);
template<class I> ModEvent intersectI(Space& home, I& iter);
static void schedule(Space& home, Propagator& p, ModEvent me);
static ModEvent me(const ModEventDelta& med);
static ModEventDelta med(ModEvent);
void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
void cancel(Space& home, Propagator& p, PropCond pc);
void subscribe(Space& home, Advisor& a);
void cancel(Space& home, Advisor& a);
static ModEvent modevent(const Delta& d);
int glbMin(const Delta& d) const;
int glbMax(const Delta& d) const;
bool glbAny(const Delta& d) const;
int lubMin(const Delta& d) const;
int lubMax(const Delta& d) const;
bool lubAny(const Delta& d) const;
void initCache(Space& home, const IntSet& glb, const IntSet& lub);
void cacheGlb(Space& home);
void cacheLub(Space& home);
bool glbModified(void) const;
bool lubModified(void) const;
void update(Space& home, CachedView<View>& y);
};
template<class Char, class Traits, class View>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os,
const CachedView<View>& x);
template<class View>
bool operator ==(const CachedView<View>& x, const CachedView<View>& y);
template<class View>
bool operator !=(const CachedView<View>& x, const CachedView<View>& y);
template<class View>
class GlbDiffRanges
: public Iter::Ranges::Diff<GlbRanges<View>,BndSetRanges> {
protected:
GlbRanges<View> gr;
BndSetRanges cr;
public:
GlbDiffRanges(const CachedView<View>& x);
};
template<class View>
class LubDiffRanges
: public Iter::Ranges::Diff<BndSetRanges,LubRanges<View> > {
protected:
BndSetRanges cr;
LubRanges<View> lr;
public:
LubDiffRanges(const CachedView<View>& x);
};
}}
#include <gecode/set/var/set.hpp>
#include <gecode/set/view/set.hpp>
#include <gecode/set/view/const.hpp>
#include <gecode/set/view/singleton.hpp>
#include <gecode/set/view/complement.hpp>
#include <gecode/set/view/cached.hpp>
#include <gecode/set/view/print.hpp>
#include <gecode/set/var/print.hpp>
// STATISTICS: set-var
Gecode::Advisor
Base-class for advisors.
Definition core.hpp:1292
Gecode::ConstView
Base-class for constant views.
Definition view.hpp:45
Gecode::Delta
Generic domain change information to be supplied to advisors.
Definition core.hpp:204
Gecode::DerivedView::modevent
static ModEvent modevent(const Delta &d)
Return modification event.
Definition view.hpp:676
Gecode::DerivedView::subscribe
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
Definition view.hpp:650
Gecode::DerivedView< Gecode::Int::IntView >::x
Gecode::Int::IntView x
Definition view.hpp:238
Gecode::DerivedView< Gecode::Int::IntView >::DerivedView
DerivedView(void)
Definition view.hpp:584
Gecode::DerivedView::me
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition view.hpp:639
Gecode::DerivedView::schedule
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition view.hpp:634
Gecode::DerivedView::cancel
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to view.
Definition view.hpp:656
Gecode::FloatVal::intersect
FloatVal intersect(const FloatVal &x, const FloatVal &y)
Return intersection of x and y.
Definition val.hpp:503
Gecode::IntSet
Integer sets.
Definition int.hh:174
Gecode::IntVar
Integer variables.
Definition int.hh:371
Gecode::Int::CachedView
Cached integer view.
Definition view.hpp:1166
Gecode::Int::CachedView::initCache
void initCache(Space &home, const IntSet &s)
Initialize cache to set s.
Definition cached.hpp:307
Gecode::Int::IntView
Integer view for integer variables.
Definition view.hpp:129
Gecode::Iter::Ranges::Diff
Range iterator for computing set difference.
Definition ranges-diff.hpp:43
Gecode::Propagator
Base-class for propagators.
Definition core.hpp:1064
Gecode::SetVar
Set variables
Definition set.hh:127
Gecode::Set::BndSetRanges
Range iterator for integer sets.
Definition var-imp.hpp:185
Gecode::Set::CachedView::exclude
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j.
Definition cached.hpp:153
Gecode::Set::CachedView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Gecode::Set::CachedView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition cached.hpp:105
Gecode::Set::CachedView::include
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition cached.hpp:147
Gecode::Set::CachedView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition cached.hpp:242
Gecode::Set::CachedView::glbModified
bool glbModified(void) const
Check whether greatest lower bound cache differs from current domain.
Definition cached.hpp:304
Gecode::Set::CachedView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition cached.hpp:260
Gecode::Set::CachedView::schedule
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition cached.hpp:202
Gecode::Set::CachedView::glbCache
GLBndSet glbCache
The cached greatest lower bound.
Definition view.hpp:957
Gecode::Set::CachedView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition cached.hpp:49
Gecode::Set::CachedView::lubCache
LUBndSet lubCache
The cached least upper bound.
Definition view.hpp:955
Gecode::Set::CachedView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition cached.hpp:87
Gecode::Set::CachedView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition cached.hpp:81
Gecode::Set::CachedView::lubMinN
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Gecode::Set::CachedView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition cached.hpp:67
Gecode::Set::CachedView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition cached.hpp:75
Gecode::Set::CachedView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Gecode::Set::CachedView::cacheLub
void cacheLub(Space &home)
Update least upper bound cache to current domain.
Definition cached.hpp:297
Gecode::Set::CachedView::cacheGlb
void cacheGlb(Space &home)
Update greatest lower bound cache to current domain.
Definition cached.hpp:290
Gecode::Set::CachedView::med
static ModEventDelta med(ModEvent)
Translate modification event me to modification event delta for view.
Gecode::Set::CachedView::lubModified
bool lubModified(void) const
Check whether least upper bound cache differs from current domain.
Definition cached.hpp:310
Gecode::Set::CachedView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition cached.hpp:61
Gecode::Set::CachedView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Gecode::Set::CachedView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition cached.hpp:55
Gecode::Set::CachedView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition cached.hpp:71
Gecode::Set::CachedView::me
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition cached.hpp:207
Gecode::Set::CachedView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition cached.hpp:93
Gecode::Set::CachedView::CachedView
CachedView(const View &y)
Initialize with set view y.
Gecode::Set::CachedView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition cached.hpp:99
Gecode::Set::CachedView::update
void update(Space &home, CachedView< View > &y)
Update this view to be a clone of view y.
Gecode::Set::CachedView::CachedView
CachedView(void)
Default constructor.
Gecode::Set::ComplementView
Complement set view.
Definition view.hpp:769
Gecode::Set::ComplementView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition complement.hpp:303
Gecode::Set::ComplementView::me_negateset
static ModEvent me_negateset(ModEvent me)
Negate the modification event me.
Definition complement.hpp:53
Gecode::Set::ComplementView::include
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition complement.hpp:207
Gecode::Set::ComplementView::me
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition complement.hpp:268
Gecode::Set::ComplementView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition complement.hpp:93
Gecode::Set::ComplementView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition complement.hpp:107
Gecode::Set::ComplementView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition complement.hpp:81
Gecode::Set::ComplementView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition complement.hpp:138
Gecode::Set::ComplementView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition complement.hpp:150
Gecode::Set::ComplementView::schedule
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition complement.hpp:263
Gecode::Set::ComplementView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition complement.hpp:125
Gecode::Set::ComplementView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition complement.hpp:97
Gecode::Set::ComplementView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition complement.hpp:113
Gecode::Set::ComplementView::exclude
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j.
Definition complement.hpp:213
Gecode::Set::ComplementView::subscribe
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
Definition complement.hpp:238
Gecode::Set::ComplementView::intersect
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j.
Definition complement.hpp:199
Gecode::Set::ComplementView::pc_negateset
static PropCond pc_negateset(PropCond pc)
Negate the propagation condition pc.
Definition complement.hpp:65
Gecode::Set::ComplementView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition complement.hpp:231
Gecode::Set::ComplementView::ComplementView
ComplementView(void)
Default constructor.
Definition complement.hpp:44
Gecode::Set::ComplementView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition complement.hpp:75
Gecode::Set::ComplementView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition complement.hpp:321
Gecode::Set::ComplementView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition complement.hpp:101
Gecode::Set::ComplementView::cancel
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to view.
Definition complement.hpp:245
Gecode::Set::ComplementView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition complement.hpp:219
Gecode::Set::ComplementView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition complement.hpp:225
Gecode::Set::ComplementView::lubMinN
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Gecode::Set::ComplementView::med
static ModEventDelta med(ModEvent)
Translate modification event me to modification event delta for view.
Definition complement.hpp:274
Gecode::Set::ComplementView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition complement.hpp:87
Gecode::Set::ComplementView::modevent
static ModEvent modevent(const Delta &d)
Return modification event.
Definition complement.hpp:285
Gecode::Set::ConstSetView
Constant view.
Definition view.hpp:186
Gecode::Set::ConstSetView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition const.hpp:122
Gecode::Set::ConstSetView::lubMinN
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Gecode::Set::ConstSetView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition const.hpp:105
Gecode::Set::ConstSetView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition const.hpp:253
Gecode::Set::ConstSetView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition const.hpp:127
Gecode::Set::ConstSetView::intersect
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j.
Definition const.hpp:177
Gecode::Set::ConstSetView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition const.hpp:111
Gecode::Set::ConstSetView::operator<
bool operator<(const ConstSetView &y) const
Whether this view comes before view y (arbitray order).
Definition const.hpp:680
Gecode::Set::ConstSetView::include
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition const.hpp:183
Gecode::Set::ConstSetView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition const.hpp:102
Gecode::Set::ConstSetView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition const.hpp:138
Gecode::Set::ConstSetView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition const.hpp:205
Gecode::Set::ConstSetView::exclude
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j.
Definition const.hpp:191
Gecode::Set::ConstSetView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition const.hpp:146
Gecode::Set::ConstSetView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition const.hpp:211
Gecode::Set::ConstSetView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition const.hpp:108
Gecode::Set::ConstSetView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition const.hpp:199
Gecode::Set::ConstSetView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition const.hpp:133
Gecode::Set::ConstSetView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition const.hpp:143
Gecode::Set::ConstSetView::update
void update(Space &home, ConstSetView &y)
Update this view to be a clone of view y.
Definition const.hpp:217
Gecode::Set::ConstSetView::ConstSetView
ConstSetView(void)
Default constructor.
Definition const.hpp:81
Gecode::Set::ConstSetView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition const.hpp:268
Gecode::Set::ConstSetView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition const.hpp:130
Gecode::Set::EmptyView
Constant view for the empty set.
Definition view.hpp:336
Gecode::Set::EmptyView::EmptyView
EmptyView(void)
Default constructor.
Definition const.hpp:274
Gecode::Set::EmptyView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition const.hpp:294
Gecode::Set::EmptyView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition const.hpp:349
Gecode::Set::EmptyView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition const.hpp:288
Gecode::Set::EmptyView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition const.hpp:303
Gecode::Set::EmptyView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition const.hpp:291
Gecode::Set::EmptyView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition const.hpp:375
Gecode::Set::EmptyView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition const.hpp:300
Gecode::Set::EmptyView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition const.hpp:279
Gecode::Set::EmptyView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition const.hpp:306
Gecode::Set::EmptyView::include
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition const.hpp:337
Gecode::Set::EmptyView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition const.hpp:309
Gecode::Set::EmptyView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition const.hpp:344
Gecode::Set::EmptyView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition const.hpp:393
Gecode::Set::EmptyView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition const.hpp:297
Gecode::Set::EmptyView::exclude
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j.
Definition const.hpp:341
Gecode::Set::EmptyView::intersect
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j.
Definition const.hpp:334
Gecode::Set::EmptyView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition const.hpp:282
Gecode::Set::EmptyView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition const.hpp:354
Gecode::Set::EmptyView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition const.hpp:285
Gecode::Set::EmptyView::lubMinN
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Gecode::Set::GLBndSet
Growing sets of integers.
Definition var-imp.hpp:205
Gecode::Set::GlbDiffRanges
Range iterator for difference of greatest lower bound and cache
Definition view.hpp:1138
Gecode::Set::GlbDiffRanges::gr
GlbRanges< View > gr
Lower bound iterator.
Definition view.hpp:1141
Gecode::Set::GlbDiffRanges::GlbDiffRanges
GlbDiffRanges(const CachedView< View > &x)
Constructor.
Definition cached.hpp:393
Gecode::Set::GlbDiffRanges::cr
BndSetRanges cr
Cached lower bound.
Definition view.hpp:1143
Gecode::Set::GlbRanges
Range iterator for the greatest lower bound.
Definition var-imp.hpp:359
Gecode::Set::LUBndSet
Shrinking sets of integers.
Definition var-imp.hpp:243
Gecode::Set::LubDiffRanges
Range iterator for difference of least upper bound and cache
Definition view.hpp:1155
Gecode::Set::LubDiffRanges::lr
LubRanges< View > lr
Upper bound iterator.
Definition view.hpp:1160
Gecode::Set::LubDiffRanges::cr
BndSetRanges cr
Cached upper bound.
Definition view.hpp:1158
Gecode::Set::LubDiffRanges::LubDiffRanges
LubDiffRanges(const CachedView< View > &x)
Constructor.
Definition cached.hpp:400
Gecode::Set::LubRanges
Range iterator for the least upper bound.
Definition var-imp.hpp:317
Gecode::Set::SetVarImp
Finite integer set variable implementation.
Definition var-imp.hpp:430
Gecode::Set::SetView
Set view for set variables
Definition view.hpp:56
Gecode::Set::SetView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition set.hpp:74
Gecode::Set::SetView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition set.hpp:201
Gecode::Set::SetView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition set.hpp:188
Gecode::Set::SetView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition set.hpp:70
Gecode::Set::SetView::SetView
SetView(void)
Default constructor.
Definition set.hpp:48
Gecode::Set::SetView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition set.hpp:164
Gecode::Set::SetView::include
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition set.hpp:126
Gecode::Set::SetView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition set.hpp:106
Gecode::Set::SetView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition set.hpp:66
Gecode::Set::SetView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition set.hpp:94
Gecode::Set::SetView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition set.hpp:90
Gecode::Set::SetView::lubMinN
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Definition set.hpp:98
Gecode::Set::SetView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition set.hpp:102
Gecode::Set::SetView::modevent
static ModEvent modevent(const Delta &d)
Return modification event.
Definition set.hpp:175
Gecode::Set::SetView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition set.hpp:82
Gecode::Set::SetView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition set.hpp:86
Gecode::Set::SetView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition set.hpp:62
Gecode::Set::SetView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition set.hpp:78
Gecode::Set::SetView::intersect
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j.
Definition set.hpp:141
Gecode::Set::SetView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition set.hpp:160
Gecode::Set::SetView::exclude
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j.
Definition set.hpp:156
Gecode::Set::SetView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition set.hpp:151
Gecode::Set::SingletonView
Singleton set view.
Definition view.hpp:594
Gecode::Set::SingletonView::exclude
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j.
Definition singleton.hpp:182
Gecode::Set::SingletonView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition singleton.hpp:292
Gecode::Set::SingletonView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition singleton.hpp:107
Gecode::Set::SingletonView::intersect
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j.
Definition singleton.hpp:154
Gecode::Set::SingletonView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition singleton.hpp:114
Gecode::Set::SingletonView::reschedule
void reschedule(Space &home, Propagator &p, PropCond pc)
Re-schedule propagator p with propagation condition pc.
Definition singleton.hpp:235
Gecode::Set::SingletonView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition singleton.hpp:99
Gecode::Set::SingletonView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition singleton.hpp:123
Gecode::Set::SingletonView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition singleton.hpp:130
Gecode::Set::SingletonView::me
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition singleton.hpp:254
Gecode::Set::SingletonView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition singleton.hpp:221
Gecode::Set::SingletonView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition singleton.hpp:117
Gecode::Set::SingletonView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition singleton.hpp:283
Gecode::Set::SingletonView::lubMinN
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Gecode::Set::SingletonView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition singleton.hpp:94
Gecode::Set::SingletonView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition singleton.hpp:205
Gecode::Set::SingletonView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition singleton.hpp:126
Gecode::Set::SingletonView::cancel
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to view.
Definition singleton.hpp:231
Gecode::Set::SingletonView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition singleton.hpp:102
Gecode::Set::SingletonView::subscribe
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
Definition singleton.hpp:226
Gecode::Set::SingletonView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition singleton.hpp:111
Gecode::Set::SingletonView::SingletonView
SingletonView(void)
Default constructor.
Definition singleton.hpp:41
Gecode::Set::SingletonView::pc_settoint
static PropCond pc_settoint(PropCond pc)
Convert set variable PropCond pc to a PropCond for integer variables.
Definition singleton.hpp:52
Gecode::Set::SingletonView::include
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition singleton.hpp:177
Gecode::Set::SingletonView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition singleton.hpp:200
Gecode::Set::SingletonView::me_inttoset
static ModEvent me_inttoset(ModEvent me)
Convert integer variable ModEvent me to a ModEvent for set variables.
Definition singleton.hpp:64
Gecode::Set::SingletonView::me_settoint
static ModEvent me_settoint(ModEvent me)
Convert set variable ModEvent me to a ModEvent for integer variables.
Definition singleton.hpp:80
Gecode::Set::SingletonView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition singleton.hpp:120
Gecode::Set::SingletonView::schedule
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition singleton.hpp:250
Gecode::Set::SingletonView::modevent
static ModEvent modevent(const Delta &d)
Return modification event.
Definition singleton.hpp:272
Gecode::Set::SingletonView::med
static ModEventDelta med(ModEvent)
Translate modification event me to modification event delta for view.
Definition singleton.hpp:258
Gecode::Set::UniverseView
Constant view for the universe.
Definition view.hpp:464
Gecode::Set::UniverseView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition const.hpp:434
Gecode::Set::UniverseView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition const.hpp:465
Gecode::Set::UniverseView::exclude
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j.
Definition const.hpp:462
Gecode::Set::UniverseView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition const.hpp:431
Gecode::Set::UniverseView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition const.hpp:524
Gecode::Set::UniverseView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition const.hpp:470
Gecode::Set::UniverseView::UniverseView
UniverseView(void)
Default constructor.
Definition const.hpp:401
Gecode::Set::UniverseView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition const.hpp:481
Gecode::Set::UniverseView::include
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition const.hpp:459
Gecode::Set::UniverseView::intersect
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j.
Definition const.hpp:475
Gecode::Set::UniverseView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition const.hpp:416
Gecode::Set::UniverseView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition const.hpp:413
Gecode::Set::UniverseView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition const.hpp:506
Gecode::Set::UniverseView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition const.hpp:428
Gecode::Set::UniverseView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition const.hpp:410
Gecode::Set::UniverseView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition const.hpp:419
Gecode::Set::UniverseView::lubMinN
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Gecode::Set::UniverseView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition const.hpp:404
Gecode::Set::UniverseView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition const.hpp:407
Gecode::Set::UniverseView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition const.hpp:422
Gecode::Set::UniverseView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition const.hpp:425
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::View
Gecode::VarImpView< SetVar >::VarImpView
VarImpView(void)
Definition view.hpp:476
Gecode::VarImpView< SetVar >::x
VarImpType * x
Definition view.hpp:141
complement.hpp
const.hpp
set.hpp
set.hpp
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode::Int::operator<<
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const IdxViewArray< View > &x)
Definition idx-view.hpp:167
Gecode::Int::operator==
bool operator==(const CachedView< View > &x, const CachedView< View > &y)
Definition cached.hpp:401
Gecode::Int::operator!=
bool operator!=(const CachedView< View > &x, const CachedView< View > &y)
Definition cached.hpp:406
Gecode::Set
Finite integer sets.
Definition var-imp.hpp:137
Gecode
Gecode toplevel namespace
Gecode::PropCond
int PropCond
Type for propagation conditions.
Definition core.hpp:72
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition core.hpp:62
print.hpp
cached.hpp
print.hpp
singleton.hpp