/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* * Main authors: * Patrick Pekczynski * * Copyright: * Patrick Pekczynski, 2006 * * Last modified: * $Date: 2008-02-22 06:55:38 +0100 (Fri, 22 Feb 2008) $ by $Author: schulte $ * $Revision: 6274 $ * * 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 { forceinline CpltSetVar::CpltSetVar(void) {} inline void CpltSetVar::init(Space* home, int glbMin, int glbMax, int lubMin, int lubMax, unsigned int cardMin, unsigned int cardMax) { varimp = new (home) CpltSet::CpltSetVarImp(home, glbMin, glbMax, lubMin, lubMax, cardMin, cardMax); } inline void CpltSetVar::init(Space* home, int glbMin, int glbMax, const IntSet& lubD, unsigned int cardMin, unsigned int cardMax) { varimp = new (home) CpltSet::CpltSetVarImp(home, glbMin, glbMax, lubD, cardMin, cardMax); } inline void CpltSetVar::init(Space* home, const IntSet& glbD, int lubMin, int lubMax, unsigned int cardMin, unsigned int cardMax) { varimp = new (home) CpltSet::CpltSetVarImp(home, glbD, lubMin, lubMax, cardMin, cardMax); } inline void CpltSetVar::init(Space* home, const IntSet& glbD, const IntSet& lubD, unsigned int cardMin, unsigned int cardMax) { varimp = new (home) CpltSet::CpltSetVarImp(home, glbD, lubD, cardMin, cardMax); } inline void CpltSetVar::dispose(Space* home) { varimp->dispose(home); varimp = NULL; } forceinline bool CpltSetVar::contains(int i) const { return varimp->knownIn(i); } forceinline bool CpltSetVar::notContains(int i) const { return varimp->knownOut(i); } forceinline bool CpltSetVar::assigned(void) const { return varimp->assigned(); } forceinline void CpltSetVar::update(Space* home, bool share, CpltSetVar& x) { varimp = x.varimp->copy(home,share); } forceinline unsigned int CpltSetVar::cardMin(void) const { return varimp->cardMin(); }; forceinline unsigned int CpltSetVar::cardMax(void) const { return varimp->cardMax(); }; forceinline int CpltSetVar::lubMin(void) const { return varimp->lubMin(); }; forceinline int CpltSetVar::lubMax(void) const{ return varimp->lubMax(); }; forceinline int CpltSetVar::glbMin(void) const { return varimp->glbMin(); }; forceinline int CpltSetVar::glbMax(void) const { return varimp->glbMax(); }; forceinline unsigned int CpltSetVar::glbSize(void) const { return varimp->glbSize(); }; forceinline unsigned int CpltSetVar::lubSize(void) const { return varimp->lubSize(); }; forceinline unsigned int CpltSetVar::unknownSize(void) const { return varimp->unknownSize(); }; forceinline CpltSetVarGlbRanges::CpltSetVarGlbRanges(void) {} forceinline CpltSetVarGlbRanges::CpltSetVarGlbRanges(const CpltSetVar& x) : iter(x.var()) {} forceinline bool CpltSetVarGlbRanges::operator()(void) const { return iter(); } forceinline void CpltSetVarGlbRanges::operator++(void) { ++iter; } forceinline int CpltSetVarGlbRanges::min(void) const { return iter.min(); } forceinline int CpltSetVarGlbRanges::max(void) const { return iter.max(); } forceinline CpltSetVarGlbValues::CpltSetVarGlbValues(void) {} forceinline CpltSetVarGlbValues::CpltSetVarGlbValues(const CpltSetVar& x) : iter(x.var()) {} forceinline bool CpltSetVarGlbValues::operator()(void) const { return iter(); } forceinline void CpltSetVarGlbValues::operator++(void) { ++iter; } forceinline int CpltSetVarGlbValues::val(void) const { return iter.val(); } forceinline CpltSetVarLubRanges::CpltSetVarLubRanges(void) {} forceinline CpltSetVarLubRanges::CpltSetVarLubRanges(const CpltSetVar& x) : iter(x.var()) {} forceinline bool CpltSetVarLubRanges::operator()(void) const { return iter(); } forceinline void CpltSetVarLubRanges::operator++(void) { ++iter; } forceinline int CpltSetVarLubRanges::min(void) const { return iter.min(); } forceinline int CpltSetVarLubRanges::max(void) const { return iter.max(); } forceinline CpltSetVarLubValues::CpltSetVarLubValues(void) {} forceinline CpltSetVarLubValues::CpltSetVarLubValues(const CpltSetVar& x) : iter(x.var()) {} forceinline bool CpltSetVarLubValues::operator()(void) const { return iter(); } forceinline void CpltSetVarLubValues::operator++(void) { ++iter; } forceinline int CpltSetVarLubValues::val(void) const {return iter.val();} forceinline CpltSetVarUnknownRanges::CpltSetVarUnknownRanges(void) {} forceinline CpltSetVarUnknownRanges::CpltSetVarUnknownRanges(const CpltSetVar& x) : iter(x.var()) {} forceinline bool CpltSetVarUnknownRanges::operator()(void) const { return iter(); } forceinline void CpltSetVarUnknownRanges::operator++(void) { ++iter; } forceinline int CpltSetVarUnknownRanges::min(void) const { return iter.min(); } forceinline int CpltSetVarUnknownRanges::max(void) const { return iter.max(); } } // STATISTICS: cpltset-var