/* * Main authors: * Christian Schulte * * Copyright: * Christian Schulte, 2004 * * Last modified: * $Date: 2006-08-25 10:15:00 +0200 (Fri, 25 Aug 2006) $ by $Author: schulte $ * $Revision: 3566 $ * * 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 { namespace Int { namespace Bool { /* * Binary Boolean propagators * */ template forceinline BoolBinary::BoolBinary(Space* home, BVA b0, BVB b1) : Propagator(home), x0(b0), x1(b1) { x0.subscribe(home,this,PC_INT_VAL); x1.subscribe(home,this,PC_INT_VAL); } template forceinline BoolBinary::BoolBinary(Space* home, bool share, BoolBinary& p) : Propagator(home,share,p) { x0.update(home,share,p.x0); x1.update(home,share,p.x1); } template forceinline BoolBinary::BoolBinary(Space* home, bool share, Propagator& p, BVA b0, BVB b1) : Propagator(home,share,p) { x0.update(home,share,b0); x1.update(home,share,b1); } template PropCost BoolBinary::cost(void) const { return PC_UNARY_LO; } template size_t BoolBinary::dispose(Space* home) { assert(!home->failed()); x0.cancel(home,this,PC_INT_VAL); x1.cancel(home,this,PC_INT_VAL); (void) Propagator::dispose(home); return sizeof(*this); } /* * Ternary Boolean propagators * */ template forceinline BoolTernary::BoolTernary (Space* home, BVA b0, BVB b1, BVC b2) : Propagator(home), x0(b0), x1(b1), x2(b2) { x0.subscribe(home,this,PC_INT_VAL); x1.subscribe(home,this,PC_INT_VAL); x2.subscribe(home,this,PC_INT_VAL); } template forceinline BoolTernary::BoolTernary(Space* home, bool share, BoolTernary& p) : Propagator(home,share,p) { x0.update(home,share,p.x0); x1.update(home,share,p.x1); x2.update(home,share,p.x2); } template forceinline BoolTernary::BoolTernary(Space* home, bool share, Propagator& p, BVA b0, BVB b1, BVC b2) : Propagator(home,share,p) { x0.update(home,share,b0); x1.update(home,share,b1); x2.update(home,share,b2); } template PropCost BoolTernary::cost(void) const { return PC_BINARY_LO; } template size_t BoolTernary::dispose(Space* home) { assert(!home->failed()); x0.cancel(home,this,PC_INT_VAL); x1.cancel(home,this,PC_INT_VAL); x2.cancel(home,this,PC_INT_VAL); (void) Propagator::dispose(home); return sizeof(*this); } }}} // STATISTICS: int-prop