Generated on Wed Nov 1 15:04:45 2006 for Gecode by doxygen 1.4.5

re-nary.icc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Guido Tack <tack@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Guido Tack, 2006
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-07-12 15:53:12 +0200 (Wed, 12 Jul 2006) $ by $Author: tack $
00010  *     $Revision: 3349 $
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 Set { namespace Projection {
00023 
00024   forceinline
00025   ReNaryProjection::ReNaryProjection
00026   (Space* home, ViewArray<SetView>& x0, Gecode::Int::BoolView b0,
00027    ProjectorSet& ps0)
00028     : Propagator(home,true), x(x0), b(b0), ps(ps0) {
00029     x.subscribe(home, this, PC_SET_ANY);
00030     b.subscribe(home,this,Gecode::Int::PC_INT_VAL);
00031   }
00032 
00033   forceinline
00034   ReNaryProjection::ReNaryProjection
00035   (Space* home, bool share, ReNaryProjection& p)
00036     : Propagator(home,share,p), ps(p.ps) {
00037     x.update(home,share,p.x);
00038     b.update(home,share,p.b);
00039   }
00040 
00041   forceinline PropCost
00042   ReNaryProjection::cost(void) const {
00043     switch (x.size()) {
00044     case 1: return PC_UNARY_HI;
00045     case 2: return PC_BINARY_HI;
00046     case 3: return PC_TERNARY_HI;
00047     default: return PC_LINEAR_HI;
00048     }
00049   }
00050 
00051 }}}
00052 
00053 // STATISTICS: set-prop