Generated on Wed Jan 4 17:49:08 2006 for Gecode by doxygen 1.4.6

base.icc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Christian Schulte, 2004
00007  *
00008  *  Last modified:
00009  *     $Date: 2005-10-23 16:23:09 +0200 (Sun, 23 Oct 2005) $ by $Author: schulte $
00010  *     $Revision: 2403 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
00019  *
00020  */
00021 
00022 namespace Gecode { namespace Int { namespace Bool {
00023 
00024   /*
00025    * Binary Boolean propagators
00026    *
00027    */
00028   template<class BVA, class BVB>
00029   forceinline
00030   BoolBinary<BVA,BVB>::BoolBinary(Space* home, BVA b0, BVB b1)
00031     : Propagator(home), x0(b0), x1(b1) {
00032     x0.subscribe(home,this,PC_INT_VAL);
00033     x1.subscribe(home,this,PC_INT_VAL);
00034   }
00035 
00036   template<class BVA, class BVB>
00037   forceinline
00038   BoolBinary<BVA,BVB>::BoolBinary(Space* home, bool share, 
00039                                   BoolBinary<BVA,BVB>& p) 
00040     : Propagator(home,share,p) {
00041     x0.update(home,share,p.x0);
00042     x1.update(home,share,p.x1);
00043   }
00044 
00045   template<class BVA, class BVB>
00046   PropCost
00047   BoolBinary<BVA,BVB>::cost(void) const {
00048     return PC_UNARY_LO;
00049   }
00050 
00051   template<class BVA, class BVB>
00052   BoolBinary<BVA,BVB>::~BoolBinary(void) {
00053     x0.cancel(this,PC_INT_VAL);
00054     x1.cancel(this,PC_INT_VAL);
00055   }
00056 
00057   /*
00058    * Ternary Boolean propagators
00059    *
00060    */
00061   template<class BVA, class BVB, class BVC>
00062   forceinline
00063   BoolTernary<BVA,BVB,BVC>::BoolTernary
00064   (Space* home, BVA b0, BVB b1, BVC b2)
00065     : Propagator(home), x0(b0), x1(b1), x2(b2) {
00066     x0.subscribe(home,this,PC_INT_VAL);
00067     x1.subscribe(home,this,PC_INT_VAL);
00068     x2.subscribe(home,this,PC_INT_VAL);
00069   }
00070 
00071   template<class BVA, class BVB, class BVC>
00072   forceinline
00073   BoolTernary<BVA,BVB,BVC>::BoolTernary(Space* home, bool share, 
00074                                         BoolTernary<BVA,BVB,BVC>& p) 
00075     : Propagator(home,share,p) {
00076     x0.update(home,share,p.x0);
00077     x1.update(home,share,p.x1);
00078     x2.update(home,share,p.x2);
00079   }
00080 
00081   template<class BVA, class BVB, class BVC>
00082   PropCost
00083   BoolTernary<BVA,BVB,BVC>::cost(void) const {
00084     return PC_BINARY_LO;
00085   }
00086 
00087   template<class BVA, class BVB, class BVC>
00088   BoolTernary<BVA,BVB,BVC>::~BoolTernary(void) {
00089     x0.cancel(this,PC_INT_VAL);
00090     x1.cancel(this,PC_INT_VAL);
00091     x2.cancel(this,PC_INT_VAL);
00092   }
00093 
00094 }}}
00095 
00096 // STATISTICS: int-prop
00097