/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* * Main authors: * Christian Schulte * * Copyright: * Christian Schulte, 2011 * * Last modified: * $Date: 2011-07-14 02:16:57 +1000 (Thu, 14 Jul 2011) $ by $Author: schulte $ * $Revision: 12192 $ * * 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 Int { namespace NoOverlap { /* * Mandatory boxes * */ template forceinline const Dim& ManBox::operator [](int i) const { assert((i >= 0) && (i < n)); return d[i]; } template forceinline Dim& ManBox::operator [](int i) { assert((i >= 0) && (i < n)); return d[i]; } template forceinline int ManBox::dim(void) { return n; } template forceinline bool ManBox::mandatory(void) const { return true; } template forceinline bool ManBox::excluded(void) const { return false; } template forceinline bool ManBox::optional(void) const { return false; } template forceinline ExecStatus ManBox::exclude(Space&) { return ES_FAILED; } template forceinline bool ManBox::nooverlap(const ManBox& box) const { for (int i=0; i forceinline bool ManBox::overlap(const ManBox& box) const { for (int i=0; i forceinline ExecStatus ManBox::nooverlap(Space& home, ManBox& box) { for (int i=0; i forceinline void ManBox::update(Space& home, bool share, ManBox& b) { for (int i=0; i forceinline void ManBox::subscribe(Space& home, Propagator& p) { for (int i=0; i forceinline void ManBox::cancel(Space& home, Propagator& p) { for (int i=0; i forceinline void OptBox::optional(BoolView o0) { o = o0; } template forceinline bool OptBox::mandatory(void) const { return o.one(); } template forceinline bool OptBox::excluded(void) const { return o.zero(); } template forceinline bool OptBox::optional(void) const { return o.none(); } template forceinline ExecStatus OptBox::exclude(Space& home) { GECODE_ME_CHECK(o.zero(home)); return ES_OK; } template forceinline void OptBox::update(Space& home, bool share, OptBox& b) { ManBox::update(home, share, b); o.update(home, share, b.o); } template forceinline void OptBox::subscribe(Space& home, Propagator& p) { ManBox::subscribe(home,p); o.subscribe(home, p, PC_BOOL_VAL); } template forceinline void OptBox::cancel(Space& home, Propagator& p) { ManBox::cancel(home,p); o.cancel(home, p, PC_BOOL_VAL); } }}} // STATISTICS: int-prop