/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* * Main authors: * Patrick Pekczynski * * Copyright: * Patrick Pekczynski, 2006 * * Last modified: * $Date: 2008-01-24 13:05:13 +0100 (Thu, 24 Jan 2008) $ by $Author: tack $ * $Revision: 5974 $ * * 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. * */ namespace Gecode { namespace CpltSet { /* * Constructors and access * */ forceinline CpltSetView::CpltSetView(void) {} forceinline CpltSetView::CpltSetView(const CpltSetVar& y) : VarViewBase(y.var()) { } /* * Set information * */ forceinline unsigned int CpltSetView::glbSize(void) const { return varimp->glbSize(); } forceinline unsigned int CpltSetView::lubSize(void) const { return varimp->lubSize(); } forceinline unsigned int CpltSetView::unknownSize(void) const { return varimp->unknownSize(); } forceinline unsigned int CpltSetView::cardMin(void) const { return varimp->cardMin(); } forceinline unsigned int CpltSetView::cardMax(void) const { return varimp->cardMax(); } forceinline int CpltSetView::lubMin(void) const { return varimp->lubMin(); } forceinline int CpltSetView::lubMax(void) const { return varimp->lubMax(); } forceinline int CpltSetView::lubMinN(int n) const { return varimp->lubMinN(n); } forceinline int CpltSetView::lubMaxN(int n) const { return varimp->lubMaxN(n); } forceinline int CpltSetView::glbMin(void) const { return varimp->glbMin(); } forceinline int CpltSetView::glbMax(void) const { return varimp->glbMax(); } /* * Bdd information * */ forceinline unsigned int CpltSetView::offset(void) const { return varimp->offset(); } forceinline unsigned int CpltSetView::tableWidth(void) const { return varimp->tableWidth(); } forceinline bdd CpltSetView::element(int i) const { return varimp->element(i); } forceinline bdd CpltSetView::elementNeg(int i) const { return varimp->elementNeg(i); } forceinline int CpltSetView::initialLubMin(void) const { return varimp->initialLubMin(); } forceinline int CpltSetView::initialLubMax(void) const { return varimp->initialLubMax(); } forceinline bdd CpltSetView::dom(void) const { return varimp->dom(); }; /* * Domain tests * */ forceinline bool CpltSetView::assigned(void) const { return varimp->assigned(); } forceinline bool CpltSetView::contains(int i) const { return (varimp->knownIn(i)); } forceinline bool CpltSetView::notContains(int i) const { return (varimp->knownOut(i)); } /* * Tells * */ forceinline ModEvent CpltSetView::cardinality(Space* home, int l, int u) { return varimp->cardinality(home, l, u); } forceinline ModEvent CpltSetView::cardMin(Space* home, unsigned int m) { return varimp->cardMin(home, m); } forceinline ModEvent CpltSetView::cardMax(Space* home, unsigned int m) { return varimp->cardMax(home, m); } forceinline ModEvent CpltSetView::include(Space* home, int from, int to) { return varimp->include(home, from, to); } forceinline ModEvent CpltSetView::include(Space* home, int n) { return varimp->include(home, n); } template ModEvent CpltSetView::includeI(Space* home, I& iter) { return varimp->includeI(home, iter); } forceinline ModEvent CpltSetView::exclude(Space* home, int from, int to) { return varimp->exclude(home, from, to); } forceinline ModEvent CpltSetView::exclude(Space* home, int n) { return varimp->exclude(home, n); } template ModEvent CpltSetView::excludeI(Space* home, I& iter) { return varimp->excludeI(home, iter); } forceinline ModEvent CpltSetView::intersect(Space* home,int from, int to) { return varimp->intersect(home,from,to); } forceinline ModEvent CpltSetView::intersect(Space* home,int n) { return varimp->intersect(home,n); } template ModEvent CpltSetView::intersectI(Space* home, I& iter) { return varimp->intersectI(home, iter); } forceinline ModEvent CpltSetView::nq(Space* home, int v) { return varimp->nq(home, v); } forceinline ModEvent CpltSetView::nq(Space* home, int a, int b) { return varimp->nq(home, a, b); } template forceinline ModEvent CpltSetView::nqI(Space* home, I& i) { return varimp->nqI(home, i); } forceinline ModEvent CpltSetView::eq(Space* home, int v) { return varimp->eq(home, v); } forceinline ModEvent CpltSetView::eq(Space* home, int a, int b) { return varimp->eq(home, a, b); } template forceinline ModEvent CpltSetView::eqI(Space* home, I& i) { return varimp->eqI(home, i); } forceinline ModEvent CpltSetView::intersect(Space* home, bdd& d) { return varimp->intersect(home, d); } /* * Cloning * */ forceinline void CpltSetView::update(Space* home, bool share, CpltSetView& y) { varimp = y.varimp->copy(home,share); } /* * Serialization * */ forceinline Reflection::Arg* CpltSetView::spec(const Space* home, Reflection::VarMap& m) const { return varimp->spec(home, m); } inline Support::Symbol CpltSetView::type(void) { return Support::Symbol("CpltSet::CpltSetView"); } /* * Delta information for advisors * */ forceinline ModEvent CpltSetView::modevent(const Delta* d) { return CpltSetVarImp::modevent(d); } /// Iterator for the values in the greatest lower bound of a CpltSetView template <> class GlbValues : public GlbValues { public: /// \name Constructors and initialization //@{ /// Default constructor GlbValues(void); /// Initialize with ranges for variable implementation \a x GlbValues(const CpltSetView& x); /// Initialize with ranges for variable implementation \a x void init(const CpltSetView& x); //@} }; forceinline GlbValues::GlbValues(void) {} forceinline GlbValues::GlbValues(const CpltSetView& x) : GlbValues(x.var()) {} forceinline void GlbValues::init(const CpltSetView& x) { GlbValues::init(x.var()); } } namespace Set { /// Range iterator for greatest lower bound of CpltSet view template <> class GlbRanges : public Set::GlbRanges { public: /// \name Constructors and initialization //@{ /// Default constructor GlbRanges(void); /// Initialize with ranges for variable implementation \a x GlbRanges(const CpltSet::CpltSetView& x); /// Initialize with ranges for variable implementation \a x void init(const CpltSet::CpltSetView& x); //@} }; forceinline GlbRanges::GlbRanges(void) {} forceinline GlbRanges::GlbRanges(const CpltSet::CpltSetView& x) : GlbRanges(x.var()) {} forceinline void GlbRanges::init(const CpltSet::CpltSetView& x) { GlbRanges::init(x.var()); } /// Range iterator for least upper bound of CpltSet view template <> class LubRanges : public Set::LubRanges { public: /// \name Constructors and initialization //@{ /// Default constructor LubRanges(void); /// Initialize with ranges for variable implementation \a x LubRanges(const CpltSet::CpltSetView& x); /// Initialize with ranges for variable implementation \a x void init(const CpltSet::CpltSetView& x); //@} }; forceinline LubRanges::LubRanges(void) {} forceinline LubRanges::LubRanges(const CpltSet::CpltSetView& x) : Set::LubRanges(x.var()) {} forceinline void LubRanges::init(const CpltSet::CpltSetView& x) { Set::LubRanges::init(x.var()); } } namespace CpltSet { /** * \brief %Value iterator for least upper bound of singleton set view * \ingroup TaskActorSetView */ template <> class LubValues : public LubValues { public: /// \name Constructors and initialization //@{ /// Default constructor LubValues(void); /// Initialize with ranges for view \a x LubValues(const CpltSetView& x); /// Initialize with ranges for view \a x void init(const CpltSetView& x); //@} }; forceinline LubValues::LubValues(void) {} forceinline LubValues::LubValues(const CpltSetView& x) : LubValues(x.var()) {} forceinline void LubValues::init(const CpltSetView& x) { LubValues::init(x.var()); } /// Iterator for the unknown values of a CpltSetView template <> class UnknownValues : public UnknownValues { public: /// \name Constructors and initialization //@{ /// Default constructor UnknownValues(void); /// Initialize with ranges for variable implementation \a x UnknownValues(const CpltSetView& x); /// Initialize with ranges for variable implementation \a x void init(const CpltSetView& x); //@} }; forceinline UnknownValues::UnknownValues(void) {} forceinline UnknownValues::UnknownValues(const CpltSetView& x) : UnknownValues(x.var()) {} forceinline void UnknownValues::init(const CpltSetView& x) { UnknownValues::init(x.var()); } } namespace Set { /// Range iterator for the unknown set of CpltSet view template <> class UnknownRanges : public Set::UnknownRanges { public: /// \name Constructors and initialization //@{ /// Default constructor UnknownRanges(void); /// Initialize with ranges for variable implementation \a x UnknownRanges(const CpltSet::CpltSetView& x); /// Initialize with ranges for variable implementation \a x void init(const CpltSet::CpltSetView& x); //@} }; forceinline UnknownRanges::UnknownRanges(void) {} forceinline UnknownRanges::UnknownRanges(const CpltSet::CpltSetView& x) : Set::UnknownRanges(x.var()) {} forceinline void UnknownRanges::init(const CpltSet::CpltSetView& x) { Set::UnknownRanges::init(x.var()); } } } // STATISTICS: cpltset-var