/* * Main authors: * Christian Schulte * * Copyright: * Christian Schulte, 2002 * * Last modified: * $Date: 2005-10-27 17:04:11 +0200 (Thu, 27 Oct 2005) $ by $Author: schulte $ * $Revision: 2418 $ * * This file is part of Gecode, the generic constraint * development environment: * http://www.gecode.org * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a * DISCLAIMER OF ALL WARRANTIES. * */ namespace Gecode { forceinline BoolVar::BoolVar(void) {} forceinline BoolVar::BoolVar(Space* home, int min, int max) : IntVar(home,min,max) { if ((min < 0) || (max > 1)) throw Int::VariableOutOfRangeDomain("BoolVar"); } forceinline BoolVar::BoolVar(const Int::BoolView& b) : IntVar(b) {} forceinline void BoolVar::update(Space* home, bool share, BoolVar& x) { var = x.var->copy(home,share); } forceinline BoolVar::BoolVar(const IntVar& x) : IntVar(x) { if ((x.min() < 0) || (x.max() > 1)) throw Int::VariableOutOfRangeDomain("BoolVar"); } } // STATISTICS: int-var